Skip to content
Validators
Support external chains
Avalanche

Avalanche

Instructions to set up your Avalanche node.

Requirements

Prerequisites

sudo apt-get install wget jq -y

Get Binaries

Check the appropriate version for the network accordingly in their docs (opens in a new tab) or choose the latest release (opens in a new tab)

# This is an example - check their docs and release page to opt for the right version
AVALANCHEGO=v1.9.3
# verify correct versions
echo $AVALANCHEGO
 
# create a temp dir for binaries
cd $HOME
mkdir binaries && cd binaries
 
 
# get avalanchego binary and rename
wget https://github.com/ava-labs/avalanchego/releases/download/$AVALANCHEGO/avalanchego-linux-amd64-$AVALANCHEGO.tar.gz
tar -xvf avalanchego-linux-amd64-$AVALANCHEGO.tar.gz
rm avalanchego-linux-amd64-$AVALANCHEGO.tar.gz
cd avalanchego-$AVALANCHEGO
 
# make binaries executable
chmod +x *
 
# move to usr bin
sudo mv * /usr/bin/
 
# get out of binaries directory
cd $HOME
 
# verify version
avalanchego --version

Set environment variables

Note: Update your shell profile in accordance with the shell you are using

echo export NETWORK_ID=mainnet >> $HOME/.profile

Apply your changes

source $HOME/.profile

Create services

Use systemctl to set up service for avalanchego.

avalanchego

sudo tee <<EOF >/dev/null /etc/systemd/system/avalanchego.service
[Unit]
Description=Avalanche daemon
After=network-online.target
 
[Service]
User=root
ExecStart=/usr/bin/avalanchego --http-host= --network-id=$NETWORK_ID
Restart=on-failure
RestartSec=3
LimitNOFILE=32768
 
[Install]
WantedBy=multi-user.target
EOF
 
 
# verify and enable
cat /etc/systemd/system/avalanchego.service
sudo systemctl enable avalanchego