0G Labs Testnet Logo

0G Labs Testnet

0G Labs is a modular AI blockchain project that combines Layer 1 (L1) blockchain technology with decentralized artificial intelligence capabilities.

0G Galileo Validator Testnet Node Setup

This guide will help you install a 0G Galileo Validator node using a combination of the best practices from the official tutorial and community enhancements.

Note

You can currently operate your node as an RPC (Remote Procedure Call) to support the network and maintain synchronization with the blockchain.

The ability to create a validator is now available. You'll find comprehensive instructions for setting up your validator on staking interfaces page.

Requirements

  • CPU: 8 Cores
  • Memory: 64GB RAM
  • Disk: 1 TB of storage (NVME)
  • Bandwidth: 100 Mbps (Download / Upload)

💡 Need a reliable VPS to run this node?

We recommend Netcup — high performance and affordable.
Use this voucher to get a discount:

36nc17534486780 36nc17542471151 36nc17542471150

Get €5 Discount

Just a heads up: This is an affiliate link (no extra cost to you). Any support we get through it goes straight back into building free public infra — RPCs, APIs, snapshots, and more to support the community.

Update

Click here to see how to update to v2.0.4

Stop service

systemctl stop 0gchaind
systemctl stop geth

Download & Extract Binary

wget https://github.com/0glabs/0gchain-NG/releases/download/v2.0.4/galileo-v2.0.4.tar.gz
tar -xvzf galileo-v2.0.4.tar.gz
cd $HOME/galileo-v2.0.4/bin

Give permission

chmod +x 0gchaind
chmod +x geth

Copy to /usr/local/bin/. Adjust if you are using a different path directory.

cp 0gchaind /usr/local/bin/0gchaind
cp geth /usr/local/bin/geth

Restart service

sudo systemctl daemon-reload
sudo systemctl restart 0gchaind
sudo systemctl restart geth

Manual Install

Version v2.0.4

1. Install Dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

2. Install Go

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. Set Environment Variables

Configuration

Generated Command

echo 'export MONIKER="ExampleMoniker"' >> $HOME/.bash_profile
echo 'export OG_PORT="55"' >> $HOME/.bash_profile
echo 'export PATH=$PATH:$HOME/galileo/bin' >> $HOME/.bash_profile
source $HOME/.bash_profile

4. Download and Extract Galileo

cd $HOME
rm -rf galileo
wget https://github.com/0glabs/0gchain-NG/releases/download/v2.0.4/galileo-v2.0.4.tar.gz
tar -xvzf galileo-v2.0.4.tar.gz
mv $HOME/galileo-v2.0.4 $HOME/galileo
rm galileo-v2.0.4.tar.gz
chmod +x $HOME/galileo/bin/geth
chmod +x $HOME/galileo/bin/0gchaind

Move binaries to /usr/local/bin for global access

sudo cp $HOME/galileo/bin/geth /usr/local/bin/geth
sudo cp $HOME/galileo/bin/0gchaind /usr/local/bin/0gchaind

5. Initialize the Chain

mkdir -p $HOME/.0gchaind
cp -r $HOME/galileo $HOME/.0gchaind/
 
geth init --datadir $HOME/.0gchaind/galileo/0g-home/geth-home $HOME/.0gchaind/galileo/genesis.json
 
0gchaind init $MONIKER --home $HOME/.0gchaind/tmp
cp $HOME/.0gchaind/tmp/data/priv_validator_state.json $HOME/.0gchaind/galileo/0g-home/0gchaind-home/data/
cp $HOME/.0gchaind/tmp/config/node_key.json $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/
cp $HOME/.0gchaind/tmp/config/priv_validator_key.json $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/

6. Configure Node

Set Node Moniker

sed -i -e "s/^moniker *=.*/moniker = \"$MONIKER\"/" $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/config.toml

🧠 Note: This is your node moniker, not the validator moniker.
You will set your validator moniker later when you create a validator.

Update geth-config.toml Ports

sed -i "s/HTTPPort = .*/HTTPPort = ${OG_PORT}545/" $HOME/.0gchaind/galileo/geth-config.toml
sed -i "s/WSPort = .*/WSPort = ${OG_PORT}546/" $HOME/.0gchaind/galileo/geth-config.toml
sed -i "s/AuthPort = .*/AuthPort = ${OG_PORT}551/" $HOME/.0gchaind/galileo/geth-config.toml
sed -i "s/ListenAddr = .*/ListenAddr = \":${OG_PORT}303\"/" $HOME/.0gchaind/galileo/geth-config.toml
sed -i "s/^# *Port = .*/# Port = ${OG_PORT}901/" $HOME/.0gchaind/galileo/geth-config.toml
sed -i "s/^# *InfluxDBEndpoint = .*/# InfluxDBEndpoint = \"http:\/\/localhost:${OG_PORT}086\"/" $HOME/.0gchaind/galileo/geth-config.toml

Update config.toml and app.toml for 0gchaind

# config.toml
CONFIG="$HOME/.0gchaind/galileo/0g-home/0gchaind-home/config"
 
sed -i "s/laddr = \"tcp:\/\/0\.0\.0\.0:26656\"/laddr = \"tcp:\/\/0\.0\.0\.0:${OG_PORT}656\"/" $CONFIG/config.toml
sed -i "s/laddr = \"tcp:\/\/127\.0\.0\.1:26657\"/laddr = \"tcp:\/\/127\.0\.0\.1:${OG_PORT}657\"/" $CONFIG/config.toml
sed -i "s/^proxy_app = .*/proxy_app = \"tcp:\/\/127\.0\.0\.1:${OG_PORT}658\"/" $CONFIG/config.toml
sed -i "s/^pprof_laddr = .*/pprof_laddr = \"0.0.0.0:${OG_PORT}060\"/" $CONFIG/config.toml
sed -i "s/prometheus_listen_addr = \".*\"/prometheus_listen_addr = \"0.0.0.0:${OG_PORT}660\"/" $CONFIG/config.toml
 
# app.toml
sed -i "s/address = \".*:3500\"/address = \"127.0.0.1:${OG_PORT}500\"/" $CONFIG/app.toml
sed -i "s/^rpc-dial-url *=.*/rpc-dial-url = \"http:\/\/localhost:${OG_PORT}551\"/" $CONFIG/app.toml

Disable Indexer

sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $CONFIG/config.toml

Configure custom pruning

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.0gchaind/galileo/0g-home/0gchaind-home/config/app.toml

Configure JSON-RPC Host (Geth / EVM Layer of 0G)

🔐 Security Note:

Only use 0.0.0.0 if you protect the RPC with a firewall or expose it intentionally. If using a reverse proxy like Nginx, it's safer and more efficient to keep the RPC bound to 127.0.0.1.

JSON-RPC Host (Geth / EVM Layer of 0G)

This step allows you to configure the JSON-RPC host for the Ethereum-compatible layer of your 0G node.

sed -i 's/HTTPHost = .*/HTTPHost = "127.0.0.1"/' $HOME/.0gchaind/galileo/geth-config.toml

This setting only applies to the EVM (Geth) layer of 0G.

  • 127.0.0.1: accessible locally only
  • 0.0.0.0: open to external connections

Cosmos RPC (Tendermint Layer)

This step sets the Tendermint RPC address for the Cosmos-based layer of your 0G node.

CONFIG="$HOME/.0gchaind/galileo/0g-home/0gchaind-home/config"
sed -i "s|laddr = \"tcp://127.0.0.1:${OG_PORT}657\"|laddr = \"tcp://127.0.0.1:${OG_PORT}657\"|" $CONFIG/config.toml

⚠️ Important: Use 0.0.0.0 only if the port is firewalled or routed through a trusted proxy. In most setups, 127.0.0.1 is preferred for local-only access.


7. Configure Systemd Services

Setup 0gchaind.service

sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0gchaind Node Service
After=network-online.target
 
[Service]
User=$USER
Environment=CHAIN_SPEC=devnet
WorkingDirectory=$HOME/.0gchaind/galileo
ExecStart=/usr/local/bin/0gchaind start \
  --chaincfg.chain-spec devnet \
  --home $HOME/.0gchaind/galileo/0g-home/0gchaind-home \
  --chaincfg.kzg.trusted-setup-path=$HOME/.0gchaind/galileo/kzg-trusted-setup.json \
  --chaincfg.engine.jwt-secret-path=$HOME/.0gchaind/galileo/jwt-secret.hex \
  --chaincfg.kzg.implementation=crate-crypto/go-kzg-4844 \
  --chaincfg.engine.rpc-dial-url=http://localhost:${OG_PORT}551 \
  --chaincfg.restaking.enabled \
  --chaincfg.restaking.symbiotic-rpc-dial-url https://ethereum-holesky-rpc.publicnode.com \
  --chaincfg.restaking.symbiotic-get-logs-block-range 256 \
  --home=$HOME/.0gchaind/galileo/0g-home/0gchaind-home \
  --p2p.seeds 85a9b9a1b7fa0969704db2bc37f7c100855a75d9@8.218.88.60:26656 \
  --p2p.external_address=$(curl -4 -s ifconfig.me):${OG_PORT}656
Restart=always
RestartSec=3
LimitNOFILE=65535
 
[Install]
WantedBy=multi-user.target
EOF

Note:

  • Adjust --chaincfg.restaking.symbiotic-rpc-dial-url to your preferred Ethereum RPC provider.
  • Set --chaincfg.restaking.symbiotic-get-logs-block-range based on your RPC’s performance and limitations (default: 1, meaning 1 block per request). Higher values may speed up syncing but can cause failures if your RPC cannot handle larger ranges.

Setup geth.service

sudo tee /etc/systemd/system/geth.service > /dev/null <<EOF
[Unit]
Description=0g Geth Node Service
After=network-online.target
 
[Service]
User=$USER
WorkingDirectory=$HOME/.0gchaind/galileo
ExecStart=/usr/local/bin/geth \
  --config $HOME/.0gchaind/galileo/geth-config.toml \
  --datadir $HOME/.0gchaind/galileo/0g-home/geth-home \
  --http.port ${OG_PORT}545 \
  --ws.port ${OG_PORT}546 \
  --authrpc.port ${OG_PORT}551 \
  --bootnodes enode://de7b86d8ac452b1413983049c20eafa2ea0851a3219c2cc12649b971c1677bd83fe24c5331e078471e52a94d95e8cde84cb9d866574fec957124e57ac6056699@8.218.88.60:30303 \
  --port ${OG_PORT}303 \
  --networkid 16601
Restart=always
RestartSec=3
LimitNOFILE=65535
 
[Install]
WantedBy=multi-user.target
EOF

8. Start the Service

sudo systemctl daemon-reload
sudo systemctl enable 0gchaind
sudo systemctl enable geth
sudo systemctl start 0gchaind
sudo systemctl start geth

9. Verify Installation

journalctl -u 0gchaind -u geth -f

Useful Commands

Check logs

journalctl -u 0gchaind -u geth -f

Check Blocks

source <(curl -s https://raw.githubusercontent.com/astrostake/0G-Labs-script/refs/heads/main/validator/check_block_validator.sh)

Check node status

curl -s localhost:${OG_PORT}657/status | jq .result.sync_info

Check Port

#install net-tools
apt install net-tools
 
#check port
sudo netstat -tulpn | grep geth
sudo netstat -tulpn | grep 0gchaind

🛡️ Security

To apply a quick security baseline, you can configure your firewall like this:

sudo ufw allow ${OG_PORT}303/tcp comment 'geth_p2p_port'
sudo ufw allow ${OG_PORT}303/udp comment 'geth_p2p_port'
sudo ufw allow ${OG_PORT}656/tcp comment '0g_p2p_port'

🔐 For a more secure and maintainable setup, check out our Essentials Guide, including SSH key setup, Fail2Ban protection, and a full VPS hardening checklist.

Delete Validator

⚠️ Critical: Backup Your Validator Key!

Make sure to backup priv_validator.key.json. Do not lose this key — it is required to run your validator.

File location: ~/.0gchaind/galileo/0g-home/0gchaind-home/config/priv_validator.key.json

cd $HOME
sudo systemctl stop 0gchaind geth
sudo systemctl disable 0gchaind geth
sudo rm /etc/systemd/system/0gchaind.service
sudo rm /etc/systemd/system/geth.service
sudo systemctl daemon-reload
sudo rm -f $(which 0gchaind)
sudo rm -rf $HOME/.0gchaind
sudo rm -rf $HOME/galileo