The Mode Mainnet archive node has a size of 544GB on October 11th, 2024
Mode
Mode operates within the Optimism Superchain ecosystem. It is powered by the OP Stack, in collaboration with Optimism, leveraging the scalability and security of Optimism's Layer 2 infrastructure.
In this guide, we are walking through the process of setting up a Mode Mainnet archive node using Optimism's op-geth and op-node.
Before you start, make sure that you have your own synced Ethereum L1 RPC URL (e.g. Erigon) and L1 Consensus Layer Beacon endpoint with all historical blobs data (e.g. Lighthouse) ready. A beacon endpoint meeting this criteria is essential for syncing to start.
Not advised to allow all or unknown IP address to RPC port
Enable Firewall
sudo ufw enable
To check the status of UFW and see the current rules
sudo ufw status verbose
Install dependencies
Required Software Dependencies
Dependency
Version
Version Check Command
go
^1.21
go version
node
^20
node --version
pnpm
^8
pnpm --version
foundry
^0.2.0
forge --version
make
^4
make --version
yarn
1.22.21
yarn --version
nvm
0.39.3
nvm --verison
Install GO
sudo wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz && rm go1.21.6.linux-amd64.tar.gz
#to verify Go installation
go version
#If it returns Command 'go' not found simply run
echo 'export PATH=$PATH:/usr/local/go/bin:/root/.local/bin' >> /root/.bashrc
#and then apply changes with
source /root/.bashrc
cd #to return to /root/ directory
git clone https://github.com/mode-network/node
cd node
export CONDUIT_NETWORK=mode-mainnet-0
./download-config.py $CONDUIT_NETWORK
#move genesis.json and rollup.json into op-geth directory
mv /root/node/networks/mode-mainnet-0/genesis.json /root/node/networks/mode-mainnet-0/rollup.json /root/data/mode/mode-op-geth/
Build op-node
cd /root/mode/
git clone https://github.com/ethereum-optimism/optimism.git
cd optimism
git checkout v1.9.3
make op-node
# The binary is built at /root/zora/optimism/op-node/bin/op-node
cd /root/mode/
git clone https://github.com/ethereum-optimism/op-geth.git
cd op-geth
git checkout v1.101408.0
make geth
# The binary is built at /root/github/op-geth/build/bin/geth
/root/mode/op-geth/build/bin/geth init --datadir=/root/data/mode/mode-op-geth --state.scheme hash /root/data/mode/mode-op-geth/genesis.json// Some code
Launch Mode
Start op-geth
It's usually simpler to begin with startingop-geth before you start op-node. You can start op-geth even if op-node isn't running yet, but op-geth won't get any blocks until op-node starts.
sudo systemctl daemon-reload #refresh systemd configuration when changes made
sudo systemctl enable mode-op-geth.service #enable mode-op-geth service at system startup
sudo systemctl start mode-op-geth.service #start mode-op-geth
sudo nano /etc/systemd/system/mode-op-geth.service #make changes in mode-op-geth.service file
Start op-node
Once you've started op-geth, you can start op-node. op-node will connect to op-geth and begin synchronizing the Mode network. op-node will begin sending block payloads to op-geth when it derives enough blocks from Ethereum
sudo systemctl daemon-reload #refresh systemd configuration when changes made
sudo systemctl enable mode-op-node.service #enable mode-op-node service at system startup
sudo systemctl start mode-op-node.service #start mode-op-node
sudo nano /etc/systemd/system/mode-op-node.service #make changes in mode-op-node.service file
Monitor the logs for errors
sudo journalctl -fu mode-op-node.service #follow logs of mode-op-node.service
sudo journalctl -fu mode-op-geth.service #follow logs of mode-op-geth.service
You are expected to get following log messages from op-node
INFO [09-25|18:05:58.867] Chain head was updated number=13,351,729 hash=9370fe..c97646 root=7893dd..996e12 elapsed="259.761µs" age=4d17h41m
INFO [09-25|18:05:58.885] Starting work on payload id=0x033de8416465dcbc
INFO [09-25|18:05:58.902] Imported new potential chain segment number=13,351,730 hash=c104d3..5e623b blocks=1 txs=3 mgas=2.563 elapsed=15.108ms mgasps=169.673 age=4d17h41m snapdiffs=3.4 triedirty=0.00B
Run curl command in the terminal to check the status of your node
curl -H "Content-type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545
If it returns false then your node is fully synchronized with the network
Sync speed depends on your L1 node, as the majority of the chain is derived from data submitted to the L1.
You can check your syncing status using the optimism_syncStatus RPC on the op-node