# Initialize your L2

**Note: We use the terms "Proxy" and "Light Client" interchangeably.**

## Navigate to rome-setup/docker directory

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

## Set environment variables

```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
```

## Generate Solana keypairs

Generate two new Solana keypairs in rome-apps/docker/keys, called **Rhea keypair** and **Proxy keypair**. These keypairs will be used by the Rhea and Light Client services (explained on the next page) to sign and pay for Solana transactions.

```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 SOLs

Airdrop SOLs to your **Rhea** and **Proxy keypairs** using below commands:

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

If you are having problems with airdrops, [contact us on our Discord](https://discord.com/invite/romeprotocol).

## Generate JWT secret

Generate a [JWT secret](https://jwt.io/introduction) that will be used by Geth. Store this secret securely.

```
openssl rand -hex 32
```

Example value below.

```
7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d
```

## Check Solana Slot

Check the Solana slot, and update start\_slot in proxy-config.yml and rhea-config.yml (located in rome-setup/docker/cfg) with current slot.

```bash
solana slot
```

This slot will be used by Rhea and Light Client (i.e. Proxy) to determine the rollup's current state based on Solana transaction history beginning from the start slot.

## Copy Nginx Certificate

If setting up on a remote server, then copy nginx certificates to your local directory. If you are setting up locally, then skip this step.

**Note: Replace the file path below with the location of your certificate.**

<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>

## Update Configuration Files

### Docker Compose

1. Update `docker-compose.yml` to replace CHAIN\_ID and JWT\_SECRET values.

<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. If you are setting up your L2 on a remote server, then uncomment the romenginx container in `docker-compose.yml`. Otherwise if setting up on your local machine, skip this step.

### Rhea Config

Update rhea-config.yml to set chain\_id, solana rpc\_urls, and payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>chain_id: 98989897 # Replace this with your registered chain id
</strong><strong>rpc_urls: ["https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"] # Replace this with 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 # (Seconds) Value higher of comparable to real op-geth TTL will prevent rhea from repeated sending
</code></pre>

### Hercules Config

Update hercules-config.yml to set chain\_id, start\_slot, solana rpc, geth\_engine\_secret, and payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>start_slot: 385523275 # Replace this with your latest solana slot
</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" # Replace this with 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 # Replace this with your registered Chain ID
</strong>    parse_mode: engine_api
  block_producer:
    type: engine_api
    geth_engine:
      geth_engine_addr: "http://geth:8551"
<strong>      geth_engine_secret: "7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d" # Replace this with your generated JWT Secret
</strong>    geth_api: "http://geth:8545"
</code></pre>

### Proxy Config

Update proxy-config.yml to set chain\_id, start\_slot, solana rpc\_url, and payers.

<pre class="language-yaml"><code class="lang-yaml"><strong>chain_id: 98989897 # Replace this with your registered chain id
</strong><strong>start_slot: 385523275 # Replace this with your latest solana slot
</strong>program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
solana:
<strong>  rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz" # Replace this with 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>

### Deposit UI Config

Modify the two files below.

* `rome-setup/docker/depositui/chains.yml` to specify `chainId` .
* `rome-setup/docker/depositui/env.depositui` to specify `NEXT_PUBLIC_SOLANA_RPC_URL` .

### Specifying payers

Specify multiple payers to increase throughput as more transactions can be executed in parallel by having more payers.

### Specifying fee\_recipients

Specify fee\_recipients as Ethereum addresses that will receive L2 native tokens as compensation for executing Solana transactions.

If fee\_recipient is not specified, then no L2 native tokens are transferred for compensation.

Specify multiple fee\_recipients to increase throughput as more transactions can be executed in parallel by having more fee recipients.


---

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