> 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/id/memulai/quickstart.md).

# Quickstart

Deploy kontrak Solidity pertama Anda di Rome dalam waktu kurang dari 5 menit. Panduan ini ditujukan untuk **Martius**, rantai testnet publik; langkah yang sama berlaku pada [Hadrian](/id/jaringan/hadrian.md) (devnet) dengan menukar nilai jaringan.

## Prasyarat

* [Node.js](https://nodejs.org/) v22.13+
* [MetaMask](https://metamask.io/) ekstensi peramban
* Dompet Solana (mis. Phantom) yang disetel ke **Devnet**

## 1. Tambahkan Martius ke MetaMask

Tambahkan secara manual (Setelan → Jaringan → Tambahkan jaringan):

| Bidang           | Nilai                                           |
| ---------------- | ----------------------------------------------- |
| Nama Jaringan    | Rome Martius                                    |
| URL RPC          | `https://martius.testnet.romeprotocol.xyz/`     |
| Chain ID         | `121214`                                        |
| Simbol Mata Uang | `USDC`                                          |
| Penjelajah Blok  | `https://via-martius.testnet.romeprotocol.xyz/` |

## 2. Isi dana dompet Anda

Gas dibayar dalam token gas SPL milik chain (USDC di Martius). Ada dua cara untuk mendapatkannya:

**Dari Solana** — dapatkan SOL devnet dari [faucet Solana](https://faucet.solana.com/) (setel dompet Solana Anda ke Devnet), lalu buka [Aplikasi Rome](https://app.testnet.romeprotocol.xyz), hubungkan kedua dompet, lalu bungkus ke token gas.

**Dengan bridging masuk** — mint USDC uji di Ethereum Sepolia dari [faucet Circle](https://faucet.circle.com/), lalu bawa ke Rome dengan [Jembatan Rome](/id/aplikasi-di-rome/bridge-api.md) (CCTP). Anda akan memerlukan sedikit ETH Sepolia untuk transaksi di sisi sumber — lihat [Faucet](/id/sumber-daya/faucets.md) untuk setiap faucet.

**Berapa banyak?** Deploy kontrak di Rome membawa biaya akun di sisi Solana, jadi perkiraan gas jauh lebih tinggi daripada intuisi ala Ethereum — kontrak quickstart memperkirakan \~20M gas dan biayanya sekitar **0.2 USDC** untuk di-deploy, dan dompet melakukan pengecekan awal sekitar dua kali perkiraan. Isi setidaknya **0.5 USDC gas**; 1 USDC memberi ruang aman yang nyaman.

Jika deposit di sisi Solana gagal dengan peringatan "insufficient SOL" meskipun dompet terisi, setel dompet Solana Anda ke Testnet Mode / Devnet (lihat [FAQ](/id/sumber-daya/faq.md)).

## 3. Buat proyek Hardhat

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

Terima default saat diminta — Hardhat 3, direktori saat ini, dan templat TypeScript + Node Test Runner + viem — lalu biarkan ia memasang dependensi. Templat ini menyertakan contoh `Counter` kontrak beserta pengujiannya; itu tidak mengganggu panduan ini.

## 4. Konfigurasikan Hardhat untuk Rome

Edit file yang dihasilkan `hardhat.config.ts` dan tambahkan jaringan Rome di dalam `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")` diambil dari lingkungan, jadi ekspor private key MetaMask Anda:

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

(Untuk apa pun selain kunci sekali pakai, lebih baik gunakan keystore terenkripsi yang disertakan dengan toolbox: `npx hardhat keystore set PRIVATE_KEY`.)

## 5. Tulis kontrak

Buat `contracts/HelloRome.sol`:

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

contract HelloRome {
    string public greeting = "Halo dari Solana!";
    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. Deploy

Buat `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 deployed to:", hello.address);

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

  console.log("Counter:", (await hello.read.counter()).toString());
  console.log("Greeting:", await hello.read.greeting());
}

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

Deploy ke Martius:

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

Keluaran yang diharapkan (alamat Anda akan berbeda):

```
HelloRome deployed to: 0x09c437e305eeb698e1776cff23ca16c1bb25aabd
Counter: 1
Greeting: Halo dari Solana!
```

Buka alamat yang di-deploy di [penjelajah](https://via-martius.testnet.romeprotocol.xyz/) untuk melihat instruksi Solana di balik transaksi Anda. Kontrak Solidity Anda sekarang berjalan di Solana.

## Selanjutnya

* [Deploy Solidity](/id/panduan-pengembang/deploy-solidity.md) — pendalaman deployment Hardhat dan Foundry
* [Panggil Solana dari EVM](/id/panduan-pengembang/call-solana-from-evm.md) — panggil program Solana dari Solidity via CPI
* [Arsitektur](/id/memulai/architecture.md) — bagaimana Rome mengeksekusi EVM di dalam Solana

## Kesalahan Umum

| Kesalahan              | Penyebab                                                                    | Perbaikan                                                                                                               |
| ---------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `dana tidak mencukupi` | Token gas tidak cukup — dompet melakukan pengecekan awal \~2× perkiraan gas | Isi setidaknya 0.5 USDC gas (lihat langkah 2) melalui [Aplikasi Rome](https://app.testnet.romeprotocol.xyz) atau bridge |
| `nonce terlalu rendah` | Ketidaksesuaian nonce transaksi                                             | Atur ulang akun (MetaMask → Setelan → Lanjutan → Hapus aktivitas)                                                       |
| `eksekusi dibatalkan`  | Eksekusi kontrak gagal                                                      | Periksa logika kontrak; gunakan `eth_call` untuk men-debug                                                              |
| Batas waktu koneksi    | RPC tidak dapat dijangkau                                                   | Verifikasi URL RPC                                                                                                      |


---

# 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/id/memulai/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.
