Deploy a rollup node
Learn how to run a full or archive node for the B2.
System Requirements
hardware requirements
CPUs: 4vCPUs
RAM: 8GB
Storage: 1 TB NVMe Storage
100MBps bidirectional internet connection
You can run B2 on lower-spec hardware, but you may find that it is not highly performant or prone to crashing.
software requirements
OS:As long as Docker Engine can be installed, the operating system will suffice.
Pre-install
Install Docker
Please refer to the Install Docker Engine
Install Docker-compose
Please refer to the Install Docker Compose
Import Blocks With geth import
Use geth import instead of downloading a full snapshot of the data directory. Import is incremental and more flexible: if the local node is missing a block range, download only that range and import it.
Block files are published at https://rlp.bsquared.network/. Each file is named block-<start>-<end>.rlp (about 500,000 blocks per file).
List files, then paginate and sort
Fetch the file list as JSON:
Sort by start block and print name and size:
Paginate after sorting by start block (example: first 10 files):
The listing API also accepts offset / limit and sort (name or size):
Download configuration files and RLP ranges
Download a range (example: genesis through block 500,000):
If a later range is missing locally, download only that file:
Initialize the datadir and import RLP files
Initialize once, then import files in block order (low to high). You can import one file at a time.
Import every downloaded file in height order:
For an archive node, add --syncmode=full --gcmode=archive so historical state is retained:
After import, start the node with docker-compose. Any blocks after the last imported file will sync from the network.
Setup B2 Node
Generate jwt secret:
Create a docker-compose.yaml file and mount the data directory and json files prepared above.
Changelog for the docker-compose.yaml:
Users who have already been set up can also upgrade,The upgrade will improve block synchronization.
L2 image change to
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101315.2OP image change to
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.7.7OP_NODE_P2P_STATIC,GETH_BOOTNODES (See below)
Archive node: uncomment the three archive-only GETH_* variables in the l2 service above (GETH_SYNCMODE, GETH_GCMODE, GETH_RPC_ALLOW_UNPROTECTED_TXS). They must match the --syncmode=full --gcmode=archive flags used during geth import.
Now, All preparations are complete, and the data directory structure is as follow:
The next step is to start the service.
Start The Node
Verify Result
Watch the L2 container logs
Block synchronization takes some time, please wait patiently. After some while,can check the syncing process by below command:
The block will catch up to the latest block once the request returns false.
Last updated