Skip to content

Setup a validator node on CORD

A validator node in blockchain is the esteemed guardian of trust and security. It plays a crucial role in the consensus mechanism, validating transactions and ensuring their legitimacy. This distinguished entity is empowered to participate in block creation and verification, contributing to the decentralized and unalterable nature of the blockchain network.

Using Docker for Validator Node

Docker Info
💡 Install Docker

Follow the official Docker installation guide here to set up Docker on your machine.

📌 Post-installation steps for Docker

post-installation procedures here shows you how to configure your host machine to work better with Docker.

  1. Update and Upgrade packages
Terminal window
sudo apt update -y && sudo apt upgrade -y
  1. The following command creates a directory called “cord” in the root directory, gives ownership of the directory to the user who executed the command, and grants rwx access on that directory.
Terminal window
sudo mkdir /cord && sudo chown $USER /cord && sudo chmod 777 /cord
  1. Generate node key and store it in cord directory
Terminal window
cd /cord && docker run -i -v $(pwd):/cord dhiway/cord:develop key generate-node-key --file /cord/node.key
  1. Download the chain specification into cord directory
Terminal window
#for linux:
cd /cord && wget -c https://raw.githubusercontent.com/dhiway/confidex/main/confidex-alpha.json
#for mac:
cd /cord && curl -O https://raw.githubusercontent.com/dhiway/confidex/main/confidex-alpha.json
  1. Run CORD using the following command. name-you-see-in-telemetry should be changed to name of your choice before running the command
Terminal window
sudo docker run --detach --restart unless-stopped -v /cord:/cord --name cord --network host dhiway/cord:dev_9 --name name-you-see-in-telemetry --validator --pruning=archive --base-path /cord/ --chain /cord/confidex-alpha.json --node-key-file /cord/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --prometheus-external
  1. If the CORD is up and running, run the following command by replacing secret seed with the secret you generated during the account creation
Terminal window
sudo docker run -v /cord:/cord --rm dhiway/cord:develop \
key generate-session-keys \
--chain=/cord/confidex-alpha.json \
--suri "secret seed" \
-d /cord/
  1. Check logs
Terminal window
sudo docker logs container-id

To verify that your node is live and synchronized, head to https://telemetry.cord.network and find your node. Note that this will show all nodes on the CORD network, which is why it is important to select a unique name!