# Inisialisasi L2 Anda

**Catatan: Kami menggunakan istilah "Proxy" dan "Light Client" secara bergantian.**

## Arahkan ke direktori rome-setup/docker

```
cd rome-setup/docker
```

## Atur variabel lingkungan

```bash
export ROME_APPS_TAG=v1.0.1
export DEPOSIT_UI_TAG=v1.0.1
export GETH_TAG=v1.0.1

solana config set -u https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz
```

## Hasilkan pasangan kunci Solana

Hasilkan dua pasangan kunci Solana baru di rome-apps/docker/keys, bernama **pasangan kunci Rhea** dan **pasangan kunci Proxy**. Pasangan kunci ini akan digunakan oleh layanan Rhea dan Light Client (dijelaskan di halaman berikutnya) untuk menandatangani dan membayar transaksi Solana.

```bash
solana-keygen new -o keys/rhea-sender.json --no-bip39-passphrase --force
solana-keygen new -o keys/proxy-sender.json --no-bip39-passphrase --force
```

## Airdrop SOL

Airdrop SOL ke **Rhea** dan **pasangan kunci Proxy** menggunakan perintah di bawah:

```bash
solana -ud airdrop 1 $(solana address -k keys/rhea-sender.json)
solana -ud airdrop 1 $(solana address -k keys/proxy-sender.json)
```

Jika Anda mengalami masalah dengan airdrop, [menghubungi kami di Discord kami](https://discord.com/invite/romeprotocol).

## Hasilkan rahasia JWT

Hasilkan sebuah [rahasia JWT](https://jwt.io/introduction) yang akan digunakan oleh Geth. Simpan rahasia ini dengan aman.

```
openssl rand -hex 32
```

Contoh nilai di bawah.

```
7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d
```

## Periksa Slot Solana

Periksa slot Solana, dan perbarui start\_slot di proxy-config.yml dan rhea-config.yml (terletak di rome-setup/docker/cfg) dengan slot saat ini.

```bash
solana slot
```

Slot ini akan digunakan oleh Rhea dan Light Client (mis. Proxy) untuk menentukan status rollup saat ini berdasarkan riwayat transaksi Solana mulai dari start slot.

## Salin Sertifikat Nginx

Jika mengatur di server jarak jauh, salin sertifikat nginx ke direktori lokal Anda. Jika Anda mengatur secara lokal, lewati langkah ini.

**Catatan: Ganti jalur file di bawah dengan lokasi sertifikat Anda.**

<pre class="language-bash"><code class="lang-bash">mkdir -p ./nginx/ssl
<strong>sudo cp /etc/letsencrypt/live/caesar.internal.romeprotocol.xyz/fullchain.pem ./nginx/ssl/
</strong><strong>sudo cp /etc/letsencrypt/live/caesar.internal.romeprotocol.xyz/privkey.pem ./nginx/ssl/
</strong></code></pre>

## Perbarui Berkas Konfigurasi

### Docker Compose

1. Perbarui `docker-compose.yml` untuk mengganti nilai CHAIN\_ID dan JWT\_SECRET.

<pre class="language-yaml"><code class="lang-yaml">geth:
  image: romelabs/rollup-op-geth:${GETH_TAG:-main}
  logging: *logging-config
  hostname: geth
  container_name: geth
  environment:
<strong>    CHAIN_ID: '98989897'
</strong><strong>    JWT_SECRET: '7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d'
</strong>...
</code></pre>

2. Jika Anda menyiapkan L2 Anda di server jarak jauh, maka aktifkan kembali (uncomment) container romenginx di `docker-compose.yml`. Jika tidak, jika menyiapkan di mesin lokal Anda, lewati langkah ini.

### Konfigurasi Rhea

Perbarui rhea-config.yml untuk mengatur chain\_id, solana rpc\_urls, dan payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>chain_id: 98989897 # Ganti ini dengan chain id yang terdaftar milik Anda
</strong><strong>rpc_urls: ["https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"] # Ganti ini dengan Rome Solana RPC
</strong>program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
commitment: "confirmed"
payers:
  - payer_keypair: "/opt/keys/rhea-sender.json"
    fee_recipients:
      - 0x5f5d351dB427d1131D8Dcd4F151185E6E6111907
geth_indexer:
  geth_http_addr: "http://geth:8545"
  geth_poll_interval_ms: 100
mempool_ttl: 15 # (Detik) Nilai yang lebih tinggi dibandingkan TTL op-geth nyata akan mencegah rhea mengirim berulang kali
</code></pre>

### Konfigurasi Hercules

Perbarui hercules-config.yml untuk mengatur chain\_id, start\_slot, solana rpc, geth\_engine\_secret, dan payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>start_slot: 385523275 # Ganti ini dengan slot solana terbaru Anda
</strong>admin_rpc: "0.0.0.0:8000"
mode: Indexer
block_loader:
  program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
  batch_size: 64
  block_retries: 100
  tx_retries: 100
  retry_int_sec: 1
  commitment: "confirmed"
  client:
    providers:
<strong>      - "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz" # Ganti ini dengan Rome Solana RPC
</strong>storage:
  connection:
    database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup"
    max_connections: 16
    connection_timeout_sec: 30
rollup_indexer:
  max_slot_history: 4096
  block_parser:
    program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
<strong>    chain_id: 98989897 # Ganti ini dengan Chain ID yang terdaftar milik Anda
</strong>    parse_mode: engine_api
  block_producer:
    type: engine_api
    geth_engine:
      geth_engine_addr: "http://geth:8551"
<strong>      geth_engine_secret: "7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d" # Ganti ini dengan Rahasia JWT yang Anda hasilkan
</strong>    geth_api: "http://geth:8545"
</code></pre>

### Konfigurasi Proxy

Perbarui proxy-config.yml untuk mengatur chain\_id, start\_slot, solana rpc\_url, dan payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>chain_id: 98989897 # Ganti ini dengan chain id yang terdaftar milik Anda
</strong><strong>start_slot: 385523275 # Ganti ini dengan slot solana terbaru Anda
</strong>program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
solana:
<strong>  rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz" # Ganti ini dengan Rome Solana RPC
</strong>  commitment: "confirmed"
payers:
  - payer_keypair: "/opt/keys/proxy-sender.json"
    fee_recipients:
      - 0x5f5d351dB427d1131D8Dcd4F151185E6E6111907
ethereum_storage:
  type: "pg_storage"
  connection:
    database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup"
    max_connections: 16
proxy_host: "0.0.0.0:9090"
max_slot_history: 4096
gas_price: 1000000000
</code></pre>

### Konfigurasi Deposit UI

Ubah dua berkas di bawah ini.

* `rome-setup/docker/depositui/chains.yml` untuk menentukan `chainId` .
* `rome-setup/docker/depositui/env.depositui` untuk menentukan `NEXT_PUBLIC_SOLANA_RPC_URL` .

### Menentukan payers

Tentukan beberapa payers untuk meningkatkan throughput karena lebih banyak transaksi dapat dieksekusi secara paralel dengan memiliki lebih banyak payer.

### Menentukan fee\_recipients

Tentukan fee\_recipients sebagai alamat Ethereum yang akan menerima token native L2 sebagai kompensasi untuk mengeksekusi transaksi Solana.

Jika fee\_recipient tidak ditentukan, maka tidak ada token native L2 yang ditransfer sebagai kompensasi.

Tentukan beberapa fee\_recipients untuk meningkatkan throughput karena lebih banyak transaksi dapat dieksekusi secara paralel dengan memiliki lebih banyak penerima biaya.


---

# Agent Instructions: 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:

```
GET https://docs.rome.builders/id/legacy/rome-l2-setup/setup-your-l2/initialize-your-l2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
