Installation - V3
This guide helps you set up a Storage Node for OG Labs.
For the official documentation, please refer to the relevant repositories.
🧰 Requirements
Section titled “🧰 Requirements”- Memory: 16 GB RAM
- CPU: 4 Cores
- Disk: 500GB / 1TB NVME SSD
- Bandwidth: 100 Mbps (Download / Upload)
⚙️ Quick Update (One-Click)
Section titled “⚙️ Quick Update (One-Click)”Version:
v1.0.0
bash <(wget -qO- https://cdn.bangcode.id/0g/bangcode_0g_storage_tools.sh)
🛠 Manual Installation
Section titled “🛠 Manual Installation”Step 1: Install Required Packages
Section titled “Step 1: Install Required Packages”sudo apt-get updatesudo apt-get install clang cmake build-essential openssl pkg-config libssl-dev
Step 2: Install Go
Section titled “Step 2: Install Go”cd $HOMEver="1.22.0"wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"sudo rm -rf /usr/local/gosudo 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_profilesource ~/.bash_profilego version
Step 3: Install Rust
Section titled “Step 3: Install Rust”curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. "$HOME/.cargo/env"
Step 4: Clone and Build 0G Storage Node
Section titled “Step 4: Clone and Build 0G Storage Node”git clone -b v1.0.0 https://github.com/0glabs/0g-storage-node.gitcd $HOME/0g-storage-nodegit stashgit fetch --all --tagsgit checkout tags/v1.0.0 -b v1.0.0git submodule update --initcargo build --release
⚙️ Configure the Node
Section titled “⚙️ Configure the Node”rm -rf $HOME/0g-storage-node/run/config.tomlcurl -o $HOME/0g-storage-node/run/config.toml https://cdn.bangcode.id/0g/v3_config.tomlnano $HOME/0g-storage-node/run/config.toml
Set your
miner_key
(private key) inside the config file.
🧩 Create a Systemd Service
Section titled “🧩 Create a Systemd Service”sudo tee /etc/systemd/system/zgs.service > /dev/null <<EOF[Unit]Description=ZGS NodeAfter=network.target
[Service]User=$USERWorkingDirectory=$HOME/0g-storage-node/runExecStart=$HOME/0g-storage-node/target/release/zgs_node --config $HOME/0g-storage-node/run/config.tomlRestart=on-failureRestartSec=10LimitNOFILE=65535
[Install]WantedBy=multi-user.targetEOF
Enable and Start the Service
Section titled “Enable and Start the Service”sudo systemctl daemon-reloadsudo systemctl enable zgssudo systemctl start zgs
🛠 Useful Commands
Section titled “🛠 Useful Commands”Check Logs
Section titled “Check Logs”tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
Check Blocks & Peers
Section titled “Check Blocks & Peers”source <(curl -s https://cdn.bangcode.id/0g/block_checker.sh)
❌ Stop and Delete Node
Section titled “❌ Stop and Delete Node”Stop the Node
Section titled “Stop the Node”sudo systemctl stop zgs
Remove Node
Section titled “Remove Node”sudo systemctl disable zgssudo rm /etc/systemd/system/zgs.servicerm -rf $HOME/0g-storage-node