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

Scoville 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
1
## TL;DR
2
3
docker run \
4
-v $(pwd)/my-datadir:/datadir \
5
--name ccv2-node \
6
-p 8545:8545 \
7
-p 8546:8546 \
8
chilizchain/ccv2-geth:v1.2.0 \
9
--scoville \
10
--datadir=/datadir \
11
--ipcdisable \
12
--http \
13
--http.addr=0.0.0.0 \
14
--http.api=eth,net,web3,debug,txpool \
15
--http.port=8545 \
16
--http.corsdomain="*" \
17
--http.vhosts="*" \
18
--ws \
19
--ws.addr=0.0.0.0 \
20
--ws.api=eth,net,web3,debug,txpool \
21
--ws.port=8546 \
22
--ws.origins="*" \
23
--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.

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
--scoville \
8
--datadir=/datadir \
9
--ipcdisable
You will notice similar lines showing your node has started to sync with Chiliz Chain:
1
INFO [09-14|18:26:41.806] Imported new block headers count=2048 elapsed=448.592ms number=405,696 hash=0c0243..8d2096 age=5mo3d8h
2
INFO [09-14|18:26:42.094] Imported new state entries count=768 elapsed=3.555ms processed=4,881,021 pending=6558 trieretry=0 coderetry=0 duplicate=0 unexpected=382
3
INFO [09-14|18:26:42.686] Imported new state entries count=1536 elapsed=11.658ms processed=4,882,557 pending=5653 trieretry=0 coderetry=0 duplicate=0 unexpected=382
4
INFO [09-14|18:26:42.930] Imported new state entries count=0 elapsed="8.485µs" processed=4,882,557 pending=5653 trieretry=2 coderetry=0 duplicate=1 unexpected=383

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.
1
```
2
--http Enable the HTTP-RPC server
3
--http.addr value HTTP-RPC server listening interface (default: "localhost")
4
--http.port value HTTP-RPC server listening port (default: 8545)
5
--http.api value API's offered over the HTTP-RPC interface
6
--http.rpcprefix value HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
7
--http.corsdomain value Comma separated list of domains from which to accept cross origin requests (browser enforced)
8
--http.vhosts value Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")
9
--ws Enable the WS-RPC server
10
--ws.addr value WS-RPC server listening interface (default: "localhost")
11
--ws.port value WS-RPC server listening port (default: 8546)
12
--ws.api value API's offered over the WS-RPC interface
13
--ws.rpcprefix value HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
14
--ws.origins value Origins from which to accept websockets requests
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
--scoville \
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.