Light Node Installation Guide on Avail

Cumulo
Cumulo.pro
Published in
4 min readNov 26, 2023

Index of contents

· Introduction
· Initial steps
· Installation and execution
From the binary:
From the source code:
· Use SystemD services
Create an availightd service

Introduction

Light Clients in Avail allow you to interact with the blockchain without the need for a full node , using data availability sampling to verify blocks independently.

They are divided into two parts: one for sampling and another for data reconstruction.

These clients connect to the Avail network, perform random sampling on the blocks, and verify this data to calculate their trust. In addition, they offer an API to query processed block data.

Initial steps

🧊Hardware Requirements:

  • RAM4 GB (8GB recommended)
  • CPU (AMD64/x86 architecture) 2 cores (4 cores recommended)
  • Storage (SSD)20–40 GB (200–300GB recommended)

Installation and execution

From the binary:

🧊Install the necessary repositories.

sudo apt update
sudo apt install make clang pkg-config libssl-dev build-essential

🧊 Create the application directory.

mkdir -p avail-light
cd avail-light

🧊 Download the application in the directory.

wget https://github.com/availproject/avail-light/releases/download/v1.7.5-rc2/avail-light-linux-amd64.tar.gz

🧊 Unzip the file.

tar -xvzf avail-light-linux-amd64.tar.gz
cp avail-light-linux-amd64 avail-light

🧊Start the light client.

./avail-light --network goldberg

It is highly recommended to continue running the light node with SystemD .

From the source code:

🧊Install the necessary repositories and Rust.

sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config protobuf-compiler libssl-dev jq build-essential protobuf-compiler bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustup default stable
rustup update
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

🧊After making sure you have Rust installed, you can run the Avail light client using the following command:

git clone https://github.com/availproject/avail-light.git
cd avail-light
git checkout v1.7.10
cargo build --release

The light client has been compiled.

Use SystemD services

SystemD is a service of daemons , tools and libraries designed to run applications, as background processes, centrally on Linux operating systems.

SystemD system services allow you to configure an application to perform automated processes, such as starting when the system boots, or restarting if the application stops for any reason.

In the case of blockchain nodes, these services are used to control the node application and restart it if it fails.

Create an availightd service

To create a service you must perform the following steps:

🧊Create a availightd.service file with service instructions.

sudo tee /etc/systemd/system/availightd.service > /dev/null <<EOF
[Unit]
Description=Avail Light Client
After=network.target
StartLimitIntervalSec=0
[Service]
User=root
ExecStart=$(which avail-light) --network goldberg
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target
EOF

🧊Manage the availightd service with the following service commands:

Enable automatic restart for your Avail node.

sudo systemctl daemon-reload
sudo systemctl enable availightd.service

Start up your Avail node.

sudo systemctl start availightd.service

🧊Check that the node is working.

The status parameter allows you to see the status information about the service. This command is essential to see if it is running or not.

sudo systemctl status availightd.service

To exit this screen use the keys:

CTRL + C

🧊Check service logs in real time.

The journalctl command allows you to view the log generated by the service.

sudo journalctl -f -u availightd

To exit this screen use the keys:

CTRL + C

If you need to restart the light client, use:

sudo systemctl restart availightd.service

To stop the light client use:

sudo systemctl stop availightd

🧊 For more information you can consult the official Avail documentation:

You can follow Avail at:

Web | Blog | Twitter

Follow Cumulo and join our community

Web | Twitter | Telegram | Discord | Medium | LinkedIn | cumulo.pro

--

--