Install and Configure 0G Data Availability (DA) Node
Overview
Section titled “Overview”The 0G Data Availability (DA) node is a critical component of the 0G stack, ensuring that data is accessible and verifiable across the network. This technical guide outlines the installation of the DA server from source on an Ubuntu-based system.
Prerequisites
Section titled “Prerequisites”Ensure your system is up to date and contains the necessary build tools and libraries for compiling Rust-based blockchain infrastructure.
System Updates and Dependencies
Section titled “System Updates and Dependencies”Install the required packages, including protobuf-compiler and SSL development libraries:
sudo apt-get updatesudo apt install make clang pkg-config libssl-dev build-essential curl protobuf-compiler -yInstall Rust Toolchain
Section titled “Install Rust Toolchain”The DA node requires the Rust compiler. Use the official installer and source the environment variables:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource $HOME/.cargo/envInstallation
Section titled “Installation”Compile the DA node binary and download the necessary cryptographic parameters for the zero-knowledge setup.
Build from Source
Section titled “Build from Source”cd $HOMEgit clone https://github.com/0glabs/0g-da-node.gitcd $HOME/0g-da-nodecargo build --releaseDownload Trusted Setup Parameters
Section titled “Download Trusted Setup Parameters”The DA node requires specific parameters to function. Execute the helper script to retrieve them:
./dev_support/download_params.shConfiguration
Section titled “Configuration”Initialize Configuration File
Section titled “Initialize Configuration File”Create your local configuration file from the provided template:
cp $HOME/0g-da-node/config_example.toml $HOME/0g-da-node/config.tomlBLS Key Generation
Section titled “BLS Key Generation”On the initial run, the DA node must register signer information with the DA contract. If you do not have an existing BLS private key, generate one using the built-in utility:
cargo run --bin key-genNote: Securely backup the output of the key generation. This key is required for signing data availability certificates.
Service Management
Section titled “Service Management”Create Systemd Service
Section titled “Create Systemd Service”To ensure the DA node runs as a persistent background process, create a systemd unit file:
sudo tee /etc/systemd/system/zgda.service > /dev/null <<EOF[Unit]Description=0G DA NodeAfter=network.target
[Service]User=$USERWorkingDirectory=$HOME/0g-da-nodeExecStart=$HOME/0g-da-node/target/release/server --config $HOME/0g-da-node/config.tomlRestart=on-failureRestartSec=10LimitNOFILE=65535
[Install]WantedBy=multi-user.targetEOFLaunch the DA Node
Section titled “Launch the DA Node”Enable and start the service:
sudo systemctl daemon-reloadsudo systemctl enable zgdasudo systemctl restart zgdaMonitoring
Section titled “Monitoring”Verify Node Logs
Section titled “Verify Node Logs”Monitor the DA node logs to ensure the server is processing requests and communicating with the 0G network:
sudo journalctl -u zgda -f -o catCommon Service Commands
Section titled “Common Service Commands”| Action | Command |
|---|---|
| Check Status | sudo systemctl status zgda |
| Stop Node | sudo systemctl stop zgda |
| View Recent Logs | journalctl -u zgda -n 100 |