Lisk provides a cost-efficient, fast, and scalable Layer 2 (L2) network based on Optimism (OP) that is secured by Ethereum.
This repository contains information on how to run your own node on the Lisk network.
The following system requirements are recommended to run Lisk L2 node.
- Modern multi-core CPU with good single-core performance
- Machines with a minimum of 16 GB RAM (32 GB recommended)
- Machines with a high performance SSD drive with at least 750GB (full node) or 4.5TB (archive node) free
Network | Status |
---|---|
Lisk Sepolia Testnet | ✅ |
Lisk Mainnet | ✅ |
Note:
It is currently not possible to run the nodes with the--op-network
flag until the configs for Lisk have been merged to the superchain-registry.
Currently, due to ongoing changes in the above repo, addition of new chains to the registry have been paused. Once the maintenance is over, we will submit PRs to add the config for the Lisk Mainnet and Lisk Sepolia Testnet.
git clone https://github.com/LiskHQ/lisk-node.git
cd lisk-node
-
Ensure you have an Ethereum L1 full node RPC available (not Lisk), and set the
OP_NODE_L1_ETH_RPC
and theOP_NODE_L1_BEACON
variables (within the.env.*
files, if using docker-compose). If running your own L1 node, it needs to be synced before the Lisk node will be able to fully sync. -
Please ensure that the environment file relevant to your network (
.env.sepolia
, or.env.mainnet
) is set for theenv_file
properties withindocker-compose.yml
. By default, it is set to.env.mainnet
. -
We currently support running either the
op-geth
or theop-reth
nodes alongside theop-node
. By default, we run theop-geth
node. If you would like to run theop-reth
node instead, please set theCLIENT
environment variable toreth
before starting the node. -
Run:
docker compose up --build --detach
-
You should now be able to
curl
your Lisk node:curl -s -d '{"id":0,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false]}' \ -H "Content-Type: application/json" http://localhost:8545
-
Before proceeding, please make sure to install the following dependency (this information is missing in the OP documentations linked below):
-
To build
op-node
andop-geth
from source, follow the OP documentation.- Before building the
op-node
, please patch the code withlisk-hotfix.patch
for an unhandledSystemConfig
event emitted, affecting Lisk nodes resulting in errors. This patch is temporary until our RaaS provider updates theSystemConfig
contract.git apply <path-to-lisk-hotfix.patch>
- Before building the
-
To build
op-reth
from source, follow the reth official documentation.
Set the following environment variable:
export DATADIR_PATH=... # Path to the folder where geth data will be stored
op-geth
and op-node
communicate over the engine API authrpc. This communication can be secured with a shared secret which can be provided to both when starting the applications. In this case, the secret takes the form of a random 32-byte hex string and can be generated with:
openssl rand -hex 32 > jwt.txt
For more information refer to the OP documentation.
Navigate to your op-geth
directory and initialize the service by running the command:
./build/bin/geth init --datadir=$DATADIR_PATH PATH_TO_NETWORK_GENESIS_FILE
Note:
Alternatively, this initialization step can be skipped by specifying--op-network=OP_NODE_NETWORK
flag in the start commands below.
This flag automatically fetches the necessary information from the superchain-registry.
Navigate to your op-geth
directory and start service by running the command:
For, Lisk Sepolia Testnet:
./build/bin/geth \
--datadir=$DATADIR_PATH \
--verbosity=3 \
--http \
--http.corsdomain="*" \
--http.vhosts="*" \
--http.addr=0.0.0.0 \
--http.port=8545 \
--http.api=web3,debug,eth,net,engine \
--authrpc.addr=0.0.0.0 \
--authrpc.port=8551 \
--authrpc.vhosts="*" \
--authrpc.jwtsecret=PATH_TO_JWT_TEXT_FILE \
--ws \
--ws.addr=0.0.0.0 \
--ws.port=8546 \
--ws.origins="*" \
--ws.api=debug,eth,net,engine \
--metrics \
--metrics.addr=0.0.0.0 \
--metrics.port=6060 \
--syncmode=full \
--gcmode=full \
--maxpeers=100 \
--nat=extip:0.0.0.0 \
--rollup.sequencerhttp=SEQUENCER_HTTP \
--rollup.halt=major \
--port=30303 \
--rollup.disabletxpoolgossip=true \
--override.canyon=0
For, Lisk Mainnet:
./build/bin/geth \
--datadir=$DATADIR_PATH \
--verbosity=3 \
--http \
--http.corsdomain="*" \
--http.vhosts="*" \
--http.addr=0.0.0.0 \
--http.port=8545 \
--http.api=web3,debug,eth,net,engine \
--authrpc.addr=0.0.0.0 \
--authrpc.port=8551 \
--authrpc.vhosts="*" \
--authrpc.jwtsecret=PATH_TO_JWT_TEXT_FILE \
--ws \
--ws.addr=0.0.0.0 \
--ws.port=8546 \
--ws.origins="*" \
--ws.api=debug,eth,net,engine \
--metrics \
--metrics.addr=0.0.0.0 \
--metrics.port=6060 \
--syncmode=full \
--gcmode=full \
--maxpeers=100 \
--nat=extip:0.0.0.0 \
--rollup.sequencerhttp=SEQUENCER_HTTP \
--rollup.halt=major \
--port=30303 \
--rollup.disabletxpoolgossip=true
Refer to the op-geth
configuration documentation for detailed information about available options.
Note:
Currently we do not support running the reth client on the Lisk Sepolia Testnet.
Navigate to your reth
directory and start service by running the command:
For, Lisk Mainnet:
./target/release/op-reth node \
-vvv \
--datadir="$DATADIR_PATH" \
--log.stdout.format log-fmt \
--ws \
--ws.origins="*" \
--ws.addr=0.0.0.0 \
--ws.port=8546 \
--ws.api=debug,eth,net,txpool \
--http \
--http.corsdomain="*" \
--http.addr=0.0.0.0 \
--http.port=8545 \
--http.api=debug,eth,net,txpool \
--authrpc.addr=0.0.0.0 \
--authrpc.port=8551 \
--authrpc.jwtsecret=PATH_TO_JWT_TEXT_FILE \
--metrics=0.0.0.0:6060 \
--chain=PATH_TO_NETWORK_GENESIS_FILE \
--disable-discovery \
--rollup.sequencer-http=SEQUENCER_HTTP \
--rollup.disable-tx-pool-gossip
Refer to the reth
configuration documentation for detailed information about available options.
Note: Official Lisk sequencer HTTP:
For Mainnet: https://rpc.sepolia-api.lisk.com
For Sepolia Testnet: https://rpc.api.lisk.com
Navigate to your op-node
directory and start service by running the command:
For, Lisk Sepolia Testnet:
./bin/op-node \
--l1=$OP_NODE_L1_ETH_RPC \
--l1.rpckind=$OP_NODE_L1_RPC_KIND \
--l1.beacon=$OP_NODE_L1_BEACON \
--l2=ws://localhost:8551 \
--l2.jwt-secret=PATH_TO_JWT_TEXT_FILE \
--rollup.config=PATH_TO_NETWORK_ROLLUP_FILE
For, Lisk Mainnet:
./bin/op-node \
--l1=$OP_NODE_L1_ETH_RPC \
--l1.rpckind=$OP_NODE_L1_RPC_KIND \
--l1.beacon=$OP_NODE_L1_BEACON \
--l2=ws://localhost:8551 \
--l2.jwt-secret=PATH_TO_JWT_TEXT_FILE \
--rollup.config=PATH_TO_NETWORK_ROLLUP_FILE
The above command starts op-node
in full sync mode. Depending on the chain length, the initial sync process could take significant time; varying from days to weeks.
INFO [06-26|13:31:20.389] Advancing bq origin origin=17171d..1bc69b:8300332 originBehind=false
For more information refer to the OP documentation.
Note:
In case you had skipped theop-geth
initialization step above, you can start the node with the--network=OP_NODE_NETWORK
flag.
When specifying the--network
flag, kindly make sure to remove the--rollup.config
flag.
Refer to the op-node
configuration documentation for detailed information about available options.
Note:
Some L1 nodes (e.g. Erigon) do not support fetching storage proofs. You can work around this by specifying--l1.trustrpc
when starting op-node (add it inop-node-entrypoint
and rebuild the docker image withdocker compose build
.) Do not do this unless you fully trust the L1 node provider.
TBA
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
container. Example:
command -v jq &> /dev/null || { echo "jq is not installed" 1>&2 ; }
echo Latest synced block behind by: \
$((($( date +%s )-\
$( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Content-Type: application/json" http://localhost:9545 |
jq -r .result.unsafe_l2.timestamp))/60)) minutes