Skip to main content

Initia Protocol Testnet Commands

This page provides useful commands for managing your Initia node and participating in the testnet. Replace the placeholder values with your actual configuration.

Environment Variables

Set up these variables for easier command execution:

# Network configuration
export CHAIN_ID="initiation-1"
export RPC_PORT="26657" # Default RPC port (adjust if using custom ports)
export GRPC_PORT="9090" # Default gRPC port (adjust if using custom ports)
export NODE_DIR="$HOME/.initia" # Node data directory

# Your configuration (replace with your actual values)
export WALLET_NAME="your-wallet-name" # Your wallet name
export VALIDATOR_MONIKER="your-validator-moniker" # Your validator moniker
export VALIDATOR_DETAILS="Your validator description"
export VALIDATOR_WEBSITE="https://your-website.com"
export VALIDATOR_IDENTITY="your-keybase-identity" # Optional keybase identity

# Token and fees
export DENOM="uinit" # Base token denomination
export GAS_PRICES="0.15uinit" # Gas prices
export NODE_HOME="$HOME/.initia" # Node home directory
info

Important: Replace all placeholder values with your actual wallet name, validator moniker, and other configuration details.

Node Management

Node Status and Information

# Check node sync status
curl -s localhost:$RPC_PORT/status | jq .

# Check if node is catching up
curl -s localhost:$RPC_PORT/status | jq .result.sync_info.catching_up

# Get node sync info using initiad
initiad status --home $NODE_HOME

# Check P2P connection status
P2P_PORT=26656 && ss -anp | grep $P2P_PORT

# Get current block height
curl -s localhost:$RPC_PORT/status | jq .result.sync_info.latest_block_height

Service Management

# Check service status
systemctl status initia.service

# Start/stop/restart service
systemctl start initia.service
systemctl stop initia.service
systemctl restart initia.service

# View logs
journalctl -u initia.service -f
journalctl -u initia.service -n 100
journalctl -u initia.service --since "1 hour ago"

Network Information

# Get live peers
curl -sS localhost:$RPC_PORT/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

# Show your node ID and external address
echo $(initiad tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $NODE_HOME/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

# Get validator public key
initiad tendermint show-validator --home $NODE_HOME

Wallet Management

Create and Manage Wallets

# Create a new wallet
initiad keys add $WALLET_NAME --home $NODE_HOME

# Recover wallet from mnemonic
initiad keys add $WALLET_NAME --recover --home $NODE_HOME

# List all wallets
initiad keys list --home $NODE_HOME

# Show wallet address
initiad keys show $WALLET_NAME -a --home $NODE_HOME

# Show validator address
initiad keys show $WALLET_NAME --bech val -a --home $NODE_HOME

# Export wallet private key (be careful!)
initiad keys export $WALLET_NAME --home $NODE_HOME

Check Balances

# Query wallet balance
initiad q bank balances $(initiad keys show $WALLET_NAME -a --home $NODE_HOME)

# Query specific token balance
initiad q bank balance $(initiad keys show $WALLET_NAME -a --home $NODE_HOME) $DENOM

# Query all balances with details
initiad q bank balances $(initiad keys show $WALLET_NAME -a --home $NODE_HOME) --output json | jq

Validator Operations

Create Validator

# Create validator transaction
initiad tx mstaking create-validator \
--amount=1000000$DENOM \
--pubkey=$(initiad tendermint show-validator --home $NODE_HOME) \
--moniker="$VALIDATOR_MONIKER" \
--chain-id=$CHAIN_ID \
--identity="$VALIDATOR_IDENTITY" \
--website="$VALIDATOR_WEBSITE" \
--details="$VALIDATOR_DETAILS" \
--commission-rate=0.05 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.1 \
--from=$WALLET_NAME \
--gas=500000 \
--fees=300000$DENOM \
--home $NODE_HOME \
-y

Validator Management

# Edit validator information
initiad tx mstaking edit-validator \
--commission-rate=0.1 \
--new-moniker="$VALIDATOR_MONIKER" \
--identity="$VALIDATOR_IDENTITY" \
--details="$VALIDATOR_DETAILS" \
--website="$VALIDATOR_WEBSITE" \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

# Query your validator
initiad q mstaking validator $(initiad keys show $WALLET_NAME --bech val -a --home $NODE_HOME)

# Check validator signing info
initiad q mstaking signing-info $(initiad tendermint show-validator --home $NODE_HOME)

# Query jail reason
initiad q slashing signing-info $(initiad tendermint show-validator --home $NODE_HOME)

Unjail Validator

# Unjail your validator if it's jailed
initiad tx slashing unjail \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Query Validators

# Query all active validators
LIMIT=6000
initiad q mstaking validators --output json --limit=$LIMIT | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '.operator_address + " " + .voting_power + " " + .description.moniker' | sort -gr | nl

# Query all validators (including inactive)
initiad q mstaking validators --output json --limit=$LIMIT

# Query specific validator
initiad q mstaking validator VALIDATOR_OPERATOR_ADDRESS

Token Operations

Delegation

# Delegate tokens to your validator
VALOPER_ADDRESS=$(initiad keys show $WALLET_NAME --bech val -a --home $NODE_HOME)
AMOUNT="1000000$DENOM"

initiad tx mstaking delegate \
$VALOPER_ADDRESS $AMOUNT \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

# Delegate to another validator
OTHER_VALIDATOR_ADDRESS="initvaloper1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
initiad tx mstaking delegate \
$OTHER_VALIDATOR_ADDRESS $AMOUNT \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Redelegation and Unbonding

# Redelegate from one validator to another
SRC_VALIDATOR="initvaloper1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
DST_VALIDATOR="initvaloper1yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
AMOUNT="1000000$DENOM"

initiad tx mstaking redelegate \
$SRC_VALIDATOR $DST_VALIDATOR $AMOUNT \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

# Unbond tokens from validator
initiad tx mstaking unbond \
$VALOPER_ADDRESS $AMOUNT \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Transfers

# Send tokens to another address
TO_ADDRESS="init1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AMOUNT="1000000$DENOM"

initiad tx bank send \
$WALLET_NAME $TO_ADDRESS $AMOUNT \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Rewards and Commission

Withdraw Rewards

# Withdraw all delegation rewards
initiad tx distribution withdraw-all-rewards \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

# Withdraw rewards from specific validator
VALIDATOR_ADDRESS="initvaloper1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
initiad tx distribution withdraw-rewards \
$VALIDATOR_ADDRESS \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

# Withdraw validator commission (if you're a validator)
initiad tx distribution withdraw-rewards \
$(initiad keys show $WALLET_NAME --bech val -a --home $NODE_HOME) \
--commission \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Query Rewards

# Query delegation rewards
initiad q distribution rewards $(initiad keys show $WALLET_NAME -a --home $NODE_HOME)

# Query rewards from specific validator
initiad q distribution rewards $(initiad keys show $WALLET_NAME -a --home $NODE_HOME) $VALIDATOR_ADDRESS

# Query validator commission
initiad q distribution commission $(initiad keys show $WALLET_NAME --bech val -a --home $NODE_HOME)

Governance

Proposal Operations

# List all proposals
initiad q gov proposals

# Query specific proposal
PROPOSAL_ID="1"
initiad q gov proposal $PROPOSAL_ID

# Query proposal votes
initiad q gov votes $PROPOSAL_ID

# Query your vote on a proposal
initiad q gov vote $PROPOSAL_ID $(initiad keys show $WALLET_NAME -a --home $NODE_HOME)

Voting

# Vote on a proposal
PROPOSAL_ID="1"
VOTE_OPTION="yes" # Options: yes, no, no_with_veto, abstain

initiad tx gov vote $PROPOSAL_ID $VOTE_OPTION \
--from=$WALLET_NAME \
--chain-id=$CHAIN_ID \
--gas=auto \
--gas-adjustment=1.4 \
--gas-prices=$GAS_PRICES \
--home $NODE_HOME \
-y

Maintenance and Troubleshooting

Data Management

# Reset all data (WARNING: This will delete all blockchain data)
systemctl stop initia.service
initiad tendermint unsafe-reset-all --keep-addr-book --home $NODE_HOME
systemctl start initia.service

# Backup validator key
cp $NODE_HOME/config/priv_validator_key.json ~/validator_key_backup.json

# Backup node key
cp $NODE_HOME/config/node_key.json ~/node_key_backup.json

Performance Monitoring

# Check sync progress
curl -s localhost:$RPC_PORT/status | jq .result.sync_info

# Monitor block time
curl -s localhost:$RPC_PORT/status | jq .result.sync_info.latest_block_time

# Check peer count
curl -s localhost:$RPC_PORT/net_info | jq .result.n_peers

# Monitor resource usage
htop
df -h $NODE_HOME

Configuration Management

# View node configuration
cat $NODE_HOME/config/config.toml | grep -A 5 -B 5 "PATTERN"

# View app configuration
cat $NODE_HOME/config/app.toml | grep -A 5 -B 5 "PATTERN"

# Check genesis file
cat $NODE_HOME/config/genesis.json | jq .chain_id

Quick Reference

Essential Commands

CommandPurpose
systemctl status initia.serviceCheck service status
initiad status --home $NODE_HOMECheck node status
curl -s localhost:$RPC_PORT/status | jq .result.sync_info.catching_upCheck sync status
initiad q bank balances $(initiad keys show $WALLET_NAME -a --home $NODE_HOME)Check balance
journalctl -u initia.service -fFollow logs

Common Parameters

ParameterDescriptionExample
--chain-idChain identifierinitiation-1
--fromWallet nameyour-wallet-name
--gas-pricesGas prices0.15uinit
--homeNode home directory$HOME/.initia
--outputOutput formatjson

Port Reference

ServiceDefault PortCustom Port (PREFIX=2)
RPC2665726657
P2P2665626656
API13172317
gRPC90902090

info

These commands are for the Initia testnet. Always double-check addresses and amounts before executing transactions.

tip

Best Practices:

  • Always use your actual wallet name and addresses
  • Monitor your validator performance regularly
  • Participate in governance to help secure the network
  • Keep your validator keys secure and backed up