Graphite mainnet node setup

Requirements

Make sure you have the latest docker installed. Make sure you have opened and not binded with other applications 8575/tcp, 30311/udp ports in order to communicated with node via rpc endpoint(8575) and also node can communicate with other nodes in network via p2p(30311). Websocket modules avialable at 8576 port. Also make sure you dont covered by nat or any other network stuff.

In order to run localy with docker you need to create folder for persist data inside container.

mkdir graphite-data

chown 10001:10001 graphite-data

After creating folder you need to run init task to inject genesis and persist it. You can do it with following command:

docker run -it -v ./graphite-data:/home/geth/data ghcr.io/atgraphite/graphite:v1.3.2 /bin/sh init-genesis.sh

Anonymous entrypoint node setup instructions

Now you can run your node. In order to do it use following command:

docker run -d --name graphite-mainnet --network host -v ./graphite-data:/home/geth/data ghcr.io/atgraphite/graphite:v1.3.2 geth --datadir /home/geth/data --config /home/geth/config.toml

Keyed entrypoint node setup instructions

Prepare your public key for inject into entrypoint with flag --epaddr. In example we will be using 0x4a0bfdAB7306b2Df31E26aF20fC423803625E4b6 address. Now you can run your node. In order to do it use following command:

docker run -d --name graphite-mainnet --network host -v ./graphite-data:/home/geth/data ghcr.io/atgraphite/graphite:v1.3.2 geth --datadir /home/geth/data --config /home/geth/config.toml --epaddr 0x4a0bfdAB7306b2Df31E26aF20fC423803625E4b6

Node rpc api is avaialable at http://127.0.0.1:8575

Usefull commands

You can check node sync proggress with following command. If sync is done you will sync done message if not you will see elapsed blocks:

docker exec -it graphite-mainnet geth --exec 'eth.syncing.currentBlock == eth.syncing.highestBlock ? console.log("sync done") : console.log("sync in progress. elapse blocks: ", eth.syncing.highestBlock - eth.syncing.currentBlock);' attach /home/geth/data/geth.ipc

To attach node logs:

docker logs graphite-mainnet --follow

To interact node with graphite js console use following command:

docker exec -it graphite-mainnet geth attach /home/geth/data/geth.ipc

Last updated