Run a Taiko Alethia node with Docker
This guide will help you start up a Taiko Alethia RPC node using simple-taiko-node.
Software Dependencies
| Dependency | Version | Version Check Command |
|---|---|---|
| git | ^2 | git --version |
| Docker | ^24.0 | docker --version |
Prerequisites
- If using Windows, you should install Git BASH or WSL to use as your terminal.
- Meet the Geth minimum hardware requirements except for the storage requirement because Taiko nodes will require less storage (at the time of writing).
Run a Taiko Alethia node with simple-taiko-node
-
Clone simple-taiko-node
Terminal window git clone https://github.com/taikoxyz/simple-taiko-node.gitcd simple-taiko-nodeTerminal window git clone https://github.com/taikoxyz/simple-taiko-node.gitcd simple-taiko-node && git config core.autocrlf false -
Copy the sample .env files
Terminal window cp .env.sample .env -
Set the L1 node endpoint
First, open the
.envin your preferred text editor:Terminal window nano .envTerminal window notepad .envNext, you will set the L1 node endpoints. If you are running a local L1 node, you cannot reference the L1 endpoints as
ws://127.0.0.1:8546andhttp://127.0.0.1:5052because that is local to inside the simple-taiko-node Docker networking. Instead you can try:- Using
host.docker.internal(see: stack overflow). - Using the private ip address of your machine (use something like
ip addr showto get this ip address).
After getting the address of the L1 node, set the following L1 node endpoints in your
.envfile. Here is an example:L1_ENDPOINT_WS=ws://192.168.1.15:8546L1_BEACON_HTTP=http://192.168.1.15:5052
- Using
-
Remove old testnet volumes
If you ran a testnet node previously, make sure to first remove the old volumes:
Terminal window docker compose down -v -
Set the profiles you want to run
In your
.env, please setCOMPOSE_PROFILESto whichever set of services you’d like to run in a comma separated list (i.e.,l2_execution_engine,proveror any combination of the three).Note that if you include
prover, the service will still be disabled if you do not setENABLE_PROVER=truein your.envfile. -
Set your node’s external IP for p2p discovery
This is an important config for based preconfirmations. Find your machine’s external IP and set
PUBLIC_IP={EXTERNAL_IP}in your.envfile. You may choose to leave it blank, in which case our scripts will enablep2p.natin your driver; this means that you will automatically enable NAT traversal with PMP/UPNP devices to learn external IP. This is not preferred, and we highly recommend you manually set thePUBLIC_IPfor discovery. -
Ensure that the relevant ports are open on your machine at the external IP you set.
Whether you are running the node on a personal machine or a cloud provider’s machine, you should ensure your the following ports on your machine are open and visible to the internet at your external IP:
- TCP
4001OR whichever port you setP2P_TCP_PORTto in your.env. - UDP
30303OR whichever port you setP2P_UDP_PORTto in your.env.
These ports are required for p2p gossiping preconfirmed blocks, so if it is not set you will only subscribe to the events that are emitted on chain. You may need to add additional port-forwarding rules in your firewall/router to enable discovery from the internet.
- TCP
-
Set a private key for your P2P id
Another important config for based preconfirmations, your node needs a private key set to acquire a stable peer ID. This private key should be unique to each node: if you are running multiple, please use different ones for each node. This private key does not need to hold eth or any valuables, it is simply to persist an identity.
You may either set
PRIV_RAWin your.env, orPRIV_FILE:PRIV_RAWis the hexstring private key in plaintextPRIV_FILEis the name of your txt file that consists entirely of a private key with no newlines IN YOUR/script/DIRECTORY.
-
Start the node
Terminal window docker compose up -d -
Verify that your node has joined the P2P network
To ensure that your node is actually configured correctly and has joined the P2P network for preconfirmations, please use
grepto find logs regardingpeer tick. You should find something that resembles the following:INFO [07-30|18:37:38.168] Peer tick peersLen=6 peers="[...]" addrInfo="[...]" id=... advertisedUDP=52700 advertisedTCP=4001 advertisedIP=...As long as
connected=Xis greater than or equal to 6, your node should have joined the P2P network correctly! If it is below that, please reach out to us on Discord for troubleshooting help. -
Verify node is running
Option 1: Check with the node dashboard
A node dashboard will be running on
localhoston theGRAFANA_PORTyou set in your.envfile, which defaults to3001: http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overview.You can verify that your node is syncing by checking that the chain head on the dashboard is increasing. Once the chain head matches what’s on the block explorer, you are fully synced.
Option 2: Check with curl commands
-
Check if the Execution Layer client is connected to Taiko L2:
Terminal window curl http://localhost:8547 \-X POST \-H "Content-Type: application/json" \--data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'which should return the chainId as
0x28c61(167009):{ "jsonrpc": "2.0", "id": 1, "result": "0x28c61" } -
Check if the Execution Layer client is synced by requesting the latest Taiko L2 / L3 block from the Execution Layer client:
Terminal window curl http://localhost:8547 \-X POST \-H "Content-Type: application/json" \--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' -
If the blockNumber response value is
0or not growing, check the Taiko L2 logs here:Terminal window docker compose logs -fNote: You may need to use
sudo docker compose logs -fif you are not in thedockergroup.
-
Video tutorial
See the video tutorial Run a Taiko L2 node (YouTube). It’s for a previous testnet but the overall steps are the same!
Full simple-taiko-node CLI reference
Make sure you are in the simple-taiko-node folder. If you are not:
cd simple-taiko-nodeStart node
docker compose up -dStop node
docker compose downRestart node
docker compose down && docker compose up -dUpdate node
git pull origin main && docker compose pullRemove node
docker compose down -vStart and remove orphan containers
This command will start and remove containers that are not part of the current docker compose file.
docker compose up -d --remove-orphansView grafana dashboard
open http://localhost:3001/d/L2ExecutionEngine/l2-execution-engine-overviewView logs
docker compose logs -fView execution logs
docker compose logs -f l2_execution_engineView client driver logs
docker compose logs -f taiko_client_driverView client proposer logs
docker compose logs -f taiko_client_proposerView system resource usage stats
docker statsCompare .env and .env.sample
sdiff .env .env.sampleTroubleshooting
- Visit the Discord for help on any common error codes / issues.
- View the logs of the node (see above).