Module 2 - Register and Initialize your L2
Register your L2 using Chain ID
Section titled “Register your L2 using Chain ID”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.
Initialize your L2
Section titled “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.
Navigate to rome-setup/docker directory
Section titled “Navigate to rome-setup/docker directory”cd rome-setup/dockerSet environment variables
Section titled “Set environment variables”export ROME_APPS_TAG=v1.0.1export DEPOSIT_UI_TAG=v1.0.1export GETH_TAG=v1.0.1
solana config set -u https://node3.devnet-us-sol-api.devnet.romeprotocol.xyzGenerate Solana keypairs
Section titled “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 --forcesolana-keygen new -o keys/proxy-sender.json --no-bip39-passphrase --forceAirdrop SOLs
Section titled “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
Section titled “Generate JWT secret”Generate a JWT secret that will be used by Geth. Store this secret securely.
openssl rand -hex 32Example value below.
7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40dCheck Solana Slot
Section titled “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 slotThis 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
Section titled “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/sslsudo 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
Section titled “Update Configuration Files”Docker Compose
Section titled “Docker Compose”- Update
docker-compose.ymlto 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' # Replace this with your generated Chain ID JWT_SECRET: '7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40d' # Replace this with your generated JWT Secret...- 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
Section titled “Rhea Config”Update rhea-config.yml to set chain_id, solana rpc_urls, and payers.
chain_id: 98989897 # Replace this with your registered chain idrpc_urls: ["https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"] # Replace this with Rome Solana RPCprogram_id: "RPDwFyw4ekzzgyJfSrVmJgmfi51ovyqzLckYGchLpKX"commitment: "confirmed"payers: - payer_keypair: "/opt/keys/rhea-sender.json" fee_recipients: - 0x5f5d351dB427d1131D8Dcd4F151185E6E6111907geth_indexer: geth_http_addr: "http://geth:8545" geth_poll_interval_ms: 100mempool_ttl: 15 # (Seconds) Value higher of comparable to real op-geth TTL will prevent rhea from repeated sendingHercules Config
Section titled “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 slotadmin_rpc: "0.0.0.0:8000"mode: Indexerblock_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 RPCstorage: connection: database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup" max_connections: 16 connection_timeout_sec: 30rollup_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
Section titled “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 idstart_slot: 385523275 # Replace this with your latest solana slotprogram_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: - 0x5f5d351dB427d1131D8Dcd4F151185E6E6111907ethereum_storage: type: "pg_storage" connection: database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup" max_connections: 16proxy_host: "0.0.0.0:9090"max_slot_history: 4096gas_price: 1000000000Deposit UI Config
Section titled “Deposit UI Config”Modify the two files below.
rome-setup/docker/depositui/chains.ymlto specifychainId.rome-setup/docker/depositui/env.deposituito specifyNEXT_PUBLIC_SOLANA_RPC_URL.
Specifying payers
Section titled “Specifying payers”Specify multiple payers to increase throughput as more transactions can be executed in parallel by having more payers.
Specifying fee_recipients
Section titled “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.