Builders
Chain Operators
Chain Management
Node Operations

Rollup Operations

This guide reviews the basics of rollup operations, such as how to start your rollup, stop your rollup, get your rollup config, and add nodes.

Stopping Your Rollup

An orderly shutdown is done in the reverse order to the order in which components were started:

To stop the batcher, use this command:

curl -d '{"id":0,"jsonrpc":"2.0","method":"admin_stopBatcher","params":[]}' \
    -H "Content-Type: application/json" http://localhost:8548 | jq

This way the batcher knows to save any data it has cached to L1. Wait until you see Batch Submitter stopped in batcher's output before you stop the process.

Stop devium--batcher

This component is stateless, so you can just stop the process.

Stop devium-geth

Make sure you use CTRL-C to avoid database corruption. If Geth stops unexpectedly the database can be corrupted. This is known as an "unclean shutdown (opens in a new tab)" and it can lead to a variety of problems for the node when it is restarted.

Starting Your Rollup

To restart the blockchain, use the same order of components you did when you initialized it.

Start devium-geth

Start devium--batcher

Start devium--batcher

If devium--batcher is still running and you just stopped it using RPC, you can start it with this command:

curl -d '{"id":0,"jsonrpc":"2.0","method":"admin_startBatcher","params":[]}' \
    -H "Content-Type: application/json" http://localhost:8548 | jq   

Synchronization takes time

devium--batcher might have warning messages similar to:

WARN [03-21|14:13:55.248] Error calculating L2 block range         err="failed to get sync status: Post \"http://localhost:8547\": context deadline exceeded"
WARN [03-21|14:13:57.328] Error calculating L2 block range         err="failed to get sync status: Post \"http://localhost:8547\": context deadline exceeded"

This means that devium--batcher is not yet synchronized up to the present time. Just wait until it is.

Getting Your Rollup Config

Use this tool to get your rollup config from devium--batcher. This will only work if your chain is already in the superchain-registry and devium--batcher has been updated to pull those changes in from the registry.

⚠️

This script will NOT work for chain operators trying to generate this data in order to submit it to the registry.

Get your rollup config from devium--batcher

You'll need to run this tool:

./bin/devium--batcher networks dump-rollup-config --network=sepolia   
{
  "genesis": {
    "l1": {
      "hash": "0x48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
      "number": 4071408
    },
    "l2": {
      "hash": "0x102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d",
      "number": 0
    },
    "l2_time": 1691802540,
    "system_config": {
      "batcherAddr": "0x8f23bb38f531600e5d8fddaaec41f13fab46e98c",
      "overhead": "0x00000000000000000000000000000000000000000000000000000000000000bc",
      "scalar": "0x00000000000000000000000000000000000000000000000000000000000a6fe0",
      "gasLimit": 30000000
    }
  },
  "block_time": 2,
  "max_sequencer_drift": 600,
  "seq_window_size": 3600,
  "channel_timeout": 300,
  "l1_chain_id": 11155111,
  "l2_chain_id": 11155420,
  "regolith_time": 0,
  "canyon_time": 1699981200,
  "delta_time": 1703203200,
  "ecotone_time": 1708534800,
  "batch_inbox_address": "0xff00000000000000000000000000000011155420",
  "deposit_contract_address": "0x16fc5058f25648194471939df75cf27a2fdc48bc",
  "l1_system_config_address": "0x034edd2a225f7f429a63e0f1d2084b9e0a93b538",
  "protocol_versions_address": "0x79add5713b383daa0a138d3c4780c7a1804a8090",
  "da_challenge_address": "0x0000000000000000000000000000000000000000",
  "da_challenge_window": 0,
  "da_resolve_window": 0,
  "use_plasma": false
}

Check the Flags

Ensure that you are using the appropriate flag. The --network=sepolia flag allows the tool to pick up the appropriate data from the registry, and uses the OPChains mapping under the hood.

Adding Nodes

To add nodes to the rollup, you need to initialize devium--batcher and devium-geth, similar to what you did for the first node. You should not add an devium--batcher because there should be only one.

Configure the OS and prerequisites as you did for the first node

Build the DEVIUM Chain monorepo and devium-geth as you did for the first node

Copy from the first node these files:

~/devium-geth/genesis.json
~/devium/devium--batcher/rollup.json

Create a new jwt.txt file as a shared secret:

cd ~/devium-geth
openssl rand -hex 32 > jwt.txt
cp jwt.txt ~/devium/devium--batcher

Initialize the new devium-geth:

cd ~/devium-geth
./build/bin/geth init --datadir=./datadir ./genesis.json

Turn on peer to peer synchronization to enable L2 nodes to synchronize directly

If you do it this way, you won't have to wait until the transactions are written to L1. If you already have peer to peer synchronization, add the new node to the --p2p.static list so it can synchronize.

Start devium-geth (using the same command line you used on the initial node)

Start devium--batcher (using the same command line you used on the initial node)

Next Steps

  • See the Node Configuration guide for additional explanation or customization.
  • If you experience difficulty at any stage of this process, please reach out to developer support.