Initialize your L2

Walks through setting environment variables, generating secrets, configuring YAML files, and airdropping SOL for Rhea and Proxy keypairs.

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

cd rome-setup/docker

Set environment variables

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.

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:

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.

Generate JWT secret

Generate a JWT secret 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.

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.

mkdir -p ./nginx/ssl
sudo cp /etc/letsencrypt/live/caesar.internal.romeprotocol.xyz/fullchain.pem ./nginx/ssl/
sudo cp /etc/letsencrypt/live/caesar.internal.romeprotocol.xyz/privkey.pem ./nginx/ssl/

Update Configuration Files

Docker Compose

  1. Update docker-compose.yml to replace CHAIN_ID and JWT_SECRET values.

geth:
  image: romelabs/rollup-op-geth:${GETH_TAG:-main}
  logging: *logging-config
  hostname: geth
  container_name: geth
  environment:
    CHAIN_ID: '98989897'
    JWT_SECRET: '7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d'
...
  1. 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.

chain_id: 98989897 # Replace this with your registered chain id
rpc_urls: ["https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"] # Replace this with Rome Solana RPC
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

Hercules Config

Update hercules-config.yml to set chain_id, start_slot, solana rpc, geth_engine_secret, and payers.

start_slot: 385523275 # Replace this with your latest solana slot
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:
      - "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz" # Replace this with Rome Solana RPC
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"
    chain_id: 98989897 # Replace this with your registered Chain ID
    parse_mode: engine_api
  block_producer:
    type: engine_api
    geth_engine:
      geth_engine_addr: "http://geth:8551"
      geth_engine_secret: "7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d" # Replace this with your generated JWT Secret
    geth_api: "http://geth:8545"

Proxy Config

Update proxy-config.yml to set chain_id, start_slot, solana rpc_url, and payers.

chain_id: 98989897 # Replace this with your registered chain id
start_slot: 385523275 # Replace this with your latest solana slot
program_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"
solana:
  rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz" # Replace this with Rome Solana RPC
  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

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.

Last updated

Was this helpful?