To run the Ink node, it's required to bring your own L1 Sepolia Node. We suggest using QuickNode for this purpose.
To set up a node on QuickNode, follow these steps:
- Create an account if you don’t have one.
- Log in and select the option to create an endpoint.
- Select ETH, then choose Sepolia, and click on Continue.
- You’ll see a few add-ons; some are free and use your credits (these credits are added if your account is new).
- After selecting add-ons, click on Create Endpoint. You’ll receive both Beacon and RPC URLs.
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 the setup script:
./setup.sh
Start the Ink node using Docker Compose:
docker compose up # --build to force rebuild the images
You can use the optimism_syncStatus method on the op-node API to know what’s the current status:
curl -X POST -H "Content-Type: application/json" --data \
'{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' \
http://localhost:9545 | jq
When your local node is fully synced, calling the eth_blockNumber method on the op-geth API should return the latest block number as seen on the block explorer.
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}';
Use this script to compare your local finalized block with the one retrieved from the Remote RPC:
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}'); \
remote_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: $remote_block"
The node is in sync when both the Local finalized block and Remote finalized block are equal. E.g.:
Local finalized block: 4449608
Remote finalized block: 4449608