Prerequisites
Before building the Avail node, ensure you have the following dependencies installed:Required Dependencies
Install Rust
Install Rust using rustup:The Avail node requires Rust version 1.82.0 as specified in
rust-toolchain.toml.Install Substrate Dependencies
Install the required system packages for building Substrate-based nodes:
Building the Node
Development Build
For testing and development (faster compilation, not optimized):Production Build
For production use (optimized, slower compilation):The
--locked flag ensures that dependencies match the versions in Cargo.lock, providing reproducible builds. The build process may take 20-40 minutes depending on your hardware.- Development:
./target/debug/avail-node - Release:
./target/release/avail-node
Running the Node
Create Data Directory
Before starting the node, create a directory to store blockchain data:Launch the Node
- Mainnet
- Turing Testnet
- Development
Connect to the Avail Mainnet:Or using the compiled binary:
Common Launch Options
Customize your node startup with these common flags:Node Startup Output
When successfully started, you’ll see output similar to:Hardware benchmarks are automatically run at startup unless you disable them with
--no-hardware-benchmarks.Data Directory Structure
The data directory (-d flag) contains:
chains/- Blockchain data for each network[chain-name]/db/- Block database (ParityDB)[chain-name]/keystore/- Local key storage[chain-name]/network/- Peer-to-peer network data
Running as a Background Service
Using systemd
Create a systemd service file at/etc/systemd/system/avail-node.service:
Troubleshooting
Build Errors
Rust version mismatch
Rust version mismatch
Ensure you’re using Rust 1.82.0:The project’s
rust-toolchain.toml should automatically select the correct version.Missing dependencies
Missing dependencies
Reinstall system dependencies and ensure
protoc is available:Out of memory during compilation
Out of memory during compilation
Reduce parallel compilation jobs:
Runtime Issues
Next Steps
- Learn about Configuration Options to customize your node
- Explore Network Configurations for different network options
- Set up monitoring with Prometheus metrics on port 9615