0G Galileo Validator & Staking Guide ā
This guide includes everything you need to register as a validator and participate in staking on the 0G Galileo testnet. Brought to you by AstroStake š
Contents ā
- Important Information
- Prerequisites & Installation
- Create Validator
- Delegate & Undelegate
- Tips & Troubleshooting
- Resources
Stake via Web with AstroStake ā
Prefer UI over CLI?
Explore all active validators, view delegation history, and stake directly from your browser ā all in one place.
Stake NowTransparent. Secure. Built by AstroStake, for the community.
Important Information ā
Smart Contract Addresses ā
Contract | Address |
---|---|
Staking Contract | 0xea224dBB52F57752044c0C86aD50930091F561B9 |
Network Details ā
Parameter | Value |
---|---|
RPC URL | https://evmrpc-testnet.0g.ai |
Chain ID | 16601 |
Native Token | OG (testnet ETH) |
Minimum Requirements ā
- Validator Staking: 32 OG minimum
- Delegation: Check contract for current minimum
- Withdrawal Fee: 1 Gwei (set by validator)
- Commission Rate: Customizable (example: 5% = 50000)
Prerequisites & Installation ā
System Requirements ā
- Fully synced Galileo node
- 32+ OG (testnet ETH) available for staking
- Directory structure (AstroStake format):
- Node path:
$HOME/.0gchaind/galileo
- Home:
$HOME/.0gchaind/galileo/0g-home/0gchaind-home
- Node path:
Install Required Tools ā
Install foundry
: ā
curl -L https://foundry.paradigm.xyz | bash
foundryup
Verify installation: ā
cast --help
Install additional tools: ā
sudo apt update && sudo apt install -y jq curl
Create Validator ā
This section will help you register as a validator on the 0G Galileo testnet using the 0gchaind
tooling and staking smart contracts. It assumes your node is already synced and running.
1. Generate Validator Keys ā
HOMEDIR=$HOME/.0gchaind/galileo/0g-home/0gchaind-home
CHAIN_SPEC=devnet
0gchaind deposit validator-keys --home $HOMEDIR --chaincfg.chain-spec=$CHAIN_SPEC
Note: Save the output 48-byte hex public key. You'll need it for the next steps.
2. Compute Validator Contract Address ā
STAKING_CONTRACT=0xea224dBB52F57752044c0C86aD50930091F561B9
PUBKEY=0xYOUR_PUBLIC_KEY # Replace with your actual public key from step 1
cast call $STAKING_CONTRACT "computeValidatorAddress(bytes)(address)" $PUBKEY --rpc-url https://evmrpc-testnet.0g.ai
Note: This returns your validator contract address. Save it for the next steps.
3. Generate Validator Signature ā
VALIDATOR_CONTRACT=0xYOUR_VALIDATOR_ADDRESS # Replace with address from step 2
AMOUNT_GWEI=32000000000 # 32 ETH
0gchaind deposit create-validator $VALIDATOR_CONTRACT $AMOUNT_GWEI $HOMEDIR/config/genesis.json --home $HOMEDIR --chaincfg.chain-spec=$CHAIN_SPEC
Note: Save both the
pubkey
andsignature
from the output. You'll need them for registration.
4. Register Validator On-chain ā
Create Validator ā
Configuration:
Generated Code:
Loading...
ā ļø CUSTOMIZE THESE VALUES:
"Moniker"
ā Your validator name"Identity"
ā Your keybase ID"Website"
ā Your website URL"Contact"
ā Your contact email"Details"
ā Your validator description$PUBKEY
ā Your public key from step 1$SIGNATURE
ā Your signature from step 3$YOUR_PRIVATE_KEY
ā Your wallet private keyCommission rate: 5% (in basis points: 5 * 10000), withdrawal fee: 1 Gwei
5. Verify Registration ā
cast call $STAKING_CONTRACT "getValidator(bytes)(address)" $PUBKEY --rpc-url https://evmrpc-testnet.0g.ai
If your validator address appears, you're successfully registered! š
Delegate & Undelegate ā
Guide to delegate OG tokens to a validator and undelegate later using the 0G Galileo staking contract.
1. Delegate to a Validator ā
STAKING_CONTRACT=0xea224dBB52F57752044c0C86aD50930091F561B9
PUBKEY=0xYOUR_VALIDATOR_PUBKEY # Replace with target validator's public key
AMOUNT=1ether # Replace with amount you want to delegate
# Get validator contract address
VALIDATOR=$(cast call $STAKING_CONTRACT "getValidator(bytes)(address)" $PUBKEY --rpc-url https://evmrpc-testnet.0g.ai)
# Delegate
cast send $VALIDATOR "delegate(address)" $YOUR_WALLET_ADDRESS \
--value $AMOUNT \
--rpc-url https://evmrpc-testnet.0g.ai \
--private-key $YOUR_PRIVATE_KEY
ā ļø CUSTOMIZE THESE VALUES:
$PUBKEY
ā Public key of the validator you want to delegate to$AMOUNT
ā Amount to delegate (e.g., 1ether, 5ether)$YOUR_WALLET_ADDRESS
ā Your wallet address$YOUR_PRIVATE_KEY
ā Your wallet private key
2. Check Delegation Status ā
cast call $VALIDATOR "getDelegation(address)(address,uint)" $YOUR_WALLET_ADDRESS --rpc-url https://evmrpc-testnet.0g.ai
ā ļø CUSTOMIZE: Replace
$YOUR_WALLET_ADDRESS
with your actual wallet address
Returns your validator address and number of shares held.
3. Undelegate from Validator ā
# Get withdrawal fee
FEE_GWEI=$(cast call $VALIDATOR "withdrawalFeeInGwei()(uint96)" --rpc-url https://evmrpc-testnet.0g.ai)
FEE=$(cast to-wei $FEE_GWEI gwei)
# Undelegate (e.g. 100 shares)
cast send $VALIDATOR "undelegate(address,uint256)" $YOUR_WALLET_ADDRESS 100 \
--value $FEE \
--rpc-url https://evmrpc-testnet.0g.ai \
--private-key $YOUR_PRIVATE_KEY
ā ļø CUSTOMIZE THESE VALUES:
$YOUR_WALLET_ADDRESS
ā Your wallet address100
ā Number of shares to undelegate$YOUR_PRIVATE_KEY
ā Your wallet private key
4. Withdraw Commission (Validator Only) ā
cast send $VALIDATOR "withdrawCommission(address)" $YOUR_ADDRESS \
--rpc-url https://evmrpc-testnet.0g.ai \
--private-key $YOUR_PRIVATE_KEY
ā ļø CUSTOMIZE THESE VALUES:
$YOUR_ADDRESS
ā Your wallet address to receive commission$YOUR_PRIVATE_KEY
ā Your wallet private key
ā¹ļø Important Notes ā
- Undelegation Delay: There's a waiting period before withdrawal is available
- Token Calculation:
tokens()
returns total delegated tokens (including rewards) - Share Supply:
delegatorShares()
returns total share supply - Fees: Always check withdrawal fees before undelegating
Tips & Troubleshooting ā
ā ļø Common Issues ā
Validator not found ā
Problem: Your validator hasn't been created or registered on-chain
Solution: Ensure you've completed all steps in the "Create Validator" section:
address validator = staking.createValidator(pubkey);
DelegationBelowMinimum ā
Problem: Delegated amount is below minimum requirement
Solution: Check minimum delegation amount:
uint96 minDelegation = staking.effectiveDelegationInGwei();
require(msg.value >= minDelegation * 1 gwei, "Insufficient delegation");
NotEnoughWithdrawalFee ā
Problem: Insufficient withdrawal fee provided
Solution: Always include the correct withdrawal fee:
uint96 fee = validator.withdrawalFeeInGwei();
validator.undelegate{value: fee * 1 gwei}(recipient, shares);
Useful Commands ā
Check validator status: ā
cast call $STAKING_CONTRACT "getValidator(bytes)(address)" $PUBKEY --rpc-url https://evmrpc-testnet.0g.ai
Check total delegated tokens: ā
cast call $VALIDATOR "tokens()(uint256)" --rpc-url https://evmrpc-testnet.0g.ai
Check validator commission rate: ā
cast call $VALIDATOR "commissionRateInBasisPoints()(uint32)" --rpc-url https://evmrpc-testnet.0g.ai
š Resources ā
- AstroStake Validator Status
- Official 0G Docs
- Staking Contracts on GitHub
- 0G Discord
- Foundry Documentation
Built by Node Runners. For the networks we believe in. š°ļø