Skip to content

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.

First, generate a Solana keypair that will be used as the rollup owner. This keypair will allow you to initialize your L2.

Terminal window
cd rome-setup/docker
solana-keygen new -o keys/rollup-owner-keypair.json --no-bip39-passphrase --force

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.

Generate a JWT secret that will be used by Geth:

Terminal window
openssl rand -hex 32

Example output:

78f54d165d7996252e4664a4d3049b56b9b0b0e5d4c9e50c0f6887205766aafb

Generate two new Solana keypairs in rome-apps/docker/keys:

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

Set the following environment variables:

Terminal window
export CHAIN_ID=1002
export GENESIS_ADDRESS=0xf0e0CA2704D047A7Af27AafAc6D70e995520C2B2
export GENESIS_PRIVATE_KEY=241bfd22ba3307c78618a5a4c04f9adbd5c87d633df8d81cfb7c442004157aba
export GENESIS_BALANCE=1000000000000000000000000
export JWT_SECRET=78f54d165d7996252e4664a4d3049b56b9b0b0e5d4c9e50c0f6887205766aafb
export GASOMETER_HOST=http://proxy:9090
export SOLANA_RPC=https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz
export 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:3000
export GETH_HOST=http://localhost:3000
export AIRDROP_TITLE="Testnet Token Airdrop"
export ROME_EVM_TAG=v0.3.0
export RHEA_TAG=v0.3.0
export PROXY_TAG=v0.3.0
export GETH_TAG=v0.3.0
export CLI_TAG=v0.3.0
solana config set -u https://node1.devnet-eu-sol-api.devnet.romeprotocol.xyz

Check the current Solana slot and update start_slot in both proxy-config.yml and rhea-config.yml (located in rome-setup/docker/cfg):

Terminal window
solana slot

Update rhea-config.yml with the following content:

chain_id: 1002
start_slot: 339187220
solana:
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: 100

Update proxy-config.yml with the following content:

chain_id: 1002
start_slot: 339187220
solana:
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:
- 0xB136AB5B69A8059f5cB30A8B5418F5e43d8f40e8

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:

Terminal window
cd rome-setup/docker
docker compose up create_balance

If 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.