Skip to content

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.

Requirements

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

INFO

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.

Update

Click here to see how to update to v1.2.0
  1. Stop Service
bash
systemctl stop 0gchaind geth
  1. Download latest binaries
bash
wget https://github.com/0glabs/0gchain-NG/releases/download/v1.2.0/galileo-v1.2.0.tar.gz
tar -xzvf galileo-v1.2.0.tar.gz -C $HOME
rm galileo-v1.2.0.tar.gz
chmod +x $HOME/galileo-v1.2.0/bin/geth
chmod +x $HOME/galileo-v1.2.0/bin/0gchaind

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

bash
sudo cp $HOME/galileo-v1.2.0/bin/geth /usr/local/bin/geth
sudo cp $HOME/galileo-v1.2.0/bin/0gchaind /usr/local/bin/0gchaind
  1. Replace systemd service

Replace 0gchaind

bash
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 \
  --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
  1. Restart service
bash
systemctl daemon-reload
systemctl restart 0gchaind
systemctl restart geth

Check logs

bash
journalctl -u 0gchaind -u geth -f
Click here to see how to update to v1.2.0 if you are using auto installer before
  1. Stop Service
bash
systemctl stop 0gchaind geth
  1. Download latest binaries
bash
wget https://github.com/0glabs/0gchain-NG/releases/download/v1.2.0/galileo-v1.2.0.tar.gz
tar -xzvf galileo-v1.2.0.tar.gz -C $HOME
rm galileo-v1.2.0.tar.gz
chmod +x $HOME/galileo-v1.2.0/bin/geth
chmod +x $HOME/galileo-v1.2.0/bin/0gchaind

Move binaries to $HOME/galileo/bin/

bash
sudo cp $HOME/galileo-v1.2.0/bin/geth $HOME/galileo/bin/geth
sudo cp $HOME/galileo-v1.2.0/bin/0gchaind $HOME/galileo/bin/0gchaind
  1. Replace systemd service
bash
sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0GChainD Service
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/galileo
ExecStart=$HOME/galileo/bin/0gchaind start \
    --rpc.laddr tcp://0.0.0.0:26657 \
    --chaincfg.chain-spec devnet \
    --chaincfg.kzg.trusted-setup-path=$HOME/galileo/kzg-trusted-setup.json \
    --chaincfg.engine.jwt-secret-path=$HOME/galileo/jwt-secret.hex \
    --chaincfg.kzg.implementation=crate-crypto/go-kzg-4844 \
    --chaincfg.block-store-service.enabled \
    --chaincfg.node-api.enabled \
    --chaincfg.node-api.logging \
    --chaincfg.node-api.address 0.0.0.0:3500 \
    --pruning=nothing \
    --home=$HOME/.0gchaind/0g-home/0gchaind-home \
    --p2p.seeds=85a9b9a1b7fa0969704db2bc37f7c100855a75d9@8.218.88.60:26656 \
    --p2p.external_address=89.58.12.214:26656
Restart=always
RestartSec=5
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF
  1. Restart service
bash
systemctl daemon-reload
systemctl restart 0gchaind
systemctl restart geth

Check logs

bash
journalctl -u 0gchaind -u geth -f

Manual Install

Version v1.2.0

1. Install Dependencies

bash
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

bash
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 Code:

Loading...

4. Download and Extract Galileo

bash
cd $HOME
rm -rf galileo
wget https://github.com/0glabs/0gchain-NG/releases/download/v1.2.0/galileo-v1.2.0.tar.gz
tar -xzvf galileo-v1.2.0.tar.gz -C $HOME
mv $HOME/galileo-v1.2.0 $HOME/galileo
rm galileo-v1.2.0.tar.gz
chmod +x $HOME/galileo/bin/geth
chmod +x $HOME/galileo/bin/0gchaind

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

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

5. Initialize the Chain

bash
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
bash
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

bash
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

bash
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

bash
# 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

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

Configure custom pruning

bash
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.

bash
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.

bash
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

bash
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 \
  --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

Setup geth.service

bash
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

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

9. Verify Installation

bash
journalctl -u 0gchaind -u geth -f

Useful Commands

Check logs

bash
journalctl -u 0gchaind -u geth -f

Check Blocks

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

Check node status

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

Check Port

bash
#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:

bash
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

bash
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