0_AxKIus_I-soNSp03.jpg

Introduction

This guide is a direct continuation of the previous guide for the 0G_LABS project. If you haven't read about how to install the validator node of the 0G project yet, then just go here:

🔺 0G LABS install and setup guide

Guide

Hardware Requirement

RAM 16 GB
CPU 4 cores
DISK 1 TB NVME SSD
BANDWIDTH 500 MBps

Install Dependencies

sudo apt-get update
sudo apt-get install clang cmake build-essential

Install Go

# Download Go
wget <https://go.dev/dl/go1.22.0.linux-amd64.tar.gz>

# Install Go
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

Install Rust

curl --proto '=https' --tlsv1.2 -sSf <https://sh.rustup.rs> | sh

Download and Build Source Code

git clone -b v0.3.3 <https://github.com/0glabs/0g-storage-node.git>
cd 0g-storage-node
git submodule update --init
cargo build --release

Configure run/config.toml

# Update the configuration file as follows:

# Public IP for peer discovery
network_enr_address

# Boot nodes (update with your IPs if necessary)
network_boot_nodes = ["/ip4/54.219.26.22/udp/1234/p2p/16Uiu2HAmTVDGNhkHD98zDnJxQWu3i1FL1aFYeh9wiQTNu4pDCgps","/ip4/52.52.127.117/udp/1234/p2p/16Uiu2HAkzRjxK2gorngB1Xq84qDrT4hSVznYDHj6BkbaE4SGx9oS","/ip4/18.167.69.68/udp/1234/p2p/16Uiu2HAm2k6ua2mGgvZ8rTMV8GhpW71aVzkQWy7D37TTDuLCpgmX"]

# Contract addresses
log_contract_address
mine_contract_address

# RPC endpoint for blockchain
blockchain_rpc_endpoint

# Starting block number for synchronization
log_sync_start_block_number

# Private key (64 characters, no leading 0x)
miner_key

# Maximum number of chunks for database
db_max_num_chunks

Start Storage

cd run
../target/release/zgs_node --config config-testnet.toml --miner-key <your_private_key> --blockchain-rpc-endpoint <blockchain_rpc> --db-max-num-chunks <max_chunk_num>