How To Deploy A Chiliz Node

How To Deploy A Chiliz Node
How To Deploy A Chiliz Node

Are you a fan of sports and blockchain technology? By deploying a Chiliz node, you can actively participate in revolutionizing the sports industry. This guide will walk you through the entire Chiliz node setup process, from obtaining the required software to configuring your node correctly.

What is a Chiliz Node?

A Chiliz node (Chiliz Chain Node) is a computer system that stores a copy of the blockchain data and communicates with smart contracts.

Previously, users could only run a Chiliz node (full node or validator node) on the Spicy testnet. With the launch of Chiliz Chain Mainnet in May 2023, interested CHZ holders can join Chiliz staking either as a validator or delegator. Full node installation is now available.

Chiliz full nodes are responsible for validating new blocks and transactions in compliance with the consensus. They alternatively verify the states of all blockchain accounts. Plus, another type of Chiliz node is called the 'validator node.' Validator nodes specify in validating transactions before signing them on the blockchain.

Our guide will focus on running a Chiliz full node and validator node on the Chiliz Chain Mainnet. You can do similar deployments on Spicy testnet if you want to test the network's functionalities without spending gas fees.

Run a Chiliz Node
Run a Chiliz Node

Chiliz Node Setup Requirements

Chiliz Chain Node

As of October 2023, there are no additional specific requirements for running a Chiliz Chain Node, except the Docker installation. You can return to the main page for the newest updates in the future.

To install Docker, navigate this link and choose your supported system.

Install Docker Engine | Chiliz Chain Node Setup | BlockMeadow
Install Docker Engine | Chiliz Chain Node Setup | BlockMeadow

Chiliz Validator Node

Before setting up a validator node, follow the Docker Installation step below. You will need additional system prerequisites before proceeding further.

  • At least 4GB of RAM.
  • Dual-CPU.
  • SSD-based storage with at least 150GB of available space.

You can set up your own server or use a cloud provider such as Amazon Web Services, Google Cloud Platform, and Microsoft Azure. It is important to note that these requirements are subject to change. You're encouraged to regularly check out the Chiliz Docs for the latest updates.

How to Deploy a Chiliz Full Node and Validator Node on Docker

Below is how to set up a Chiliz full node and validator node on Docker. We've assumed that you have Docker Engine installed already.

Run a Chiliz Full Node

1. Create a directory

Run the following command to create a directory:

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 8545:8545 \
-p 8546:8546 \
chilizchain/ccv2-geth:v1.5.2 \
--chiliz
--datadir=/datadir \
--ipcdisable

2. Connect a client

Activate RPC HTTP and/or the WebSocket servers to connect a client.

docker run \ -v $(pwd)/my-datadir:/datadir \ --name ccv2-node \ -p 8545:8545 \ -p 8546:8546 \ chilizchain/ccv2-geth:v1.5.2 \ --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

3. Stop the node, remove the Docker container and directory

  • To stop your running node, press Ctrl + C.
  • To remove the Docker container, run:
docker rm ccv2-node
  • To remove the directory, run:
rm my-datadir

Run a Chiliz Validator Node

1. Create a directory

Run the following command to create a directory:

docker run \ -v $(pwd)/my-datadir:/datadir \ --name ccv2-validator \ -p 30303:30303 \ chilizchain/ccv2-geth:v1.5.2 ...

2. Create a validator node

Run the following command to create a validator node:

docker run --rm -ti \ -v $(pwd)/keystore:/root/.ethereum/keystore/ \ chilizchain/ccv2-geth:v1.5.2 \ account new

3. Generate the validator node key (optional)

Generate the validator node key using the Random Hex Number Generator recommended in the Chiliz Developer Guide.

Generate Random Hex | Set up Chiliz Validator Node | BlockMeadow
Generate Random Hex - Set up Chiliz Validator Node

4. Set NAT port and verbosity

  • To set NAT port, use extip:<IP>:
docker run \ -v $(pwd)/my-datadir:/datadir \ --name ccv2-node \ -p 30303:30303 \ chilizchain/ccv2-geth:v1.5.2 \ ... --nat=extip:140.250.140.250 # example ...
  • To debug node, set the parameter value at 4:
docker run \ -v $(pwd)/my-datadir:/datadir \ --name ccv2-node \ -p 30303:30303 \ chilizchain/ccv2-geth:v1.5.2 \ ... --verbosity=4 #example ...

Read more