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”Setup the environment needed to setup the L2. Generate secrets, key pairs, set environment variables, and update configuration files.
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 32Generate 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.
cd rome-setup/dockersolana-keygen new -o keys/rhea-sender.json --no-bip39-passphrase --forcesolana-keygen new -o keys/proxy-sender.json --no-bip39-passphrase --forceSet environment variables
Section titled “Set environment variables”Set Chain ID and JWT Secret below.
export CHAIN_ID=98989897export GENESIS_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2export JWT_SECRET=7ff586310476ffc476995fa0cd3a80be82e2aba650dddc885ac26c82af29c40dexport GASOMETER_HOST=http://proxy:9090export SOLANA_RPC=https://node3.devnet-us-sol-api.devnet.romeprotocol.xyzexport PROGRAM_ID=RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKqexport ETH_DEPOSIT_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2export ETH_DEPOSIT_GWEI='1000000000'
export ROME_EVM_TAG=v1.0.0export RHEA_TAG=v1.0.0export HERCULES_TAG=v1.0.0export PROXY_TAG=v1.0.0export CLI_TAG=v1.0.0export GETH_TAG=v1.0.0Update Configuration Files
Section titled “Update Configuration Files”Note: We use the terms “Proxy” and “Light Client” interchangeably.
Check 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.
Update Rhea Config
Section titled “Update Rhea Config”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: 98989897start_slot: 385523275program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq"solana: rpc_url: "https://node3.devnet-us-sol-api.devnet.romeprotocol.xyz"payers: - payer_keypair: "/opt/rhea-sender.json" fee_recipients: - 0xB515207148c409075D0048247bfdDd8399072A14geth_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 sendingUpdate Hercules Config
Section titled “Update Hercules Config”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: 385523275solana_storage: type: pg_storage connection: database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup" max_connections: 16 connection_timeout_sec: 30block_parser: program_id: "RPDLj7hwcWEpQ4S3fExgsxMruc4BfuUUts69i9BdhKq" chain_id: 98989897 parse_mode: engine_apiethereum_storage: type: pg_storage connection: database_url: "postgres://hercules:qwerty123@postgres_rome/test_rollup" max_connections: 16 connection_timeout_sec: 30block_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: 4096block_loader_batch_size: 128mode: IndexerUpdate Proxy Config
Section titled “Update Proxy Config”Update proxy-config.yml to set chain_id, start_slot, solana_url, and payers.
chain_id: 98989897start_slot: 385523275program_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: - 0xC185E444674aF38251c233c9943Ed8ef82da608aethereum_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: 1000000000Specifying 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.
Airdrop SOLs
Section titled “Airdrop SOLs”Airdrop SOLs to your Rhea, Proxy and source account 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)solana -ud airdrop 1 $(solana address -k keys/source-account-keypair.json)