Run a Node From Source

DDocker images make it very simple to run a BOBA node, but you can also create your own node using the source code. You might choose to do this if you need the node to work on a specific architecture or if you want to look closely at the node's code. This guide will show you how to build and run a node from scratch.

Software Dependencies

DependencyVersionVersion Check Command

^2

git --version

^1.21

go --version

^20

node --version

^8

pnpm --version

^0.2.0

forge --version

^4

make --version

Build the Rollup Node

Clone the Boba Monorepo

git clone https://github.com/bobanetwork/boba.git
cd boba

Check out the required release branch

Release branches are created when new versions of the op-node are created. Read through the Releases page to determine the correct branch to check out.

git checkout <name of release branch>

Install dependencies

Install the Node.js dependencies for the Boba Monorepo.

pnpm install

Build packages

Builde the Node.js packages for the Boba Monorepo.

pnpm build

Build op-node

Build the op-node.

make op-node

Build the Execution Engine

Clone the Erigon repo

git clone https://github.com/bobanetwork/op-erigon.git
cd op-erigon

Check out the required release branch

Release branches are created when new versions of the erigon are created. Read through the Releases page to determine the correct branch to check out.

git checkout <name of release branch>

Build erigon

Build the erigon.

make erigon

Download Snapshots

You can download the database snapshot for the client and network you wish to run.

Always verify snapshots by comparing the sha256sum of the downloaded file to the sha256sum listed on this page. Check the sha256sum of the downloaded file by running sha256sum <filename>in a terminal.

  • BOBA Mainnet

    The erigon db can be downloaded from the boba mainnet erigon db.

    curl -o boba-mainnet-erigon-db-1149019.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/mainnet/boba-mainnet-erigon-db-1149019.tgz

    The geth db can be downloaded from boba mainnet geth db.

    curl -o boba-mainnet-geth-db-114909.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/mainnet/boba-mainnet-geth-db-114909.tgz
  • BOBA Sepolia

    The erigon db can be downloaded from the boba sepolia erigon db.

    curl -o boba-sepolia-erigon-db.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-erigon-db.tgz

    The geth db can be downloaded from boba sepolia geth db.

    curl -o boba-sepolia-geth-db.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-geth-db.tgz
  • OP Mainnet

    The erigon db can be downloaded from Test in Prod OP Mainnet.

  • OP Sepolia

    The erigon db can be downloaded from optimism sepolia erigon db.

    Or you can download the genesis file from Optimsim and initialize the data directory with it.

    curl -o op-sepolia-genesis.json -sL https://networks.optimism.io/op-sepolia/genesis.json
    erigon init --datadir=/db genesis.json

    The erigon can be built from the source using make erigon .

Create a JWT Secret

op-erigon and op-node communicate over the engine API authrpc. This communication is secured using a shared secret. You will need to generate a shared secret and provide it to both op-erigon and op-node when you start them. In this case, the secret takes the form of a 32 byte hex string.

Run the following command to generate a random 32 byte hex string:

openssl rand -hex 32 > jwt.txt

Start op-erigon

It's usually simpler to begin with op-erigon before you start op-node. You can start op-erigon even if op-node isn't running yet, but op-erigon won't get any blocks until op-node starts.

cd op-erigon

Copy in the JWT secret

Copy the JWT secret you generated in the previous step into the v3-erigon directory.

cp /path/to/jwt.txt .

Start op-erigon

Using the following command to start op-erigon in a default configuration. The JSON-RPC API will become available on port 9545.

./build/bin/erigon \
	--datadir=$DBDIR_PATH \
	--private.api.addr=localhost:9090 \
	--http.addr=0.0.0.0 \
	--http.port=9545 \
	--http.corsdomain="*" \
	--http.vhosts="*" \
	--authrpc.addr=0.0.0.0 \
	--authrpc.port=8551 \
	--authrpc.vhosts="*" \
	--authrpc.jwtsecret=./jwt.txt \
	--chain=boba-sepolia \
	--http.api=eth,debug,net,engine,web3 \
	--rollup.sequencerhttp=https://mainnet.boba.network \
	--db.size.limit=8TB

Start op-node

Once you've started op-erigon, you can start op-node. op-node will connect to op-erigon and begin synchronizing the BOBA network. op-node will begin sending block payloads to op-erigon when it derives enough blocks from Ethereum.

cd op-node

Copy in the JWT secret

Copy the JWT secret you generated in the previous step into the v3-erigon directory.

cp /path/to/jwt.txt .

Set environment variables

Set the following environment variable:

export L1_RPC_URL=... # URL for the L1 node to sync from

Start op-node

Using the following command to start op-node in a default configuration. The JSON-RPC API will become available on port 8545.

./bin/op-node \
  --l1=$L1_RPC_URL \
  --l2=http://localhost:8551 \
  --l2.jwt-secret=./jwt.txt \
  --network=boba-sepolia \
  --rpc.addr=0.0.0.0 \
  --rpc.port=8545

Synchornization

During the initial synchonization, you get log messages from op-node, and nothing else appears to happen.

INFO [08-04|16:36:07.150] Advancing bq origin                      origin=df76ff..48987e:8301316 originBehind=false

After a few minutes, op-node finds the right batch and then it starts synchronizing. During this synchonization process, you get log messags from op-node.

INFO [08-04|16:36:01.204] Found next batch                         epoch=44e203..fef9a5:8301309 batch_epoch=8301309                batch_timestamp=1,673,567,518
INFO [08-04|16:36:01.205] generated attributes in payload queue    txs=2  timestamp=1,673,567,518
INFO [08-04|16:36:01.265] inserted block                           hash=ee61ee..256300 number=4,069,725 state_root=a582ae..33a7c5 timestamp=1,673,567,518 parent=5b102e..13196c prev_randao=4758ca..11ff3a fee_recipient=0x4200000000000000000000000000000000000011 txs=2  update_safe=true

Last updated