0G DA Node

DA Nodes are similar to Storage Nodes but focus on immediacy and short-term accessibility to support real-time operations.

Resources

Prerequisite

To operate effectively, your DA signer needs to run a DA node to verify encoded blob data, sign it, and store it for future farming and rewards. Currently, to run a DA Node on Testnet, users must stake 10 OG tokens. These can be obtained through our faucet or via rewards from running Storage Nodes or Validator Nodes. For official deployed contract addresses, visit this page.

Hardware requirements

CPU

8 cores

RAM

16 GB

Storage

1 TB NVME

Network

100 MBps

OS

Linux (Ubuntu 22.04 x64)

Installation πŸ’Ύ

Install dependencies

sudo apt-get update && sudo apt-get install clang cmake build-essential pkg-config libssl-dev protobuf-compiler llvm llvm-dev

Install GO

cd $HOME && \
ver="1.23.3" && \
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

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustc --version

Build binary from source

git clone -b v1.1.3 https://github.com/0glabs/0g-da-node.git

cd $HOME/0g-da-node
git stash
git fetch --all --tags
git checkout 9845b8b
git submodule update --init
cargo build --release

./dev_support/download_params.sh

Generate BLS private key, if you don't have one. It will register the signer information in DA contract when you first run DA node

You must back up your BLS key.

cargo run --bin key-gen

Edit the configuration file (replace your <public_ip/dns>, signer_bls_private_key, signer_eth_private_key, miner_eth_private_key)

nano $HOME/0g-da-node/config.toml
log_level = "info"

data_path = "./db/"

# path to downloaded params folder
encoder_params_dir = "params/" 

# grpc server listen address
grpc_listen_address = "0.0.0.0:34000"
# chain eth rpc endpoint
eth_rpc_endpoint = "https://evmrpc-testnet.0g.ai"
# public grpc service socket address to register in DA contract
# ip:34000 (keep same port as the grpc listen address)
# or if you have dns, fill your dns
socket_address = "<public_ip/dns>:34000"

# data availability contract to interact with
da_entrance_address = "0xE75A073dA5bb7b0eC622170Fd268f35E675a957B"
# deployed block number of da entrance contract
start_block_number = 326165

# signer BLS private key
signer_bls_private_key = ""
# signer eth account private key
signer_eth_private_key = ""
# miner eth account private key, (could be the same as 'signer_eth_private_key', but not recommended)
miner_eth_private_key = ""

# whether to enable data availability sampling
enable_das = "true"

Create a service file

sudo tee /etc/systemd/system/0gda.service > /dev/null <<EOF
[Unit]
Description=0G-DA Node
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/0g-da-node
ExecStart=$HOME/0g-da-node/target/release/server --config $HOME/0g-da-node/config.toml
Restart=always
RestartSec=10
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Start the node

sudo systemctl daemon-reload
sudo systemctl enable 0gda
sudo systemctl start 0gda

Useful commands βš™οΈ

Stop the node

sudo systemctl stop zgs

Check logs

sudo journalctl -u 0gda -f -o cat

Delete node πŸ—‘οΈ

sudo systemctl stop 0gda
sudo systemctl disable 0gda
sudo rm /etc/systemd/system/0gda.service
rm -rf $HOME/0g-da-node

Last updated