Skip to content

Setup a Archive node on CORD

An archive node keeps all the past blocks and their states. An archive node makes it convenient to query the past state of the chain at any point in time. Finding out what an account’s balance at a particular block was or which extrinsics resulted in a specific state change are fast operations when using an archive node. However, an archive node takes up a lot of disk space - Archiving approximately 18 million blocks produced by CORD nodes will consume a substantial amount of space.

Using Docker for Archive 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. Create cord directory in root 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 --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!