Initia Services

 https://initia-testnet-api.nodesrun.xyz 

 https://initia-testnet-grpc.nodesrun.xyz

 https://initia-testnet-jsonrpc.nodesrun.xyz 

sudo systemctl stop initiad

cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup
initiad tendermint unsafe-reset-all --home $HOME/.initia

peers="aee7083ab11910ba3f1b8126d1b3728f13f54943@initia-testnet-peer.itrocket.net:11656,eaccff99569bbf63456775534cc0f54f52c889bc@158.220.98.217:26656,4c6a1f142c2d26cf52187ecc8411ea9d780dc666@138.201.137.86:13056,54742be13e24c65bb5a5770db40b2a44a8992a4a@144.91.125.32:26656,a9bc4d1b8603236b23f69599996e26b751e23b5f@157.173.198.97:26656,f3b94684ee056875523f0a85d96325fc78d8d709@162.55.24.104:26656,06790b1813bf34bfe8e386454debacd66c5772ea@5.252.52.139:26656,db04d4ffd9efe74ec844d8de94bd1cc1721c2f67@45.67.228.52:26656,5158c741d5be106c16c5fe68b1d83744267a12b8@37.27.131.254:13656,b4fba0d7810ff990bf81998eb1febfc1c32ae0ba@133.186.198.236:26656,9cf4fb2da8ad23a770284df513b428eb79b42a92@207.244.240.27:26656,214af31867faa1dfa1320b97da7ee1019054b488@188.214.129.222:26656,ea02c6a9ca6a58b7b7a85295d54556ea785f0f8b@89.116.29.140:53456,f398117804c638ace3c189781d08db77caa20aa9@65.108.109.48:10656,60a02209caf4e59206efa0b95cfdbe6b3d4cf186@141.95.85.179:26656,cce50f542aa842cb814306cc4676fff1f88865c3@162.55.3.199:26656,53eebd12c81059727c4a711084b6037451bdafb6@49.12.151.215:26656,58365247ff80e7e5b840d2aa0bf06e4a8d9fc531@31.220.73.225:26656,3d7aad49a75791ea7ddb4a8c00d7de9377617d1e@176.227.202.20:57256,0ac5727d219ee09a12cf3e2b61a25ae51bcbca70@49.12.174.227:26656,babe2962186dcba184b362d7730cadd189c64f93@38.242.255.221:26656"  
SNAP_RPC="https://initia-testnet-rpc.itrocket.net:443"

sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.initia/config/config.toml 

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height);
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000));
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) 

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && sleep 2

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ;
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ;
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ;
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.initia/config/config.toml

curl https://testnet-files.itrocket.net/initia/wasmPath_initia.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/
mv $HOME/.initia/priv_validator_state.json.backup $HOME/.initia/data/priv_validator_state.json

sudo systemctl restart initiad && sudo journalctl -u initiad -f

Wasm

Sorry, this project does not support WebAssembly.

sudo systemctl stop initiad

cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup

rm -rf $HOME/.initia/data 
curl https://initia-testnet-snapshot.nodesrun.xyz/initia/initia_snapshot.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.initia

mv $HOME/.initia/priv_validator_state.json.backup $HOME/.initia/data/priv_validator_state.json

sudo systemctl restart initiad && sudo journalctl -u initiad -f

URL="https://initia-testnet-rpc.polkachu.com/net_info"

response=$(curl -s $URL)

PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)$").port)' | paste -sd "," -)

echo "PEERS=\"$PEERS\""

sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.initia/config/config.toml

cd69bcb00a6ecc1ba2b4a3465de4d4dd3e0a3db1@initia-testnet-seed.itrocket.net:51656

URL="https://initia-testnet-rpc.polkachu.com/net_info"

response=$(curl -s $URL)

PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)$").port)' | paste -sd "," -)

echo "PEERS=\"$PEERS\""

sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.initia/config/config.toml

wget -O $HOME/.initia/config/addrbook.json https://testnet-files.itrocket.net/initia/addrbook.json

Check logs
sudo journalctl -u initiad -f

Start service
sudo systemctl start initiad

Stop service
sudo systemctl stop initiad

Restart service
sudo systemctl restart initiad

Check service status
sudo systemctl status initiad

Reload services
sudo systemctl daemon-reload

Enable Service
sudo systemctl enable initiad

Disable Service
sudo systemctl disable initiad

Node info
initiad status 2>&1 | jq

Block Height
local_height=$(initiad status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://rpc-initia-testnet.trusted-point.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "Network height: $network_height"; echo "Blocks left: $blocks_left"

Add New Wallet
initiad keys add $WALLET

Restore executing wallet
initiad keys add $WALLET --recover

List All Wallets
initiad keys list

Delete wallet
initiad keys delete $WALLET

Check Balance
initiad q bank balances $WALLET_ADDRESS 

Export Key (save to wallet.backup)
initiad keys export $WALLET

View EVM Prived Key
initiad keys unsafe-export-eth-key $WALLET

Import Key (restore from wallet.backup)
initiad keys import $WALLET wallet.backup

Withdraw all rewards
initiad tx distribution withdraw-all-rewards --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit 

Withdraw rewards and commission from your validator
initiad tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id initiation-1 --gas auto --fees 80000uinit -y 

Check your balance
initiad query bank balances $WALLET_ADDRESS

Delegate to Yourself
initiad tx staking delegate $(initiad keys show $WALLET --bech val -a) 1000000uinit --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit -y 

Delegate
initiad tx staking delegate <TO_VALOPER_ADDRESS> 1000000uinit --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit -y 	

Redelegate Stake to Another Validator
initiad tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000uinit --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit -y 

Unbond
initiad tx staking unbond $(initiad keys show $WALLET --bech val -a) 1000000uinit --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit -y 

Transfer Funds
initiad tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000uinit --gas auto --fees 80000uinit -y 

Create New Validator

initiad tx mstaking create-validator \
--amount 1000000uinit \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(initiad tendermint show-validator) \
--moniker "$MONIKER" \
--identity "" \
--details "I love blockchain ❤️" \
--chain-id initiation-1 \
--gas auto --fees 80000uinit \
-y 

Edit Existing Validator

initiad tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "I love blockchain ❤️" \
--from $WALLET \
--chain-id initiation-1 \
--gas auto --fees 80000uinit \
-y 

Validator info
initiad status 2>&1 | jq

Validator Details
initiad q staking validator $(initiad keys show $WALLET --bech val -a) 

Jailing info
initiad q slashing signing-info $(initiad tendermint show-validator) 

Slashing parameters
initiad q slashing params 

Unjail validator
initiad tx slashing unjail --from $WALLET --chain-id initiation-1 --gas auto --fees 80000uinit -y 

Active Validators List
initiad 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
[[ $(initiad q staking validator $VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(initiad status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"

Signing info
initiad q slashing signing-info $(initiad tendermint show-val

Vote
initiad tx gov vote 1 yes --from $WALLET --chain-id initiation-1  --gas auto --fees 80000uinit -y