November 19
How to Run a Full Node for Avail
Prerequisites
Before starting, ensure you have:
- Minimum Requirements:
- OS: Linux/macOS (Windows via WSL is possible).
- CPU: 2 cores or more.
- RAM: Minimum 4GB.
- Disk: At least 100GB of free SSD storage.
- Stable internet connection.
- Tools Installed:
Steps to Deploy the Node
Step 1: Update System
Keep your system packages updated:
sudo apt update && sudo apt upgrade -y
Step 2: Install Docker and Docker Compose
If you don't already have Docker installed, follow these commands:
- Install Docker:bashCopia codice
sudo apt install docker.io -y
- Install Docker Compose:bashCopia codice
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
- Verify Installation:bashCopia codice
docker --version docker-compose --version
Step 3: Clone the Avail Full Node Repository
git clone https://github.com/availproject/avail-full-node.git cd avail-full-node
Step 4: Configure the Node
- Open the
docker-compose.yml
file in your editor (e.g.,nano
orvim
):bashCopia codicenano docker-compose.yml
- Customize the configuration as needed. For example, ensure the node ports match your environment:yamlCopia codice
services: avail: image: availproject/avail-node:latest ports: - "30333:30333" # P2P port - "9933:9933" # RPC port - "9944:9944" # WebSocket port volumes: - ./data:/data
- Save and exit (
Ctrl+O
,Ctrl+X
).
Step 5: Start the Node
Use Docker Compose to start the node:
docker-compose up -d
Step 6: Check Node Logs
Ensure the node is running correctly by checking the logs:
docker-compose logs -f
Look for lines indicating the node is syncing or producing blocks:
Syncing blocks: #12345 Peer connections: 5
Step 7: Expose Node to Network (Optional)
To allow public access to your node:
- Open the required ports (30333, 9933, 9944) on your firewall:bashCopia codice
sudo ufw allow 30333 sudo ufw allow 9933 sudo ufw allow 9944
- Restart the node if needed:bashCopia codice
docker-compose down docker-compose up -d
Step 8: Monitor Node Health
You can query the node's health using the RPC API. Install curl
if needed:
sudo apt install curl -y
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method":"system_health"}' http://localhost:9933
{ "jsonrpc": "2.0", "result": { "isSyncing": false, "peers": 12, "shouldHavePeers": true }, "id": 1 }
Step 9: Update Node (When Required)
To update the node, pull the latest Docker image:
docker-compose down docker pull availproject/avail-node:latest docker-compose up -d
Step 10: Stop or Remove Node (Optional)
docker-compose down
To completely remove the node (including data):
rm -rf ./data
This guide provides everything you need to deploy and maintain an Avail full node. Let me know if you need further customization or assistance! 🚀