Running an Ink Node
Welcome to the Ink Node setup tutorial. Follow these steps to deploy and sync your own node efficiently.
Tutorial Goals
By the end of this guide, you will:
- Successfully deploy an Ink Node.
- Ensure your node is in sync with the network.
Before You Begin
Running a node is resource-intensive and time-consuming. Make sure you have a clear purpose for setting up your node.
For those starting out and needing an RPC URL, our free endpoints are available:
- Mainnet:
not available yet
- Testnet (Sepolia):
https://rpc-gel-sepolia.inkonchain.com/
Note: These RPCs are rate-limited and unsuitable for production applications.
Don't want to run your own node? QuickNode offers managed Ink nodes with APIs, tools, and an easy-to-use control panel.
System Requirements
To run a node, your system should meet these minimum specifications:
- 8-Core CPU
- 8 GB RAM or more
- SSD drive (NVME recommended) with at least 100GB storage
Running an archive node will demand additional disk space over time. More CPU and RAM will enhance performance with higher RPC traffic.
Software Prerequisites
Ensure Docker is installed and running on your machine. Familiarity with Docker is assumed.
Optional: Custom L1 RPC URL
By default, the Ink Node repository leverages public L1 RPC & Beacon APIs. For more stability, we encourage you to use your own L1 RPC and Beacon APIs.
Step-by-Step Guide
-
Clone the Repository: Ink Node repository.
-
Configuration: To run the Ink node, it's required to bring your own L1 Sepolia Node. We suggest using QuickNode for this purpose. Create a
.env
file in the root of the repository with the following environment variables, replacing...
with your node's details:L1_RPC_URL=... L1_BEACON_URL=...
-
Run Setup Script:
./setup.sh
-
Start the Node:
docker compose up # --build to force rebuild the images
Syncing your node may take several days. Monitor usage and plan accordingly.
Verifying Sync Status
Using op-node API
Check the sync status using the optimism_syncStatus
method:
curl -X POST -H "Content-Type: application/json" --data \
'{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' \
http://localhost:9545 | jq
Using op-geth API
To verify if your node is fully synced, use the eth_blockNumber
method:
curl http://localhost:8545 -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params": [],"id":1}' | jq -r .result | sed 's/^0x//' | awk '{printf "%d\n", "0x" $0}';
A synced node will display the latest block number as seen on the block explorer.
Comparing with Ink Public RPC
Compare your local node's finalized block with the public RPC block:
local_block=$(curl -s -X POST http://localhost:8545 -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized", false],"id":1}' \
| jq -r .result.number | sed 's/^0x//' | awk '{printf "%d\n", "0x" $0}'); \
public_rpc_block=$(curl -s -X POST https://rpc-gel-sepolia.inkonchain.com/ -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["finalized", false],"id":1}' \
| jq -r .result.number | sed 's/^0x//' | awk '{printf "%d\n", "0x" $0}'); \
echo -e "Local finalized block: $local_block\nRemote finalized block: $public_rpc_block"
A synced node will have equal local and remote finalized blocks:
Local finalized block: 4449608
Remote finalized block: 4449608