Run a Validator node

Setting up a Chiliz Chain Validator node

What is a validator node?

To become a Chiliz Chain validator, you are required to run a Validator node, either with your own hardware, or through a partner. A node is a web server set up specifically to validate transactions before committing them on the Chiliz Chain.

TL;DR

To run a Validator node, you need to set the following parameters: (make sure to update the nodekeyhex parameter!)

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--mine \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
--datadir=/datadir \
--password=/datadir/password.txt \
--allow-insecure-unlock \
--unlock=f9100d364b45a8fdbd178ed1edfe632cc7eb2ecc \
--syncmode=full \
--gcmode=archive \
--miner.etherbase=REPLACE_WITH_VALIDATOR_ADDRESS
--nodekeyhex=2668f377e69de_EXAMPLE_REPLACE_WITH_YOUR_VALUE_c88bea3e337446ed73 \
--nat=extip:140.250.140.250 \ # This is just an example.
--verbosity=4

Prerequisites

To run the Chiliz Chain validator node, you must have the Docker Engine installed either on your machine or server. You can use a cloud provider like Amazon Web Services, Google Cloud Platform, or Microsoft Azure, or you can set up your own server (see below).

Pease complete the Docker installation before you proceed.

System requirements

You will need a dedicated server to run your validator node.

This server should have at least 4GB of RAM, 2 CPU cores, and a solid-state drive (SSD) for optimal performance.

We recommend to have at least 300 GB of free disk space to sync with the chain.

Pre-built Docker images

View or use the pre-built Docker images from the Chiliz Chain 2.0 public repository on the Docker Hub. Note that you must have a Docker Hub account to access it the repo.

Launching a Validator node and starting the sync

The recommended starting point to run a Chiliz Chain validator 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 validator.

As a fork of Ethereum, Chiliz Chain relies on Geth for its node servers.

Go-ethereum (aka Geth) is an Ethereum client built in Go. Running Geth alongside a consensus client turns a computer into an node. It is therefore an essential part of your node.

We forked Geth into ccv2-geth, as you'll see below.

Create the validator address

Create the validator node with the following command:

docker run --rm -ti \
-v $(pwd)/keystore:/root/.ethereum/keystore/ \
chilizchain/ccv2-geth:latest \
--chiliz \  # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
account new

You will need to type a password for the secret key file.

  • Public address of the key: While running the validator, this address will be used to set the --unlock parameter.

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
...
--unlock=F9100d364b45a8fdbd178ed1edfe632cc7eb2ecc # This is just an example.
  • Path of the secret key file: This file needs to be moved into the "keystore" directory inside the datadir $(pwd)/my-datadir you created in previous steps, so the final path of the file will be "$(pwd)/my-datadir/keystore/UTC–(TIMESTAMP)-(ADDRESS)". DO NOT change the name of the file.

  • Password: The password you typed during the the execution of the previous command needs to be stored in a file: $(pwd)/my-datadir/password.txt This file will be used to set the --password while running the validator node. Do not forget that all files in the host path $(pwd)/my-datadir will be located in the container in /datadir directory, this is why the password parameter should be set as the following example:

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
...
--password=/datadir/password.txt
...

It is very important to have the following recommendations in mind:

  • You can share your public address with anyone. Others need it to interact with you.

  • You must NEVER share the secret key with anyone! The key controls access to your funds!

  • You must BACK UP your key file! Without the key, it's impossible to access account funds!

  • You must REMEMBER your password! Without the password, it's impossible to decrypt the key!

Generate the validator node key

This section is optional.

We recommend you to generate a random hexadecimal string for the node. This is helpful for traceability on the logs and to avoid peering issues with the chain.

To accomplish this, you can use https://www.browserling.com/tools/random-hex and generate one hexadecimal key with 64 characters per node. While running a validator node, you can set --nodekeyhex with this value. This will ensure that when you restart the node it will have the same node address (called "enode address") and it will allow for easier future debugging or fault finding.

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
...
--nodekeyhex=2668f377e69de_EXAMPLE_REPLACE_WITH_YOUR_VALUE_c88bea3e337446ed73 # This is just an example.
...

Set Geth's NAT port mapping mechanism

Geth's --nat parameter has the following options: any, none, upnp, pmp, pmp:<IP>, and extip:<IP>. The default is any. See the Geth doc for more info.

We recommend you to use extip:<IP> , where IP is the public IPv4 address where the validator is being launched.

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
...
--nat=extip:140.250.140.250 # This is just an example.
...

Set verbosity

For deeper troubleshooting, Geth's logging verbosity parameter --verbosity can be set as:

  • 0=silent

  • 1=error

  • 2=warn

  • 3=info

  • 4=debug

  • 5=detail

The default value for is 3. We recommend you to use 4.

docker run \
-v $(pwd)/my-datadir:/datadir \
--name ccv2-node \
-p 30303:30303 \
chilizchain/ccv2-geth:latest \
--chiliz \ # for Chiliz Mainnet. Use --spicy for Spicy Testnet.
...
--verbosity=4 # This is just an example.
...

Changing the owner of a node

There might come a time when you don't want to run a validator node anymore. You might then want to pass the node along to someone else.

In that case, you can follow these steps:

  1. Connect your wallet to the Chiliz Staking dApp.

  2. Click the "Change owner" button.

  1. In the modal window, indicate the current address of the node you want to change the owner of, and it's new address (provided by the new owner).

Once submitted, the change will be applied directly.

Last updated