Chiliz Chain Developer Guide
English 🇬🇧 🇺🇸
Search
K
Comment on page
🖥

Spicy Testnet - full node setup

Launch, create, connect, and debug a node to sync with the Chiliz Chain
Chiliz Chain Node setup: A node allows you to transact and communicate with smart contracts on the Chiliz Chain
TL;DR
1
​docker run \
2
-v $(pwd)/my-datadir:/datadir \
3
--name ccv2-node \
4
-p 8545:8545 \
5
-p 8546:8546 \
6
chilizchain/ccv2-geth:v1.2.0 \
7
--spicy \
8
--datadir=/datadir \
9
--ipcdisable \
10
--http \
11
--http.addr=0.0.0.0 \
12
--http.api=eth,net,web3,debug,txpool \
13
--http.port=8545 \
14
--http.corsdomain="*" \
15
--http.vhosts="*" \
16
--ws \
17
--ws.addr=0.0.0.0 \
18
--ws.api=eth,net,web3,debug,txpool \
19
--ws.port=8546 \
20
--ws.origins="*" \
21
--miner.gasprice=2500000000000

Prerequisites

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

Pre-build Docker images

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

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:
1
docker run \
2
-v $(pwd)/my-datadir:/datadir \
3
--name ccv2-node \
4
-p 8545:8545 \
5
-p 8546:8546 \
6
chilizchain/ccv2-geth:v1.2.0 \
7
--spicy \
8
--datadir=/datadir \
9
--ipcdisable
10

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,

1
docker run \
2
-v $(pwd)/my-datadir:/datadir \
3
--name ccv2-node \
4
-p 8545:8545 \
5
-p 8546:8546 \
6
chilizchain/ccv2-geth:v1.2.0 \
7
--spicy \
8
--datadir=/datadir \
9
--ipcdisable \
10
--http \
11
--http.addr=0.0.0.0 \
12
--http.api=eth,net,web3,debug,txpool \
13
--http.port=8545 \
14
--http.corsdomain="*" \
15
--http.vhosts="*" \
16
--ws \
17
--ws.addr=0.0.0.0 \
18
--ws.api=eth,net,web3,debug,txpool \
19
--ws.port=8546 \
20
--ws.origins="*" \
21
--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 `--verbosity` parameter that can accept the following options:
1
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 Command-line options to view the full list of available Geth Parameters.