Links

Run a Chiliz Chain Node

Launch, create, connect, and debug a node to sync with Chiliz Chain
Chiliz Chain Node setup: A node allows you to transact and communicate with smart contracts on the Chiliz Chain

TL;DR

If you want to go straight into code mode, here is the gist of it:
docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 8545:8545 \
-p 8546:8546 \
chilizchain/ccv2-geth:latest \
--chiliz \
--datadir=/datadir \
--ipcdisable \
--http \
--http.addr=0.0.0.0 \
--http.api=eth,net,web3,debug,txpool \
--http.port=8545 \
--http.corsdomain="*" \
--http.vhosts="*" \
--ws \
--ws.addr=0.0.0.0 \
--ws.api=eth,net,web3,debug,txpool \
--ws.port=8546 \
--ws.origins="*" \
--miner.gasprice=2500000000000
For the long explanation, please read below!

Prerequisites

To run the Chiliz Chain node, you must have the Docker Engine installed, either on your machine or server. Therefore, please complete the Docker installation before you proceed.

Pre-build Docker images

View or use the pre-build Docker images from the Chiliz Chain 2.0 public repository on the Docker hub for Chiliz Chain 2.0.

Launch a Node and start the sync

The recommended starting point to run a Chiliz Chain node is with the mounted data volume. If this method is used to recreate a Docker container, the data gets stored in the directory and can easily be reused or cloned to another node.

Create a directory

Create a directory and point to it in the -v parameter in the following command:
docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 8545:8545 \
-p 8546:8546 \
chilizchain/ccv2-geth:latest \
--chiliz
--datadir=/datadir \
--ipcdisable

Connect Client

To connect a client with a node, you must enable RPC HTTP and/or the WebSocket servers by specifying --http and/or --ws parameter groups respectively.
For example:
docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 8545:8545 \
-p 8546:8546 \
chilizchain/ccv2-geth:latest \
--chiliz \
--datadir=/datadir \
--ipcdisable \
--http \
--http.addr=0.0.0.0 \
--http.api=eth,net,web3,debug,txpool \
--http.port=8545 \
--http.corsdomain="*" \
--http.vhosts="*" \
--ws \
--ws.addr=0.0.0.0 \
--ws.api=eth,net,web3,debug,txpool \
--ws.port=8546 \
--ws.origins="*" \
--miner.gasprice=2500000000000
CAUTION
For security reasons, ensure you set appropriate values for the following parameters:
--http.corsdomain
--http.vhosts
--ws.origins

Debug Node or the Connecting Client

​In some cases, you may want to increase the verbosity of the node, i.e. when you must debug either the node or the connecting client itself. In this case, define a --verbosity parameter that can accept the following options:
0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)

Stop the Node and cleanup

If you have launched the node using one of the above commands then your node process continues to run in the foreground. To stop this process, press CTRL+C.
Run the following command to remove the Docker container:
docker rm ccv2-node

Delete directory

Run the following command to delete a directory:
rm my-datadir

Additional Information

Visit Geth's Command-line options to view the full list of available Geth parameters.
Last modified 2mo ago