Module 2 - Registering and Initializing Your L2
In this module, we’ll register your L2 with the Rome Protocol and initialize it with the necessary configuration.
Step 1: Generate Rollup Owner Keypair
Section titled “Step 1: Generate Rollup Owner Keypair”First, generate a Solana keypair that will be used as the rollup owner. This keypair will allow you to initialize your L2.
cd rome-setup/docker
solana-keygen new -o keys/rollup-owner-keypair.json --no-bip39-passphrase --forceStep 2: Register Your L2
Section titled “Step 2: Register Your L2”Submit a registration request on the Rome Protocol L2 Registration page. Once you submit the request, your chain will be registered and you’ll see a success message.
Step 3: Generate JWT Secret
Section titled “Step 3: Generate JWT Secret”Generate a JWT secret that will be used by Geth:
openssl rand -hex 32Example output:
78f54d165d7996252e4664a4d3049b56b9b0b0e5d4c9e50c0f6887205766aafbStep 4: Generate Solana Keypairs
Section titled “Step 4: Generate Solana Keypairs”Generate two new Solana keypairs in rome-apps/docker/keys:
cd rome-setup/docker
# Generate Rhea keypairsolana-keygen new -o keys/rhea-sender.json --no-bip39-passphrase --force
# Generate Proxy keypairsolana-keygen new -o keys/proxy-sender.json --no-bip39-passphrase --forceStep 5: Set Environment Variables
Section titled “Step 5: Set Environment Variables”Set the following environment variables:
export CHAIN_ID=1002export GENESIS_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2export GENESIS_PRIVATE_KEY=241bfd22ba3307c78618a5a4c04f9adbd5c87d633df8d81cfb7c442004157abaexport GENESIS_BALANCE=1000000000000000000000000export JWT_SECRET=78f54d165d7996252e4664a4d3049b56b9b0b0e5d4c9e50c0f6887205766aafbexport GASOMETER_HOST=http://proxy:9090export SOLANA_RPC=https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyzexport PROGRAM_ID=RD2Gg7Lcnv62XmRHAzxh6fQQfMRzHtN5LeKPVBhYU5S
# If running on a remote server, set GETH_HOST to your domain name# e.g. https://rollup.testnet.romeprotocol.xyz instead of http://localhost:3000export GETH_HOST=http://localhost:3000export AIRDROP_TITLE="Testnet Token Airdrop"
export ROME_EVM_TAG=v0.3.0export RHEA_TAG=v0.3.0export PROXY_TAG=v0.3.0export GETH_TAG=v0.3.0export CLI_TAG=v0.3.0
solana config set -u https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyzStep 6: Update Configuration Files
Section titled “Step 6: Update Configuration Files”Check Solana Slot
Section titled “Check Solana Slot”Check the current Solana slot and update start_slot in both proxy-config.yml and rhea-config.yml (located in rome-setup/docker/cfg):
solana slotUpdate Rhea Config
Section titled “Update Rhea Config”Update rhea-config.yml with the following content:
chain_id: 1002
start_slot: 339187220solana: rpc_url: "https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz"solana_indexer: rpc_url: "https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz"
program_id: "RD2Gg7Lcnv62XmRHAzxh6fQQfMRzHtN5LeKPVBhYU5S"
payers: - payer_keypair: "/opt/rhea-sender.json" fee_recipients: - 0xB136AB5B69A8059f5cB30A8B5418F5e43d8f40e8
geth_engine: geth_engine_addr: "http://geth:8551" geth_engine_secret: "78f54d165d7996252e4664a4d3049b56b9b0b0e5d4c9e50c0f6887205766aafb"geth_indexer: geth_http_addr: "http://geth:8545" geth_poll_interval_ms: 100Update Proxy Config
Section titled “Update Proxy Config”Update proxy-config.yml with the following content:
chain_id: 1002
start_slot: 339187220solana: rpc_url: "https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz" commitment: "confirmed"
program_id: "RD2Gg7Lcnv62XmRHAzxh6fQQfMRzHtN5LeKPVBhYU5S"
proxy_host: "0.0.0.0:9090"
payers: - payer_keypair: "/opt/proxy-sender.json" fee_recipients: - 0xB136AB5B69A8059f5cB30A8B5418F5e43d8f40e8Step 7: Create Initial Balance
Section titled “Step 7: Create Initial Balance”Airdrop SOLs to the rollup owner using Solana Faucet so it can execute the initialization transaction.
Then, run the following command to create the initial balance:
cd rome-setup/docker
docker compose up create_balanceIf you see an error saying “Error: RomeEvmError: Signer not found, or more than one signer was found”, make sure the airdrop worked and the rollup owner keypair has sufficient balance.