Overview
This guide covers building the Avail Node from source. Building from source gives you access to the latest features and allows you to customize the build for your specific needs.System requirements
Before installing, ensure your system meets these requirements:Hardware requirements
- CPU: 4+ cores (8+ recommended for validators)
- RAM: 8GB minimum (16GB+ recommended)
- Storage: 200GB+ SSD (NVMe recommended for validators)
- Network: Stable broadband connection (100Mbps+ for validators)
Supported operating systems
- Ubuntu 20.04 LTS or newer
- Debian 11 or newer
- Fedora 35 or newer
- macOS 11 (Big Sur) or newer
- Other Linux distributions with equivalent package versions
Rust installation
Avail Node requires Rust version 1.82.0 as specified inrust-toolchain.toml.
Install Rust toolchain
Download and install Rust using rustup:Follow the prompts to complete installation. When asked, choose the default installation.
Configure your shell
Add Rust to your system PATH:Add this line to your shell profile (
~/.bashrc, ~/.zshrc, etc.) to make it permanent:Substrate dependencies
Avail is built with Substrate, which requires additional system dependencies.Ubuntu / Debian
Fedora / RHEL / CentOS
macOS
Building Avail Node
Now you’re ready to build the Avail Node from source.Build the release binary
Build the optimized release binary:The
The first build typically takes 20-30 minutes depending on your hardware. Subsequent builds will be much faster.
--locked flag ensures dependencies match Cargo.lock exactly, and --release enables optimizations.Installing the binary
Optionally, install the binary to your system path:avail-node from anywhere:
Understanding the build process
The Avail workspace consists of multiple components defined inCargo.toml:
- base - Core Avail types and utilities
- runtime - Blockchain runtime logic
- node - Node implementation (produces the
avail-nodebinary) - pallets/ - Custom pallets:
dactr- Data availability controlmandate- Governance mandatessystem- Custom frame-system forkvector- Vector commitment functionality
- client/basic-authorship - Custom block authorship
- rpc/ - RPC implementations including Kate RPC
- patricia-merkle-trie - Merkle trie implementation
Build optimizations
The workspaceCargo.toml includes optimizations for cryptographic operations even in dev builds:
Advanced build options
Build with specific features
Build only what you need:Cross-compilation
Build for different architectures:Environment variables
Control build behavior with these environment variables:| Variable | Description | Default |
|---|---|---|
WASM_BUILD_TYPE | WebAssembly build type | release |
SKIP_WASM_BUILD | Skip WASM runtime build | false |
CARGO_PROFILE_RELEASE_LTO | Enable link-time optimization | Disabled |
Verifying dependencies
The project uses specific versions of key dependencies:- Polkadot SDK: v1.7.1-patch-13 (forked version)
- Avail Core: core-node-12 tag
- Rust: 1.82.0 (enforced by
rust-toolchain.toml)
- Reads
rust-toolchain.toml - Installs Rust 1.82.0 if needed
- Installs required components:
rustfmt,clippy,rust-src - Adds WASM target:
wasm32-unknown-unknown
Building with Docker
If you prefer containerized builds, use the provided Dockerfile:- Builder stage: Debian 12.12-slim with full build toolchain
- Runtime stage: Minimal Debian image with only the binary
Development build
For development, use a debug build which compiles much faster:Debug builds run 10-100x slower than release builds. Only use for rapid development iteration.
Building specific packages
Build individual workspace members:Running tests
Verify your build with the test suite:Benchmarking
The project includes comprehensive benchmarking tools:Runtime benchmarks
Instruction-level analysis
iai and iai-callgrind for detailed performance profiling including cache hits and instruction counts.
Troubleshooting
Build fails with linker errors
Ensure all system dependencies are installed:WASM build fails
Add the WASM target explicitly:Out of memory during build
Reduce parallel compilation:Protobuf compiler not found
Install the protobuf compiler:Keeping your installation updated
Update to the latest version:Next steps
Quick start
Run your newly built node
Configuration
Learn about node configuration options
Validator setup
Configure your node as a validator
CLI reference
Complete command-line reference
Additional resources
- Substrate Documentation - Detailed Substrate dependency guide
- Rust Installation - Official Rust installation guide
- Avail Wiki - Advanced topics and build configurations