These instructions will walk you through spinning up a Graph node on a generic Linux host.
- A Linux machine with access to the internet.
- Sudo privileges on this machine.
- A Klaytn API Endpoint.
This guide, with examples and the complete Docker configuration can be found on the Klaytn Indexing repo published and deployed by Bware Labs.
NOTE: : These instructions were tested on Ubuntu 22.04 LTS
- Connect to your machine.
NOTE: : It might be useful to allow non-root users to run docker too:
sudo chmod 666 /var/run/docker.sock
- Configure docker to start automatically on boot:
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
- Install other useful tools for debugging issues:
sudo apt install net-tools
- Copy the
/etc/nginx/nginx.confon your host.
NOTE: : You might first have to create the directory:
sudo mkdir -p /etc/nginx
docker-compose.ymland fill in your Klaytn API URL. Search for
- Start the docker containers. Run this command from the same folder as your
docker compose up -d
- Verify everything is running correctly:
docker psYou should see the following containers:
- Check the running docker containers:
netstat -nltpYou should see the following ports:
- Verify ports used by these services are open:
docker logs index-nodeYou should see something like this:Downloading latest blocks from Ethereum, this may take a few minutes..., provider: klaytn-rpc-0, component: BlockIngestor...Oct 12 14:52:17.601 INFO Syncing 84 blocks from Ethereum, code: BlockIngestionLagging, blocks_needed: 84, blocks_behind: 84, latest_block_head: 103684173, current_block_head: 103684089, provider: klaytn-rpc-0, component: BlockIngestorOct 12 14:52:47.482 INFO Syncing 30 blocks from Ethereum, code: BlockIngestionLagging, blocks_needed: 30, blocks_behind: 30, latest_block_head: 103684203, current_block_head: 103684173, provider: klaytn-rpc-0, component: BlockIngestorOct 12 14:52:58.759 INFO Syncing 11 blocks from Ethereum, code: BlockIngestionStatus, blocks_needed: 11, blocks_behind: 11, latest_block_head: 103684214, current_block_head: 103684203, provider: klaytn-rpc-0, component: BlockIngestor
- Check if the index-node has started sync-ing:
- Navigate to the
http://<EXTERNAL_IP>/subgraphs/graphqlurl in a browser to confirm it is working correctly
NOTE: : If you are doing everything on localhost, then navigate to
NOTE: : To stop the services run
docker compose down