Running a Boba node
The boba_community/boba-node repo runs a replica of the Boba L2geth, which is useful for generating analytics for blockexplorers and other specialized use cases.

Basic Considerations

  1. 1.
    Running a local Boba node (replica) does not allow you to mine ETH, OMG, or BOBA. There is no mining on L2.
  2. 2.
    If you looking for best possible rpc read data (lowest possible latency) you are strongly advised not to run your own node, but to use https://lightning-replica.boba.network. This is an autoscaling rpc endpoint that speaks directly to the core Boba L2 geth.
  3. 3.
    The Boba L2 is (at present) a single proposer/sequencer system and the only way to write transactions is via https://mainnet.boba.network. You cannot use a local node to write transactions.
  4. 4.
    If your application does not need autoscaling and low latency, and can tolerate sync delays, you can run your own Boba node (replica). This replica will try to follow the core L2 geth via data provided by Infura and https://lightning-replica.boba.network, so it will necessarily lag behind https://lightning-replica.boba.network.
  5. 5.
    Please design your rpc connectors in a resource efficient manner. Notably, calling eth_getLogs(fromBlock: 0) 1000 times per second serves no conceivable purpose since the Ethereum blocktime is 12 seconds and the Boba blocktime is > 1 second. All that does is to degrade your replica and trigger rate-limiting and/or IP blocking at https://lightning-replica.boba.network.

Prerequisites

- docker - docker-compose

Start Replica service

Requirements: you will need a command line and Docker. Before filing GitHub issues, please make sure Docker is installed and running.
Open a terminal window. Clone the project and install needed dependencies:
1
$ git clone https://github.com/bobanetwork/boba.git
2
$ cd boba_community/boba-node
3
4
$ docker compose pull # for mainnet
5
# or...
6
$ docker compose -f docker-compose-rinkeby.yml pull #for rinkeby
Copied!
Then, add your Infura key to boba_community/boba-node/docker-compose.yaml. If you do not have an Infura key, you can obtain one for free from Infura or any other node provider.
1
x-l1_rpc_dtl: &l1_rpc_dtl
2
DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT: 'https://mainnet.infura.io/v3/YOUR_INFURA_KEY'
3
4
x-l1_rpc_geth: &l1_rpc_geth
5
ETH1_HTTP: 'https://mainnet.infura.io/v3/YOUR_INFURA_KEY'
Copied!
For Rinkeby, replace https://mainnet.infura.io/ with https://rinkeby.infura.io/. Then, select the correct state dump file from /state-dumps, move it up one level, and rename it to state-dump.latest.json. Then, bring up the services:
1
$ docker-compose up # for mainnet
2
# or...
3
$ docker compose -f docker-compose-rinkeby.yml up #for rinkeby
Copied!
The DTL will first sync with the chain. During the sync, you will see the DTL and Replica gradually catch up with the Boba L2. This can take several minutes to several hours, depending on which chain you are replicating.
DTL syncing
1
dtl | {"level":30,"time":1650658119224,"fromBlock":13001,"toBlock":14001,"msg":"Synchronizing unconfirmed transactions from Layer 2 (Optimism)"}
Copied!
Replica replaying transactions
1
dtl | {"level":30,"time":1650659925936,"method":"GET","url":"/transaction/index/8074?backend=l2","elapsed":0,"msg":"Served HTTP Request"}
2
replica | TRACE[04-22|20:38:45.938] Applying indexed transaction index=8074
3
replica | DEBUG[04-22|20:38:45.938] Applying transaction to tip index=8074 hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b origin=sequencer
4
replica | TRACE[04-22|20:38:45.938] Waiting for transaction to be added to chain hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b
5
replica | DEBUG[04-22|20:38:45.938] Attempting to commit rollup transaction hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b
6
replica | DEBUG[04-22|20:38:45.941] Adding extra L2 fee extra-l2-fee=543000000000
7
replica | DEBUG[04-22|20:38:45.941] Total fee total-fee=500543000000000
Copied!

Updating services

There will be occasional updates to both services. You can update them by running:
1
docker compose pull
Copied!
and bringing the services up again. We suggest you keep the storage volume of the replica mounted on the host. The replica stores its data in /root/.ethereum/.