Skip to content

Module 2 - Register and Initialize your L2

Submit your registration request using this form: https://register.devnet.romeprotocol.xyz.

Once you submit the request, we will register your chain and show you a success message.

If you have questions, you can contact us on our Discord.

An example form submission is provided below.

Setup the environment needed to setup the L2. Generate secrets, key pairs, set environment variables, and update configuration files.

Generate a JWT secret that will be used by Geth. Store this secret securely.

Terminal window
openssl rand -hex 32

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.

Terminal window
cd rome-setup/docker
solana-keygen new -o keys/rhea-sender.json --no-bip39-passphrase --force
solana-keygen new -o keys/proxy-sender.json --no-bip39-passphrase --force

Set Chain ID and JWT Secret below.

Terminal window
export CHAIN_ID=98989897
export GENESIS_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2
export JWT_SECRET=7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d
export GASOMETER_HOST=http://proxy:9090
export SOLANA_RPC=https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz
export PROGRAM_ID=RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq
export ETH_DEPOSIT_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2
export ETH_DEPOSIT_GWEI='1000000000'
export ROME_EVM_TAG=v1.0.0
export RHEA_TAG=v1.0.0
export HERCULES_TAG=v1.0.0
export PROXY_TAG=v1.0.0
export CLI_TAG=v1.0.0
export GETH_TAG=v1.0.0

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

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.

Terminal window
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.

Update rhea-config.yml to set chain_id, start_slot, solana_url, and payers. solana rpc_url is for submitting transactions to Solana.

chain_id: 98989897
start_slot: 385523275
program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq"
solana:
rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"
payers:
- payer_keypair: "/opt/rhea-sender.json"
fee_recipients:
- 0xB515207148c409075D0048247bfdDd8399072A14
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

Update hercules-config.yml to set chain_id, start_slot, solana_url, geth_engine_secret, and payers. solana rpc_url is for indexing transactions from Solana.

block_loader:
program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq"
batch_size: 64
block_retries: 10
tx_retries: 100
retry_int_sec: 1
commitment: "confirmed"
client:
providers:
- "https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz"
- "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"
start_slot: 385523275
solana_storage:
type: pg_storage
connection:
database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup"
max_connections: 16
connection_timeout_sec: 30
block_parser:
program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq"
chain_id: 98989897
parse_mode: engine_api
ethereum_storage:
type: pg_storage
connection:
database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup"
max_connections: 16
connection_timeout_sec: 30
block_producer:
type: engine_api
geth_engine:
geth_engine_addr: "http://geth:8551"
geth_engine_secret: "7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d"
geth_api: "http://geth:8545"
admin_rpc: "0.0.0.0:8000"
max_slot_history: 4096
block_loader_batch_size: 128
mode: Indexer

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

chain_id: 98989897
start_slot: 385523275
program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq"
solana:
rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"
commitment: "confirmed"
payers:
- payer_keypair: "/opt/proxy-sender.json"
fee_recipients:
- 0xC185E444674aF38251c233c9943Ed8ef82da608a
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

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

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.

Airdrop SOLs to your Rhea, Proxy and source account keypairs using below commands:

Terminal window
solana -ud airdrop 1 $(solana address -k keys/rhea-sender.json)
solana -ud airdrop 1 $(solana address -k keys/proxy-sender.json)
solana -ud airdrop 1 $(solana address -k keys/source-account-keypair.json)