Installation - V2
This guide will help you set up a Storage Node for OG Labs. For official documentation, check here.
Requirements
Section titled “Requirements”- Memory: 16 GB RAM
- CPU: 4 Cores
- Disk: 500GB / 1TB NVME SSD
- Bandwidth: 100 Mbps (Download / Upload)
🚀 One Click Command Install
Section titled “🚀 One Click Command Install”One Click Install Standard Config :
bash <(wget -qO- https://cdn.bangcode.id/0g/easy_install_zgs_standard.sh)One Click Install Turbo Config :
bash <(wget -qO- https://cdn.bangcode.id/0g/easy_install_zgs_standard.sh)🔄 One Click Command Update
Section titled “🔄 One Click Command Update”Version: v0.8.7
bash <(wget -qO- https://cdn.bangcode.id/0g/storage_node_update.sh)🛠 Manual Install
Section titled “🛠 Manual Install”Install Necessary Packages
Section titled “Install Necessary Packages”sudo apt update && sudo apt upgrade -ysudo apt install curl git wget htop tmux build-essential jq make gcc tar clang pkg-config libssl-dev ncdu cmake -yInstall Golang
Section titled “Install Golang”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 versionInstall Rust
Section titled “Install Rust”curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsh. "$HOME/.cargo/env"Download and Install 0G Storage Node [GITHUB]
Section titled “Download and Install 0G Storage Node [GITHUB]”git clone -b v0.8.6 https://github.com/0glabs/0g-storage-node.gitcd $HOME/0g-storage-nodegit stashgit fetch --all --tagsgit checkout v0.8.7git submodule update --initcargo build --release⚙️ Set Configuration
Section titled “⚙️ Set Configuration”Standard Config / Turbo Config
Section titled “Standard Config / Turbo Config”rm -rf $HOME/0g-storage-node/run/config.tomlcurl -o $HOME/0g-storage-node/run/config.toml https://cdn.bangcode.id/0g/standar_config.tomlrm -rf $HOME/0g-storage-node/run/config-testnet-turbo.tomlcurl -o $HOME/0g-storage-node/run/config-testnet-turbo.toml https://cdn.bangcode.id/0g/turbo_config.tomlEdit config and input your private key in miner_key:
nano $HOME/0g-storage-node/run/config.tomlnano $HOME/0g-storage-node/run/config-testnet-turbo.toml🧱 Create Systemd Service
Section titled “🧱 Create 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.targetEOFsudo 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-testnet-turbo.tomlRestart=on-failureRestartSec=10LimitNOFILE=65535
[Install]WantedBy=multi-user.targetEOFStart Service
Section titled “Start Service”sudo systemctl daemon-reload && sudo systemctl enable zgs && sudo systemctl start zgs🧪 Useful Commands
Section titled “🧪 Useful Commands”Check Full Logs
Section titled “Check Full Logs”tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)Check Blocks and Peers
Section titled “Check Blocks and Peers”source <(curl -s https://cdn.bangcode.id/0g/block_checker.sh)🧹 Stop and Delete Node
Section titled “🧹 Stop and Delete Node”sudo systemctl stop zgsDelete
Section titled “Delete”sudo systemctl disable zgssudo rm /etc/systemd/system/zgs.servicerm -rf $HOME/0g-storage-node