September 27, 2021

Avalanche (EN)

Let's Node!

Table of contents


Requirements

To table of contents

â €Recommended:

  • CPU: Equivalent of 8 AWS vCPU
  • RAM: 16 GB
  • Storage: 200 GB
  • OS: Ubuntu 18.04/20.04

Launching

To table of contents

Docker

â €Install Docker

. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/docker_installer.sh)

â €Install image

docker pull secord/avalanche:latest

â €Run a node

docker run -it --restart=always --name=avalanche_node -d secord/avalanche:latest

â €Add a command to view a node log in the system as a variable

. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/insert_variable.sh) -n "avalanche_log" -v "docker logs avalanche_node -fn 100" -a

Automatically (one line install)

â €Execute the script

. <(wget -qO- https://raw.githubusercontent.com/SecorD0/Avalanche/main/installer.sh)

Manually

â €Update packages

sudo apt update && sudo apt upgrade -y 

â €Install required packages

sudo apt install jq pkg-config build-essential libssl-dev -y

â €Download the node binary

cd; \
avalanche_version=`wget -qO- https://api.github.com/repos/ava-labs/avalanchego/releases/latest | jq -r ".tag_name"`; \
wget "https://github.com/ava-labs/avalanchego/releases/download/$avalanche_version/avalanchego-linux-amd64-$avalanche_version.tar.gz"

â €Unzip the archive

tar -xvf "avalanchego-linux-amd64-$avalanche_version.tar.gz"

â €Rename node directory

mv $HOME`find / -name "avalanchego*" -type d -printf '/%f'` $HOME/avalanche

â €Make avalanchego executable

chmod +x $HOME/avalanche/avalanchego

â €Create a node service file

sudo tee <<EOF >/dev/null /etc/systemd/system/avalanched.service
[Unit]
Description=Avalanche Node
After=network-online.target

[Service]
User=$USER
ExecStart=$HOME/avalanche/avalanchego
Restart=always
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

â €Start the node

sudo systemctl enable avalanched
sudo systemctl daemon-reload
sudo systemctl restart avalanched

â €Add a command to view a node log in the system as a variable

. <(wget -qO- https://raw.githubusercontent.com/SecorD0/utils/main/insert_variable.sh) -n "avalanche_log" -v "sudo journalctl -f -n 100 -u avalanched" -a

â €View the node log

avalanche_log

Useful commands

To table of contents

â €To view the last 100 node log entries

avalanch_log
docker logs avalanche_node -fn 100
sudo journalctl -f -n 100 -u avalanchd

â €To restart the node

sudo systemctl restart avalanchd

Useful URLs

To table of contents

Official project site | Official Telegram group | Discord | Twitter


Thanks

To table of contents

Let’s Node Team — writing an article and creating an auto installation script

To express your gratitude