L2 Archive Node Setup guide
Setting up the L2 Archive node for the Watchtower Node
Last updated
Setting up the L2 Archive node for the Watchtower Node
Last updated
Ensure that the following software dependencies are installed and meet the specified version requirements. Use the provided version check commands to confirm:
If you want to use a script that will automatically download the snapshot and set-up and start L2 node follow this step and skip steps 3-8. If you want to manually download the snapshot and set-up L2 node, then skip this step and go to step 3.
Download the scripts to set-up L2:
The folder l2-set-up, will have script run that starts the set-up process. The run script takes two arguments,
chain-name - "base" or "optimism". Currently only base and optimism L2 are supported
L1_RPC_URL - Give the Sepolia RPC URL that you use to connect to L1
For example,
The script will start a tmux shell with name "set-up-l2" that will download the snapshot. You can connect to tmux shell via the command,
Once the download of snapshot is done, tmux shell is terminated. After download of snapshot, geth and node clients are started in tmux shells with names, "optimism-geth" and "optimism-node" if optimism is selected, else if base is selected the tmux shell names will be "base-geth" and "base-node". To connect to a tmux shell, run the command
If you follow step 2, then skip steps 3-8 and go to step 9
To initiate the Watchtower environment, begin by downloading the latest available snapshot hosted by WitnessChain as a part of Light configuration for L2 node setup. Use the following commands:
For op-sepolia:
For base-sepolia:
Alternatively operators can consider publicly posted snapshots to start their node syncs. These snapshots are not hosted by WitnessChain, hence their availability and recency is subject to L2 chains publishing it themselves.
Note that WitnessChain highly encourages operators to utilize the snapshot hosted by us for a faster node setup and save days worth of time and compute on the same. That said, we're committed to keeping the watchtowers as trustless and neutral entities, hence the operators can feel free to choose the source of trust for their snapshot.
op-node/v1.7.0
as of Mar 17, 2024)Clone the op-geth repo, switch to the release branch (e.g., v1.101308.0
as of Feb 24, 2024 ), and build op-geth:
Generate a 32-byte hex string as a shared secret for communication between op-node and op-geth:
Navigate to the op-geth directory, copy the JWT secret, and start op-geth:
Unzip snapshot from step 1 in /datadir/
in the same directory where you built op-geth
. The final path for snapshot would look something like this
/path/to/op-geth/datadir/geth
if your path after snapshot unzipping and moving does not look as above, please either rename any directory required for the same or update the value of --datadir
flag to point to path of the snapshot in the script below.
Create the following scripts in the same directory where you built op-geth,
based on the L2 chain you would like to setup
run-geth-optimism.sh
for op-sepolia
or
run-geth-base.sh
for base-sepolia
for op-sepolia
:
for base-sepolia
:
Navigate to the op-node directory, copy the JWT secret, and start op-node:
Create the relevant script in the same directory where you built op-node.
Based on your network run-node-optimism.sh
for op-sepolia
or run-node-base.sh
for base-sepolia
In the script, replace <L1_RPC_URL>
with your sepolia (L1) RPC url and <L1_BEACON_NODE_URL>
with url of corresponding beacon node.
for op-sepolia
:
for base-sepolia
:
Once you've started op-geth
and op-node
you should see the two begin to communicate with each other and synchronize the L2 chain. Initial synchronization can take several hours to complete.
During this time, you will initially observe op-node
deriving blocks from Sepolia without sending these blocks to op-geth
. This means that op-node
is requesting blocks from Sepolia one-by-one and determining the corresponding L2 blocks that were published to Sepolia. You should see logs like the following from op-node
:
Once the op-node
has derived enough blocks from Sepolia, it will begin sending these blocks to op-geth
. You should see logs like the following from op-node
:
You should then also begin to see logs like the following from op-geth
:
You can run the following script, which will, over a minute, estimate the current sync speed and based on it the expected time for the sync to complete. The result is printed on the terminal, though remember that it is only an estimate.
Create a file run-estimate.sh
and paste the following code in it:
Then run ./run-estimate.sh
and wait for about 1 minute to see the sync speed and ETA.
Stop your current L2 node (both op-node
and op-geth
)
Delete the old state of the goerli network
navigate to datadir
cd /home/.../op-geth/datadir/
remove the old state
sudo rm -rf ./geth
ignore the jwt parts of it
just extract the snapshot to the right path and run with the correct config
upgrading your existing L2 to support Ecotone upgrade
Stop your current L2 node (both op-node
and op-geth
)
Upgrade op-geth
./run-geth-optimism.sh
or ./run-geth-base.sh
Upgrade op-node
cd op-node
add the following flag to your op-node run script
--l1.beacon=<L1_BEACON_NODE_URL>
refer Step 8: Configure and Start op-node for how the final script file should look like
./run-node-optimism.sh
or ./run-node-base.sh
Consider using a download acceleration tool like for faster downloads.
aria2c -s16 -x16
$(curl )
The following commands will start op-geth
with our recommended configuration. The JSON-RPC API will become available on port 8545. Refer to the op-geth
for more detailed information about available options.
If you don't currently have access to a beacon node, you can setup any of the available software for it, including Lighthouse, Prysm etc. using their docs. One such guide can be found here to setup a Prysm node:
Use the following command to start op-node
with the recommended configuration. Refer to the op-node
for more detailed information about available options.
Optimism’s guide to building a node:
Base’s guide to running a node :
Download the state snapshot for a sepolia L2 following
Configure and Start L2 node following and
Refer for post setup help
If you don't currently have access to a beacon node, you can setup any of the available software for it, including Lighthouse, Prysm etc. using their docs. One such guide can be found here to setup a Prysm node: