Skip to content

06.2 · Guide

Tokens in the terminal

Add Galileo, claim test 0G, and prove the balance with cast or a raw JSON-RPC call.

01

Which token you are balancing

A test wallet has gas on Galileo. That balance is native 0G, 18 decimals, chain id 16602, RPC evmrpc-testnet.0g.ai. Claim it in a browser at faucet.0g.ai. The terminal cannot mint it. The terminal proves the claim landed.

Mainnet reads use evmrpc.0g.ai and chain id 16661. Compute credit is neither of those. Check credit with 0g-compute-cli get-account after a deposit, documented in the compute guide.

Hex chain ids

16602 is 0x40da. 16661 is 0x4115. Use the decimals when you talk to people and the hex when a wallet API asks for chainId.
02

Read chain id and balance

Replace the example address with the wallet that claimed. --ether prints 0G. Without it, cast prints wei. A brand-new claim of 0.1 0G shows as 0.100000000000000000 or a close value if a little gas was already spent.

03

Convert wei when you used curl

eth_getBalance returns wei as a hex string in the result field. 1 0G is 1000000000000000000 wei, which is hex 0xde0b6b3a7640000. Convert with cast, on every OS, once Foundry is installed.

Hex wei to 0G
cast to-dec 0xde0b6b3a7640000
cast from-wei "$(cast to-dec 0xde0b6b3a7640000)"
  • Expected chain id: 16602 on Galileo, 16661 on mainnet. Any other number means the RPC URL is wrong or a proxy is answering.
  • Expected balance after a fresh faucet claim: greater than zero. The Galileo overview has published 0.1 0G per address per day. Trust the faucet if that number changes.
  • A zero balance with a successful claim usually means you pasted a different address, or the wallet was on a retired testnet when it claimed.
  • Mainnet is the same command with the RPC swapped to evmrpc.0g.ai. Do not expect faucet tokens to appear there.