ZeroGravity: DA client setup guide

ZeroGravity  guide  installation 

Official ZeroGravity installation docs could be found here

This guide describes the installation method, slightly different from the official one. This creates a copy of the executable file and creates a separate directory for the configuration. The project repository and the running node are independent of each other. You can test builds of new versions without fear of breaking the working one.


network chain_id DA client version DA client commit
testnet zgtendermint_16600-2 v1.0.1* ee789946f099147fdec93c88533a1be140bd29d6

Hardware Requirements

  • RAM: 8 GB
  • CPU: 2 cores
  • Bandwidth: 100 MBps for Download / Upload

We use OS Ubuntu, version 22.04 and higher


Environment preparation


Package installation


sudo apt-get update
sudo apt-get install make cmake jq -y

Go installation


Download the Go installer

wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz

Extract the archive

sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz

Add /usr/local/go/bin to the PATH environment variable by adding the following line to your profile

echo export PATH='$PATH':/usr/local/go/bin >> $HOME/.bash_profile
source $HOME/.bash_profile

Build binary from sources


Create directory for used binary add it to PATH

mkdir $HOME/bin
echo export PATH='$PATH':$HOME/bin >> $HOME/.bash_profile
source $HOME/.bash_profile

Clone OG repo and build

cd ~
git clone https://github.com/0glabs/0g-da-client.git
cd 0g-da-client
git fetch --all --tags
git checkout ee78994 
git submodule update --init
make build

Copy binary to ~/bin:

cp $HOME/0g-da-client/disperser/bin/combined $HOME/bin/

Configuration & Run


Create working directory for DA client:

mkdir $HOME/.zgda_cli

Create run script with config:

$HOME/.zgda_cli/run_zgda_cli.sh

Set parameters (is related to the installation of DA node)

L1_EVM_RPC_ENDPOINT=<your-evm-rpc-consensus-node-enpoint>
YOUR_PRIVATE_KEY=<your-da-node-signer-key>
DA_ENCODER_SERVER=<your-DA-node-endpoint-deafult: http://127.0.0.1:34000>
DA_CLI_HOME=$HOME/.zgda_cli/
DA_CLI_LOG=$HOME/.zgda_cli/run.log

Get contract address from official page https://docs.0g.ai/0g-doc/docs/contract-addresses

ENTRANCE_CONTRACT_ADDR=0x857C0A28A8634614BB2C96039Cf4a20AFF709Aa9
tee $HOME/.zgda_cli/run_zgda_cli.sh > /dev/null <<EOF
#!/bin/bash
$(which combined) \\
    --chain.rpc ${L1_EVM_RPC_ENDPOINT} \\
    --chain.private-key ${YOUR_PRIVATE_KEY} \\
    --chain.receipt-wait-rounds 180 \\
    --chain.receipt-wait-interval 1s \\
    --chain.gas-limit 2000000 \\
    --combined-server.use-memory-db \\
    --combined-server.storage.kv-db-path ${DA_CLI_HOME} \\
    --combined-server.storage.time-to-expire 2592000 \\
    --disperser-server.grpc-port 51001 \\
    --batcher.da-entrance-contract ${ENTRANCE_CONTRACT_ADDR} \\
    --batcher.da-signers-contract 0x0000000000000000000000000000000000001000 \\
    --batcher.finalizer-interval 20s \\
    --batcher.confirmer-num 3 \\
    --batcher.max-num-retries-for-sign 3 \\
    --batcher.finalized-block-count 50 \\
    --batcher.batch-size-limit 500 \\
    --batcher.encoding-interval 3s \\
    --batcher.encoding-request-queue-size 1 \\
    --batcher.pull-interval 10s \\
    --batcher.signing-interval 3s \\
    --batcher.signed-pull-interval 20s \\
    --encoder-socket ${DA_ENCODER_SERVER} \\
    --encoding-timeout 300s \\
    --signing-timeout 60s \\
    --chain-read-timeout 12s \\
    --chain-write-timeout 13s \\
    --combined-server.log.level-file trace \\
    --combined-server.log.level-std trace \\
    --combined-server.log.path ${DA_CLI_LOG}
EOF

Allow script execution:

chmod +x $HOME/.zgda_cli/run_zgda_cli.sh

You can run node (for test purpose) in terminal with command:

$HOME/.zgda_cli/run_zgda_cli.sh

Run node as service


Create service file:

tee $HOME/zgda_cli.service > /dev/null <<EOF
[Unit]
Description=0G-DA Client
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/.zgda_cli
ExecStart=$HOME/.zgda_cli/run_zgda_cli.sh
Restart=always
RestartSec=10
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Init daemon with simlink:

sudo ln -s $HOME/zgda_cli.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable zgda_cli

Run node and check daemon status:

sudo systemctl start zgda_cli
sudo systemctl status zgda_cli

Checking


See logs:

journalctl -u zgda_cli -o cat -f
tail $HOME/.zgda_cli/run.log  -f

Best regards and Good luck with your installation!❤️👍

Pro-Nodes75 team📡🗻