Avail Clash of Nodes Tutorial
How to set up a validator node for Avail’s incentivised testnet with Docker
Who am I?
I have been involved in crypto since 2017. I have been taking part in testnets for the past few years and I write guides for my own reference and to help others.
Follow me on twitter: @insightstake
What is Avail?
Avail is a project that was spun off from Polygon Labs to work independently to solve the problem of data availability.
Avail aims to develop modular blockchain architecture that will allow any Web3 project scale to serve the next wave of users.
Getting started
These are the hardware requirements for an Avail node:
I will be using a VPS with a 4 core AMD CPU (ARM-based CPUs are incompatible for this build), 8GB RAM and 160GB storage running an Ubuntu 22.04 OS.
I also use a virtual machine running Ubuntu 22.04 to connect to my VPS via SSH through the terminal. You can use this method, or (if you don’t want to set up a VM and want to work from Windows) you can use a tool like Solar-PuTTY to connect via SSH.
I will be installing the node with Docker.
Note: Anything with < >
should be replaced with your own information.
1. Intial Setup
I have conncted to my VPS via SSH and begin from root
.
a) Update the system:
sudo apt update && sudo apt upgrade -y
b) Install tools and dependencies:
sudo apt install git ccze vim curl ufw npm build-essential clang make libssl-dev libcurl4-openssl-dev protobuf-compiler -y
Many of the included dependencies came from here.
c) Configure and enable your firewall:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 30333
sudo ufw allow 8001
sudo ufw allow 3000
sudo ufw allow 9933
sudo ufw allow 9615
sudo ufw allow 9944
sudo ufw enable
Hit y
then enter
.
d) Add a user, give permissions and a password:
sudo useradd -m -s /bin/bash <username>
sudo usermod -aG sudo <username>
sudo passwd <username>
2. Install Docker (using the Apt repository)
a) Set up Docker’s Apt repository:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
b) Install the latest Docker packages:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
c) Verify that the Docker Engine installation is successful by running the hello-world
image:
sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
3. Installing the Node with Docker
a) Move to your new user account:
su <username>
cd
b) Make necessary directories
sudo mkdir /mnt/avail
sudo mkdir /mnt/avail/config
sudo mkdir /mnt/avail/state
sudo mkdir /mnt/avail/keystore
c) Pull the Docker image
Make sure to set your node name!!
cd /mnt/avail
sudo docker run -v $(pwd)/state:/da/state:rw -v $(pwd)/keystore:/da/keystore:rw -e DA_CHAIN=goldberg -e DA_NAME=<nodename> -p 0.0.0.0:30333:30333 -p 9615:9615 -p 9944:9944 -d --restart unless-stopped availj/avail:v1.8.0.0 --validator
For example:
DA_NAME=insight
d) Check the Docker image:
sudo docker ps
It should look something like this:
e) Check the logs by using the CONTAINER ID
:
sudo docker logs <CONTAINER ID>
For example:
sudo docker logs 70f1ae1b6fa8
Which should give an output like this:
Note the AUTHORITY
role. This means you are a validator.
If you need to remove a container in the future run:
sudo docker stop <CONTAINER_ID>
sudo docker rm <CONTAINER_ID>
Monitor your node
Now wait for your node to sync with the network then look for it in the telemery list but know that telemetry only shows 1000 nodes at a time, so your node may not appear on the list.
Update your node
a) Find your node’s Docker container and stop it:
cd
sudo docker ps -a
sudo docker stop <container_ID>
b) Create a new node with the latest version:
Make sure to edit this to include your node’s name and the node’s version!
cd /mnt/avail
sudo docker run -v $(pwd)/state:/da/state:rw -v $(pwd)/keystore:/da/keystore:rw -e DA_CHAIN=goldberg -e DA_NAME=<nodename> -p 0.0.0.0:30333:30333 -p 9615:9615 -p 9944:9944 -d --restart unless-stopped availj/avail:<version> --validator
Example:
sudo docker run -v $(pwd)/state:/da/state:rw -v $(pwd)/keystore:/da/keystore:rw -e DA_CHAIN=goldberg -e DA_NAME=insight -p 0.0.0.0:30333:30333 -p 9615:9615 -p 9944:9944 -d --restart unless-stopped availj/avail:v1.8.0.0 --validator
This is the end of the guide, I hope it’s been useful.
Also, don’t forget to fill in the docs to sign up as a validator.