The CORD Sparknet comprises of different types of nodes - boot node, full node, validator node and archive node. Each type of node has different function within the network infrastructure. This document provides a single page instruction set to create one or all different kinds of the nodes and associate them with the Sparknet instance of CORD network.
The archive node maintains all the past blocks and the states. This makes it convenient to query the past state of the chain at any point in time. A full node prunes historical states eg. except for the state of the genesis block all states of finalised blocks older than a configurable number. This means that it requires much less space than an archived node.
Before we begin it is necessary to understand that the generation of the node key is mandatory only for boot nodes. If a node key file is not provided as a parameter then cord will generate a random node key.
💡 OS: Ubuntu 22.04- Ideal: 32 GB RAM, NVMe SSD of 256GB
- Minimum: 16 GB RAM, SSD Storage of 256GB
- Ideal: 32 GB RAM, NVMe SSD of 512 GB
- Minimum: 16 GB RAM, SSD Storage of 512 GB
- Minimum: 2vCPU, 4 GB RAM, 10 GB Storage
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- The CORD project makes pre-built binaries available which remove the need to compile and saves time during deployment. Download the compiled CORD binary using
wget
commands as below.
# using wget
sudo wget -O /usr/local/bin/cord https://github.com/dhiway/cord/releases/download/125b662/cord-develop-x86_64-ubuntu-22.04 && sudo chmod +x /usr/local/bin/cord
- Create a
data
directory inroot
directory
sudo mkdir /data
- Generate Node Key
sudo cord key generate-node-key --file /data/node.key
- Create cord.service file
sudo vim /etc/systemd/system/cord.service
This file contains the commands which will be run on server boot/restart
[Unit]
Description=cord
[Service]
User=ubuntu
ExecStart=sudo cord --name <node-name> --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
- Reload the daemon
sudo systemctl daemon-reload
- To enable this to autostart on reboot use the following command
sudo systemctl enable cord.service
- Start the cord process
sudo systemctl start cord
- Check cord status
sudo systemctl status cord
- Check the log
sudo tail -f /var/log/syslog
-
Post-installation steps for Docker 👇
source : https://docs.docker.com/engine/install/linux-postinstall/
To create the docker group and add your user:
-
Create the
docker
group.sudo groupadd docker
-
Add your user to the
docker
group.sudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated. You can also run the following command to activate the changes to groups.
newgrp docker
-
Verify that you can run
docker
commands withoutsudo
.docker run hello-world
-
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Now, pull CORD image from docker hub
docker pull dhiway/cord:develop
- make an empty folder named data in home directory
mkdir /data
3.1 Change the ownership of data directory
sudo chown $USER /data
- Create Validator Account
docker run dhiway/cord:develop key generate -n cord --words 24 --scheme Sr25519
- Generate Node key and store in data directory
sudo docker run -v /data:/data --rm dhiway/cord:develop key generate-node-key --file /data/node.key
- Run Cord (Here the should be changed to name of your choice)
sudo docker run --detach --restart unless-stopped -v /data:/data --name cord dhiway/cord:develop --name <name> --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external
- generate the session keys(The secret mentioned here is the secret seed from Account generation”step 4”)
sudo docker run -v /data:/data -v $(pwd):/home/ubuntu --rm dhiway/cord:develop key generate-session-keys -d /data --chain spark --suri "<secret>"
- Check logs
sudo docker logs <container-id>
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- The CORD project makes pre-built binaries available which remove the need to compile and saves time during deployment. Download the compiled CORD binary using wget or curl commands as below.
# using wget
sudo wget -O /usr/local/bin/cord https://github.com/dhiway/cord/releases/download/125b662/cord-develop-x86_64-ubuntu-22.04 && sudo chmod +x /usr/local/bin/cord
- Create a
data
directory inroot
directory
sudo mkdir /data
- Generate Node Key
sudo cord key generate-node-key --file /data/node.key
- Create Validator Account
sudo cord key generate -n cord --words 24 --scheme Sr25519
Example Output
Secret phrase: life bachelor card luggage where believe awful tongue retreat planet trip soul fork kiss announce virtual client pact tomato try auto trial rare upper
Network ID: cord
Secret seed: 0x97338113516f0553195ebcafd0bfc13c985339546a6bd030752ab322d21cfd44
Public key (hex): 0x56d99259e2ece1ed8d6d06f802c2a5a5252cd7ad78e71537ad34897a3847237a
Account ID: 0x56d99259e2ece1ed8d6d06f802c2a5a5252cd7ad78e71537ad34897a3847237a
Public key (SS58): 3vo1FHxrrEBmnRVvoHpabfhos1MxBgyzyrjqzAsgnMCEEQQN
SS58 Address: 3vo1FHxrrEBmnRVvoHpabfhos1MxBgyzyrjqzAsgnMCEEQQN
- Run CORD in one terminal: Make sure to give a good name
cord --validator \
--name <node-name> \
--base-path /data/ \
--chain spark \
--node-key-file /data/node.key \
--port 30333 \
--rpc-port 9933 \
--prometheus-port 9615 \
--rpc-methods=Safe \
--rpc-cors all \
--no-hardware-benchmarks \
--state-pruning 100 \
--blocks-pruning 100 \
--offchain-worker never \
--prometheus-external \
--bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
- Open another terminal and generate session keys using the commands below
cord generate-session-keys -d /data/ \
--chain spark \
--suri "<secret seed>"
Example:
# The secret key is from step 5 example
cord key generate-session-keys -d /home/ubuntu/data/ \
--chain spark \
--suri "0x97338113516f0553195ebcafd0bfc13c985339546a6bd030752ab322d21cfd44"
- Stop the running Node
Ctrl + C
- Create cord.service file
sudo vim /etc/systemd/system/cord.service
This file contains the commands which will be run on server boot/restart
[Unit]
Description=cord
[Service]
User=ubuntu
ExecStart=sudo cord --name <node-name> --validator --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
- Reload the daemon
sudo systemctl daemon-reload
- To enable this to autostart on reboot use the following command
sudo systemctl enable cord.service
- Start the cord process
sudo systemctl start cord
- Check cord status
sudo systemctl status cord
- Check the log
sudo tail -f /var/log/syslog
-
Post-installation steps for Docker 👇
source : https://docs.docker.com/engine/install/linux-postinstall/
To create the docker group and add your user:
-
Create the
docker
group.sudo groupadd docker
-
Add your user to the
docker
group.sudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated. You can also run the following command to activate the changes to groups.
newgrp docker
-
Verify that you can run
docker
commands withoutsudo
.docker run hello-world
-
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Now, pull CORD image from docker hub
docker pull dhiway/cord:develop
- Make an empty folder named data in your root directory
sudo mkdir /data
3.1 Change the ownership of data directory
sudo chown $USER /data
- Create Validator Account
sudo docker run dhiway/cord:develop key generate -n cord --words 24 --scheme Sr25519
- Generate Node key and store in ‘data’ directory
sudo docker run -v $(pwd)/data:/data --rm dhiway/cord:develop key generate-node-key --file /data/node.key
- Run Cord (Here the should be changed to name of your choice)
sudo docker run --detach --restart unless-stopped -v /data:/data --name cord dhiway/cord:develop --name **<name-you-see-in-telemetry>** --validator --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
- Generate the session keys(The secret mentioned here is the secret seed from Account generation”step 3”)
sudo docker run -v $(pwd)/data:/data -v $(pwd):/home/ubuntu --rm dhiway/cord:develop key generate-session-keys -d /data --chain spark --suri "<secret>"
- Check logs
sudo docker logs <container-id>
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Download the compiled binary and rename it
# using wget
sudo wget -O /usr/local/bin/cord https://github.com/dhiway/cord/releases/download/125b662/cord-develop-x86_64-ubuntu-22.04 && sudo chmod +x /usr/local/bin/cord
- Create a
data
directory inhome
directory
mkdir /data
- Generate Node Key
sudo cord key generate-node-key --file /data/node.key
- Create a systemd file
sudo vim /etc/systemd/system/cord.service
The content of the systemd file
[Unit]
Description=cord
[Service]
User=ubuntu
ExecStart=sudo cord --name <node-name> --validator --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
- Reload the daemon
sudo systemctl daemon-reload
- Enable systemd
sudo systemctl enable cord.service
- Start the cord process
sudo systemctl start cord
- Check cord status
sudo systemctl status cord
- Check the log
sudo tail -f /var/log/syslog
-
Post-installation steps for Docker 👇
source : https://docs.docker.com/engine/install/linux-postinstall/
To create the docker group and add your user:
-
Create the
docker
group.sudo groupadd docker
-
Add your user to the
docker
group.sudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated. You can also run the following command to activate the changes to groups.
newgrp docker
-
Verify that you can run
docker
commands withoutsudo
.docker run hello-world
-
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Now, pull image from dockerhub
sudo docker pull dhiway/cord:develop
- Make an empty folder named data in root directory
sudo mkdir /data
3.1 Change the ownership of data directory
sudo chown $USER /data
- Generate Node key and store in
data
directory
sudo docker run -v /data:/data --rm dhiway/cord:develop key generate-node-key --file /data/node.key
- Run Cord (Here the should be changed to name of your choice)
sudo docker run --detach --restart unless-stopped -v /data:/data --name cord dhiway/cord:develop --name <name> --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
- Check logs
sudo docker logs <container-id>
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Download the compiled binary
# using wget
sudo wget -O /usr/local/bin/cord https://github.com/dhiway/cord/releases/download/125b662/cord-develop-x86_64-ubuntu-22.04 && sudo chmod +x /usr/local/bin/cord
- Create
data
directory inroot
directory
mkdir /data
- Generate Node Key
cord key generate-node-key --file /data/node.key
- Create a Systemd file
sudo vim /etc/systemd/system/cord.service
The content of the systemd file
[Unit]
Description=cord
[Service]
User=ubuntu
ExecStart=sudo cord --name <node-name> --pruning=archive --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
- Reload the daemon
sudo systemctl daemon-reload
- Enable cord process
sudo systemctl enable cord
- Start the cord process
sudo systemctl start cord
- Check cord process status
sudo systemctl status cord
- Check the log
sudo tail -f /var/log/syslog
-
Post-installation steps for Docker 👇
source : https://docs.docker.com/engine/install/linux-postinstall/
To create the docker group and add your user:
-
Create the
docker
group.sudo groupadd docker
-
Add your user to the
docker
group.sudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated. You can also run the following command to activate the changes to groups.
newgrp docker
-
Verify that you can run
docker
commands withoutsudo
.docker run hello-world
-
- Update and Upgrade packages
sudo apt update -y && sudo apt upgrade -y
- Pull Cord image from docker hub
docker pull dhiway/cord:develop
- make an empt folder named data in home directory
sudo mkdir /data
3.1 Change the ownership of data directory
sudo chown $USER /data
- Generate Node key and store in ‘data’ directory
docker run -v $(pwd)/data:/data --rm dhiway/cord:develop key generate-node-key --file /data/node.key
- Run Cord (Here the should be changed to name of your choice)
sudo docker run --detach --restart unless-stopped -v /data:/data --name cord dhiway/cord:develop --name <name-you-see-in-telemetry> --base-path /data/ --chain spark --node-key-file /data/node.key --port 30333 --rpc-port 9933 --prometheus-port 9615 --rpc-methods=Safe --rpc-cors all --no-hardware-benchmarks --state-pruning 100 --blocks-pruning 100 --offchain-worker never --prometheus-external --bootnodes /dns4/sparknet-bn1.cord.network/tcp/30333/p2p/12D3KooWRsz18nHnHFxAjkGiCE6auBG5Y8LCgi2MmPTWUnvVYwxe /dns4/sparknet-bn2.cord.network/tcp/30333/ws/p2p/12D3KooWKMvTXGEWLWFVKJg3GFibapB9dmN91pmxdEwRpMvJ7jja /dns4/sparknet-bn3.cord.network/tcp/30333/ws/p2p/12D3KooWSv1Cxpa93CbGJPZsSbEbn9BAHvfkL9DyjgXAMGHcUHZ8
- Check logs
sudo docker logs <container-id>