Bare Metal
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
nginx.conf
file to/etc/nginx/nginx.conf
on your host.
NOTE: : You might first have to create the directory:sudo mkdir -p /etc/nginx
- Edit
docker-compose.yml
and fill in your Klaytn API URL. Search forKLAYTN_API_URL
. - Start the docker containers. Run this command from the same folder as your
docker-compose.yml
:
docker compose up -d
- Verify everything is running correctly:
- Check the running docker containers:
docker psYou should see the following containers:query-node
,index-node
,ipfs
,postgres
,nginx
- Verify ports used by these services are open:
netstat -nltpYou should see the following ports:80
,5001
,5432
,8000
,8020
- Check if the index-node has started sync-ing:
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 - Navigate to the
http://<EXTERNAL_IP>/subgraphs/graphql
url in a browser to confirm it is working correctly
NOTE: : If you are doing everything on localhost, then navigate tohttp://localhost/subgraphs/graphql
NOTE: : To stop the services rundocker compose down
Last modified 10mo ago