Skip to main content

Avail Protocol Testnet Validator Setup Guide

This guide provides two methods to set up an Avail Protocol validator node on the Turing testnet. Choose the method that best fits your environment and technical expertise.

Prerequisites

System Requirements

ComponentMinimumRecommended
CPU4 cores (x86-64 architecture)8+ cores
Memory8GB RAM16GB+ RAM
Storage20-40GB SSD200-300GB SSD
Network1 Mbps stable internet10+ Mbps
OSUbuntu 22.04/24.04 LTSUbuntu 24.04 LTS

Network Configuration

ComponentValueDescription
NetworkAvail Turing NetworkTest network
Latest Versionv2.3.2.0Current testnet version
P2P Port30333Peer-to-peer communication
RPC Port9944RPC endpoint (optional, default)

Installation Methods

Choose one of the following installation methods:

  • OS: Any Linux distribution with Docker support
  • Pros: Easy setup, isolated environment, automatic updates
  • Cons: Requires basic Docker knowledge

Method 2: Binary Installation (Advanced)

  • OS: Ubuntu 22.04/24.04 LTS x64 (required)
  • Pros: Native performance, direct system control
  • Cons: Manual updates, OS-specific

tip

The following commands are executed as root by default. If you are not a root user, please prepend the commands with sudo.

sudo -i

Base Step

Configure Environment Variables

apt update
apt install -y make git-core libssl-dev pkg-config build-essential protobuf-compiler libudev-dev curl jq wget aria2

# Set up environment variables
export AVAIL_VER="v2.3.2.0"
export AVAIL_IMAGE="availj/avail:${AVAIL_VER}"
export AVAIL_DIR="/data/avail"
export AVAIL_DATA="${AVAIL_DIR}/node-data"
export AVAIL_NODE_NAME="your-avail-node-name"
export AVAIL_P2P_PORT="30333"
export AVAIL_PROMETHEUS_PORT="30334"
export AVAIL_RPC_PORT="9944"

# Create directories
mkdir -pv $AVAIL_DATA
cd $AVAIL_DIR

Method 1: Docker Compose Installation

This method uses Docker Compose for easy deployment and management.

Step 1: Install Docker

# Update system packages and install prerequisites
apt-get update
apt-get install ca-certificates curl gnupg lsb-release

# Add Docker's official GPG key
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /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 \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

# Update package list and install Docker
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

# Start and enable Docker service
systemctl start docker
systemctl enable docker

# Add user to docker group (logout and login required)
usermod -aG docker $USER

# Verify installation
docker --version
docker compose version

Step 2: Create Docker Compose Configuration

Create a working directory and Docker Compose file:

# Create environment file
cat > .env << EOF
AVAIL_IMAGE=${AVAIL_IMAGE}
AVAIL_DATA_PATH=${AVAIL_DATA}
AVAIL_P2P_PORT=${AVAIL_P2P_PORT}
AVAIL_PROMETHEUS_PORT=${AVAIL_PROMETHEUS_PORT}
AVAIL_RPC_PORT=${AVAIL_RPC_PORT}
AVAIL_NODE_NAME=${AVAIL_NODE_NAME}
EOF

# Create Docker Compose file
cat > docker-compose.yml << 'EOF'
x-logging: &logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"

services:
avail-node:
image: ${AVAIL_IMAGE}
container_name: avail-node
restart: unless-stopped
ports:
- "${AVAIL_P2P_PORT}:30333"
- "${AVAIL_PROMETHEUS_PORT}:30334"
- "${AVAIL_RPC_PORT}:9944"
volumes:
- ${AVAIL_DATA_PATH}:/da/node-data
command:
- "-d"
- "/da/node-data"
- "--chain"
- "turing"
- "--name"
- "${AVAIL_NODE_NAME}"
- "--validator"
- "--port"
- "30333"
- "--prometheus-port"
- "30334"
- "--prometheus-external"
- "--unsafe-rpc-external"
logging: *logging

networks:
default:
name: avail-network
EOF

Step 3: Start avail node

# Start the avail node
docker compose up -d

# Check if container is running
docker compose ps

# View logs
docker compose logs -f avail-node

Method 2: Binary Installation (Ubuntu 24.04)

For advanced users who prefer native installation.

Step 1: Download and Install Binary

# Download latest binary
cd /tmp
wget https://github.com/availproject/avail/releases/download/${AVAIL_VER}/avail-node-ubuntu-2404-x86_64.tar.gz

# Extract and install
tar -xzf avail-node-ubuntu-2404-x86_64.tar.gz
mv avail-node ${AVAIL_DIR}/avail-node
chmod +x ${AVAIL_DIR}/avail-node

Step 2: Create Systemd Service

cd ${AVAIL_DIR}

tee start_node.sh > /dev/null << EOF
#!/bin/bash

${AVAIL_DIR}/avail-node \
--validator \
--name="${AVAIL_NODE_NAME}" \
--prometheus-external \
--prometheus-port ${AVAIL_PROMETHEUS_PORT}
--port ${AVAIL_P2P_PORT} \
--chain turing \
-d ${AVAIL_DATA}
EOF
tee /etc/systemd/system/avail.service > /dev/null << EOF
[Unit]
Description=Avail Node
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=10
User=avail
ExecStart=bash start_node.sh
WorkingDirectory=${AVAIL_DIR}

[Install]
WantedBy=multi-user.target
EOF

# Reload systemd and start service
systemctl daemon-reload
systemctl enable avail
systemctl start avail

# Check status
systemctl status avail

Post-Installation Steps

Configure Firewall

# Open required ports
ufw allow 30333 comment "avail node p2p port"
# or if you know how to use [ufw-docker](https://raw.githubusercontent.com/chaifeng/ufw-docker/master/ufw-docker)
ufw route allow proto tcp from any to any port 30333 comment "avail node p2p port"

Check Sync Status

curl -X POST -H "Content-Type: application/json" --data '{"method":"system_syncState","params":[],"id":1,"jsonrpc":"2.0"}' http://127.0.0.1:9944 | jq .

Expected Log Output:

{
"jsonrpc": "2.0",
"result": {
"startingBlock": 2025922,
"currentBlock": 2094776,
"highestBlock": 2094776
},
"id": 1
}

Generate Session Keys

After your node is running and synced, generate session keys for validation:

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://127.0.0.1:9944
warning

Save the returned session keys securely - you'll need them to register as a validator.

Stake Your Validator

Please refer to this document to create a validator


Troubleshooting

Common Issues

Node Not Syncing

  • Check network connectivity
  • Verify firewall settings
  • Ensure sufficient disk space
  • Check peer connections

Container Won't Start

  • Verify Docker installation
  • Check port availability
  • Review configuration files
  • Check system resources

Permission Denied Errors

  • Verify file ownership
  • Check directory permissions
  • Ensure user has proper access

Getting Help


info

This guide is for the Avail Turing testnet. For mainnet deployment, use the appropriate chain specification and image versions.

warning

Security Note:

  • Keep your session keys secure and never share them
  • Use strong passwords and secure your server
  • Regularly backup your node data and keys
  • Monitor your validator performance
tip

Pro Tips:

  • Join the community for support and updates
  • Monitor your node regularly
  • Keep your system and software updated
  • Consider setting up monitoring and alerting