Node9X Service
  • 🍄MAINNET
    • đŸŸĸKopi Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade (V11)
      • đŸĒĸCosmovisor
      • đŸ›°ī¸Command
  • 🚀Testnet
    • đŸ§ŦExplorer
    • đŸŸĸNative
      • âš™ī¸Installation
    • đŸŸĸXRPL EVM
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • đŸ•šī¸Command
    • đŸŸĸPipe Network
      • Installation
      • Upgrade
    • đŸŸĸPell
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade (v1.1.1)
      • đŸ•šī¸Command
    • đŸŸĸStructs
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • đŸ•šī¸Command
    • đŸŸĸPrysm
      • đŸ›°ī¸Service & Snapshot
      • âš™ī¸Installation
      • 💾Command
    • đŸŸĸZenrock
      • 💾Service & Snapshot
      • âš™ī¸Installation
      • â›“ī¸Upgrade ( v6.3.3)
      • đŸ•šī¸Cosmovisor
      • đŸ›°ī¸Command
      • âš™ī¸Sidecar (âœ”ī¸Oracle)
        • 🔗Upgrade
    • đŸŸĸStory Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation (Odyssey)
      • â›“ī¸Upgrade (v0.13.1)
        • đŸĒĸUpgrade (v0.13.0)
      • â›“ī¸Cosmovisor
      • đŸ›°ī¸Command
    • đŸŸĸ0G Chain
      • Service & Snapshot
      • Installation
        • Cosmovisor
      • Commands
      • â˜‘ī¸0G Storage Node
        • Upgrade (v0.7.3)
      • â˜‘ī¸0G Storage KV
      • â˜‘ī¸0G DA Node
        • Update
      • â˜‘ī¸0G DA Client
    • đŸŸĸAirchains
      • 💾Service & Snapshot
      • âš™ī¸Installation
        • đŸĒĸCosmovisor
        • đŸ”ēEVM ZK Rollup
      • đŸ•šī¸Commands
      • â›“ī¸Upgrade
    • đŸŸĸAllora
      • đŸ”ēWorkers
        • Create tool and worker wallet
        • Install Worker 1
        • Install Worker 2
        • Troubleshooting
        • Script for checking worker
      • Another method
      • Service
      • Installation By Dock (Recommend)
      • Installation
      • Snapshot & State sync
      • Useful commands
    • đŸŸĸHedge Block
      • Service
      • Installation
      • Commands
    • đŸŸĸDill Chain
      • Usage Commands
    • đŸŸĸFiamma Chain
      • đŸĨĻServices & Snapshot
      • âš™ī¸Installation
      • đŸ›°ī¸Usage Command
    • đŸŸĸElixir Testnet
      • âš™ī¸Installation
    • đŸŸĸChainbase
      • â›“ī¸Installation
    • 🔘AXONE Protocol
      • 💾Service & Snapshot
      • âš™ī¸Installation
    • 🔘Symphony
      • 🔌Installation
      • đŸĨĻFresh Peer
    • 🔘Empeiria
      • Installation
      • Usage Command
Powered by GitBook
On this page
  • Service operations âš™ī¸
  • Key management
  • Tokens
  • Validator operations
  • Governance

Was this helpful?

  1. Testnet
  2. 0G Chain

Commands

Service operations âš™ī¸

Check logs

sudo journalctl -u 0gchaind -f

Start service

sudo systemctl start 0gchaind

Stop service

sudo systemctl stop 0gchaind

Restart service

sudo systemctl restart 0gchaind

Check service status

sudo systemctl status 0gchaind

Reload services

sudo systemctl daemon-reload

Enable Service

sudo systemctl enable 0gchaind

Disable Service

sudo systemctl disable 0gchaind

Node info

0gchaind status 2>&1 | jq

Your node peer

echo $(0gchaind tendermint show-node-id)'@'$(wget -qO- eth0.me)':'$(cat $HOME/.0gchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Key management

Add New Wallet

0gchaind keys add $WALLET

Restore executing wallet

0gchaind keys add $WALLET --recover

List All Wallets

0gchaind keys list

Delete wallet

0gchaind keys delete $WALLET

Check Balance

0gchaind q bank balances $WALLET_ADDRESS 

Export Key (save to wallet.backup)

0gchaind keys export $WALLET

View EVM Prived Key

0gchaind keys unsafe-export-eth-key $WALLET

Import Key (restore from wallet.backup)

0gchaind keys import $WALLET wallet.backup

Tokens

To valoper addressTo wallet addressAmount, ua0gi

Withdraw all rewards

0gchaind tx distribution withdraw-all-rewards --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 

Withdraw rewards and commission from your validator

0gchaind tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 

Check your balance

0gchaind query bank balances $WALLET_ADDRESS

Delegate to Yourself

0gchaind tx staking delegate $(0gchaind keys show $WALLET --bech val -a) 1000000ua0gi --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 

Delegate

0gchaind tx staking delegate <TO_VALOPER_ADDRESS> 1000000ua0gi --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 	

Redelegate Stake to Another Validator

0gchaind tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000ua0gi --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 

Unbond

0gchaind tx staking unbond $(0gchaind keys show $WALLET --bech val -a) 1000000ua0gi --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 

Transfer Funds

0gchaind tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000ua0gi --gas=auto --gas-adjustment=1.6 -y 

Validator operations

Create New Validator

0gchaind tx staking create-validator \
--amount 1000000ua0gi \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(0gchaind tendermint show-validator) \
--moniker "$MONIKER" \
--identity "" \
--details "I love blockchain â¤ī¸" \
--chain-id zgtendermint_16600-2 \
--gas=auto --gas-adjustment=1.6 \
-y 

Edit Existing Validator

0gchaind tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "I love blockchain â¤ī¸" \
--from $WALLET \
--chain-id zgtendermint_16600-2 \
--gas=auto --gas-adjustment=1.6 \
-y 

Validator info

0gchaind status 2>&1 | jq

Validator Details

0gchaind q staking validator $(0gchaind keys show $WALLET --bech val -a) 

Jailing info

0gchaind q slashing signing-info $(0gchaind tendermint show-validator) 

Slashing parameters

0gchaind q slashing params 

Unjail validator

0gchaind tx slashing unjail --from $WALLET --chain-id zgtendermint_16600-2 --gas=auto --gas-adjustment=1.6 -y 

Active Validators List

0gchaind q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl 

Check Validator key

[[ $(0gchaind q staking validator $VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(0gchaind status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"

Signing info

0gchaind q slashing signing-info $(0gchaind tendermint show-validator) 

Governance

Create New Text Proposal

0gchaind  tx gov submit-proposal \
--title "" \
--description "" \
--deposit 1000000ua0gi \
--type Text \
--from $WALLET \
--gas=auto --gas-adjustment=1.6 \
-y 

Proposals List

0gchaind query gov proposals 

View proposal

0gchaind query gov proposal 1 

Vote

0gchaind tx gov vote 5 yes --from Chicharito --chain-id zgtendermint_16600-2 --gas-adjustment 1.5 --gas auto --gas-prices 0.00252ua0gi -y

Block sync left:

local_height=$(0gchaind status | jq -r .sync_info.latest_block_height); 
network_height=$(curl -s https://rpc.0gchain.josephtran.xyz/status | jq -r .result.sync_info.latest_block_height); 
blocks_left=$((network_height - local_height)); 

echo -e "\033[1;32mYour node height:\033[0m \033[1;34m$local_height\033[0m | \033[1;35mNetwork height:\033[0m \033[1;36m$network_height\033[0m | \033[1;29mBlocks left:\033[0m \033[1;31m$blocks_left\033[0m"

Get node peers:

echo $(0gchaind tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.0gchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Fetch RPC port:

RPC="http://$(wget -qO- eth0.me)$(grep -A 3 "\[rpc\]" $HOME/.0gchain/config/config.toml | egrep -o ":[0-9]+")" && echo $RPC
curl $RPC/status | jq

Retrieving Node ID and Server IP Address Configuration:

Your node:

echo $(0gchaind tendermint show-node-id)'@'$(curl -s ipv4.icanhazip.com)':'$(cat $HOME/.0gchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

From RPC other node:

curl -s https://rpc.0gchain.josephtran.xyz/net_info | jq -r '.result.peers[] | select(.node_info.listen_addr | test("^tcp://0.0.0.0") | not) | "\(.node_info.id)@\(.node_info.listen_addr)"'

Change RPC port:

Open for Client:

NEW_RPC_LADDR="tcp://0.0.0.0:26657"
NEW_EVM_ADDRESS="0.0.0.0:8545"
NEW_WS_ADDRESS="0.0.0.0:8546"
NEW_API="eth,txpool,personal,net,debug,web3"
sed -i \
    -e "s#^\(laddr = \)\"[^\"]*\"#\1\"${NEW_RPC_LADDR}\"#" \
    $HOME/.0gchain/config/config.toml
sed -i \
    -e "s#^\(address = \)\"[^\"]*\"#\1\"${NEW_EVM_ADDRESS}\"#" \
    -e "s#^\(ws-address = \)\"[^\"]*\"#\1\"${NEW_WS_ADDRESS}\"#" \
    -e "s#^\(api = \)\"[^\"]*\"#\1\"${NEW_API}\"#" \
    $HOME/.0gchain/config/app.toml
PreviousCosmovisorNext0G Storage Node

Last updated 8 months ago

Was this helpful?

🚀
đŸŸĸ