> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/ar/albda/quickstart.md).

# البدء السريع

انشر أول عقد Solidity لك على روما في أقل من 5 دقائق. يستهدف هذا الدليل **مارتيوس**، سلسلة شبكة الاختبار العامة؛ تعمل الخطوات نفسها على [هادريان](/ar/alshbkat/hadrian.md) (شبكة التطوير) عبر تبديل قيم الشبكة.

## المتطلبات الأساسية

* [Node.js](https://nodejs.org/) v22.13+
* [MetaMask](https://metamask.io/) إضافة للمتصفح
* محفظة Solana (مثل Phantom) مضبوطة على **Devnet**

## 1. أضف Martius إلى MetaMask

أضِفه يدويًا (الإعدادات → الشبكات → إضافة شبكة):

| الحقل         | القيمة                                          |
| ------------- | ----------------------------------------------- |
| اسم الشبكة    | روما مارتيوس                                    |
| عنوان RPC     | `https://martius.testnet.romeprotocol.xyz/`     |
| معرّف السلسلة | `121214`                                        |
| رمز العملة    | `USDC`                                          |
| مستكشف الكتل  | `https://via-martius.testnet.romeprotocol.xyz/` |

## 2. موّل محفظتك

تُدفع رسوم الغاز برمز الغاز SPL الخاص بالسلسلة (USDC على Martius). هناك طريقتان للحصول عليه:

**من Solana** — احصل على SOL الخاص بشبكة التطوير من [صنبور Solana](https://faucet.solana.com/) (اضبط محفظة Solana على Devnet)، ثم افتح [تطبيق روما](https://app.testnet.romeprotocol.xyz)، ثم وصّل كلتا المحفظتين، وحوّلها إلى رمز الغاز.

**عن طريق الجسر** — اصك USDC تجريبيًا على Ethereum Sepolia من [صنبور Circle](https://faucet.circle.com/)، ثم انقله إلى روما باستخدام [جسر روما](/ar/alttbyqat-ala-rome/bridge-api.md) (CCTP). ستحتاج إلى مقدار قليل من ETH على Sepolia لمعاملة جهة المصدر — راجع [الصنابير](/ar/almward/faucets.md) لكل صنبور.

**كم المبلغ؟** عمليات نشر العقود على روما تتضمن تكاليف حسابات من جهة Solana، لذا تكون تقديرات الغاز أعلى بكثير من الحدس المستند إلى Ethereum — يقدّر عقد البدء السريع نحو 20 مليون غاز وتكلفته حوالي **0.2 USDC** للنشر، وتفحص المحافظ مسبقًا ما يقارب ضعف التقدير مقدمًا. موّل ما لا يقل **0.5 USDC من الغاز**؛ 1 USDC يترك هامشًا مريحًا.

إذا فشل إيداع من جهة Solana مع تحذير "insufficient SOL" رغم أن المحفظة ممولة، فاضبط محفظة Solana على وضع Testnet / Devnet (راجع [الأسئلة الشائعة](/ar/almward/faq.md)).

## 3. أنشئ مشروع Hardhat

```bash
mkdir rome-hello && cd rome-hello
npx hardhat --init
```

اقبل القيم الافتراضية عند الطلب — Hardhat 3، والمجلد الحالي، وقالب TypeScript + Node Test Runner + viem — ودعه يثبت التبعيات. يأتي القالب مع مثال `Counter` لعقد مع اختبارات؛ ولا تتداخل مع هذا الدليل.

## 4. اضبط Hardhat لـ روما

حرر الملف المُنشأ `hardhat.config.ts` وأضف شبكات روما داخل `defineConfig({ ... })`:

```typescript
  networks: {
    martius: {
      type: "http",
      chainType: "l1",
      chainId: 121214,
      url: "https://martius.testnet.romeprotocol.xyz/",
      accounts: [configVariable("PRIVATE_KEY")],
    },
    rome_local: {
      type: "http",
      chainType: "l1",
      chainId: 1001,
      url: "http://localhost:9090",
      accounts: [configVariable("PRIVATE_KEY")],
    },
  },
```

`configVariable("PRIVATE_KEY")` يُحَلّ من البيئة، لذا صدّر المفتاح الخاص لـ MetaMask:

```bash
export PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
```

(لأي شيء يتجاوز مفتاحًا مؤقتًا، يُفضّل استخدام مخزن المفاتيح المشفّر المرفق مع صندوق الأدوات: `npx hardhat keystore set PRIVATE_KEY`.)

## 5. اكتب عقدًا

أنشئ `contracts/HelloRome.sol`:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

contract HelloRome {
    string public greeting = "مرحبًا من سولانا!";
    uint256 public counter;

    event Greeted(address indexed sender, uint256 count);

    function greet() external returns (string memory) {
        counter++;
        emit Greeted(msg.sender, counter);
        return greeting;
    }

    function setGreeting(string calldata _greeting) external {
        greeting = _greeting;
    }
}
```

## 6. انشر

أنشئ `scripts/deploy.ts`:

```typescript
import hardhat from "hardhat";

async function main() {
  const { viem } = await hardhat.network.connect();
  const publicClient = await viem.getPublicClient();

  const hello = await viem.deployContract("HelloRome");
  console.log("تم نشر HelloRome إلى:", hello.address);

  const hash = await hello.write.greet();
  await publicClient.waitForTransactionReceipt({ hash });

  console.log("العداد:", (await hello.read.counter()).toString());
  console.log("التحية:", await hello.read.greeting());
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
```

انشر على Martius:

```bash
npx hardhat run scripts/deploy.ts --network martius
```

المخرجات المتوقعة (سيختلف عنوانك):

```
تم نشر HelloRome إلى: 0x09c437e305eeb698e1776cff23ca16c1bb25aabd
العداد: 1
التحية: مرحبًا من سولانا!
```

افتح العنوان المنشور في [المستكشف](https://via-martius.testnet.romeprotocol.xyz/) لمشاهدة تعليمات Solana خلف معاملتك. أصبح عقد Solidity الخاص بك يعمل الآن على Solana.

## ما التالي

* [نشر Solidity](/ar/adlh-almtwr/deploy-solidity.md) — النشر باستخدام Hardhat وFoundry بالتفصيل
* [استدعِ Solana من EVM](/ar/adlh-almtwr/call-solana-from-evm.md) — استدعِ برامج Solana من Solidity عبر CPI
* [البنية](/ar/albda/architecture.md) — كيف يشغّل Rome آلة EVM داخل Solana

## الأخطاء الشائعة

| الخطأ                   | السبب                                                                      | الإصلاح                                                                                                              |
| ----------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `أموال غير كافية`       | لا يوجد ما يكفي من رمز الغاز — تفحص المحافظ مسبقًا ما يقارب 2× تقدير الغاز | موّل بما لا يقل عن 0.5 USDC من الغاز (انظر الخطوة 2) عبر [تطبيق روما](https://app.testnet.romeprotocol.xyz) أو الجسر |
| `nonce منخفض جدًا`      | عدم تطابق nonce للمعاملة                                                   | أعد ضبط الحساب (MetaMask → الإعدادات → متقدم → مسح النشاط)                                                           |
| `تم التراجع عن التنفيذ` | فشل تنفيذ العقد                                                            | تحقق من منطق العقد؛ استخدم `eth_call` للتصحيح                                                                        |
| انتهت مهلة الاتصال      | تعذر الوصول إلى RPC                                                        | تحقق من عنوان RPC URL                                                                                                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rome.builders/ar/albda/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
