Skip to content

Installation

0G banner”

Hardware Requirement
1. Install dependencies
Terminal window
sudo apt-get update
sudo apt-get install cmake
2. Install go
Terminal window
cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version
3. Download the source code
Terminal window
git clone -b v1.0.0-testnet https://github.com/0glabs/0g-da-client.git
4. Build combined server
Terminal window
cd $HOME/0g-da-client
git stash
git fetch --all --tags
git checkout f8db250
git submodule update --init
Configuration
Terminal window
nano /root/0g-da-client/disperser/Makefile

Replace your info at run_combined function:

--chain.rpc http://YOUR_RPC

--chain.private-key YOUR_PRIVATE_KEY

--encoder-socket YOUR_DA_NODE_IP:34000

Sample Makefile:

Terminal window
run_combined: build_combined
./bin/combined \
--chain.rpc http://YOUR_RPC \
--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 /runtime/ \
--combined-server.storage.time-to-expire 2592000 \
--disperser-server.grpc-port 51001 \
--batcher.da-entrance-contract 0x857C0A28A8634614BB2C96039Cf4a20AFF709Aa9 \
--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 \
--batcher.expiration-poll-interval 3600 \
--encoder-socket YOUR_DA_NODE_IP:34000 \
--encoding-timeout 600s \
--signing-timeout 600s \
--chain-read-timeout 12s \
--chain-write-timeout 13s \
--combined-server.log.level-file trace \
--combined-server.log.level-std trace \
--combined-server.log.path ./../run/run.log
5. Creat service
Terminal window
sudo tee /etc/systemd/system/0gdacli.service > /dev/null <<EOF
[Unit]
Description=0G-DA-ClI Node
After=network.target
[Service]
User=root
WorkingDirectory=/root/0g-da-client/disperser
ExecStart=/usr/bin/make run_combined
Restart=always
RestartSec=10
LimitNOFILE=65535
Environment="PATH=/usr/local/go/bin:/usr/bin:/bin"
[Install]
WantedBy=multi-user.target
EOF
6. Start service
Terminal window
sudo systemctl daemon-reload && \
sudo systemctl enable 0gdacli && \
sudo systemctl start 0gdacli && \
sudo systemctl status 0gdacli

Check log:

Terminal window
sudo journalctl -u 0gdacli -f -o cat
# Stop Service and Delete node:
Terminal window
sudo systemctl stop 0gdacli
sudo systemctl disable 0gdacli
sudo rm /etc/systemd/system/0gdacli.service
rm -rf $HOME/0g-da-client