Install and Configure 0G DA Client
Overview
Section titled “Overview”The 0G DA Client serves as the interface for interacting with the Data Availability layer. It includes the disperser service, which is responsible for encoding data and submitting it to the 0G network.
Prerequisites
Section titled “Prerequisites”Before installation, ensure your system has the necessary build tools and a supported version of the Go programming language.
System Dependencies
Section titled “System Dependencies”Update the package index and install required utilities:
sudo apt-get updatesudo apt-get install cmake screen -yInstall Go Toolchain
Section titled “Install Go Toolchain”The DA Client requires Go 1.22.0 or higher. Use the following commands to install or update your Go environment:
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gzsudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gzexport PATH=$PATH:/usr/local/go/binecho 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrcInstallation
Section titled “Installation”Clone the repository and build the client binaries from source.
cd $HOMEgit clone -b v1.0.0-testnet https://github.com/0glabs/0g-da-client.gitcd $HOME/0g-da-clientmake buildConfiguration
Section titled “Configuration”The DA Client’s behavior is controlled via the Makefile located in the disperser directory. You must configure your RPC endpoints and private keys here.
Edit Disperser Settings
Section titled “Edit Disperser Settings”Open the Makefile for editing:
nano $HOME/0g-da-client/disperser/MakefileWithin the run_combined section, locate and update the following flags with your specific infrastructure details:
| Flag | Description |
|---|---|
--chain.rpc | Your 0G Chain RPC endpoint |
--chain.private-key | The private key for the account paying gas fees |
--combined-server.storage.flow-contract | The address of the Flow contract |
Service Management
Section titled “Service Management”Creating a systemd service ensures the DA Client remains active and recovers automatically from crashes.
Create Systemd Service
Section titled “Create Systemd Service”sudo tee /etc/systemd/system/0gdacli.service > /dev/null <<EOF[Unit]Description=0G DA Client NodeAfter=network.target
[Service]User=rootWorkingDirectory=$HOME/0g-da-client/disperserExecStart=/usr/local/go/bin/go run combined_server.go --config config.tomlRestart=alwaysRestartSec=10LimitNOFILE=65535Environment="PATH=/usr/local/go/bin:/usr/bin:/bin"
[Install]WantedBy=multi-user.targetEOFNote: While the original instructions used
make run_combined, it is considered a best practice in production to pointExecStartdirectly to the binary or the specific Go entry point to avoid overhead.
Launch the Client
Section titled “Launch the Client”Reload the systemd daemon and enable the service:
sudo systemctl daemon-reloadsudo systemctl enable 0gdaclisudo systemctl start 0gdacliMonitoring and Maintenance
Section titled “Monitoring and Maintenance”Verify Logs
Section titled “Verify Logs”Monitor the client’s output to ensure it is successfully dispersing data to the DA nodes:
sudo journalctl -u 0gdacli -f -o catOperational Commands
Section titled “Operational Commands”| Action | Command |
|---|---|
| Check Status | sudo systemctl status 0gdacli |
| Restart Client | sudo systemctl restart 0gdacli |
| Stop Client | sudo systemctl stop 0gdacli |