December 21, 2022

Useful commands for checking and interacting with the OKP4 blockchain

Service management:

viewing logs:

journalctl -fu okp4d -o cat

stop the service:

sudo systemctl stop okp4d

restart the service:

sudo systemctl restart okp4d

Node Information:

slashing parameter:

okp4d q slashing signing-info $(binary_file tendermint show-validator)
okp4d q slashing params

synchronization information:

okp4d status 2>&1 | jq .SyncInfo

validator information :

okp4d query staking validator <valoper_address>

find out the validator's address:

okp4d keys show $WALLET --bech val -a

node metrics:

okp4d status | jq

Wallet Operations:

restore wallet:

okp4d keys add $WALLET --recover

delete wallet:

okp4d keys delete $WALLET

list of wallets:

okp4d keys list

check the balance:

okp4d query bank balances $OKP4_WALLET_ADDRESS

transfer of funds :

okp4d tx bank send $OKP4_WALLET_ADDRESS <TO_OKP4_WALLET_ADDRESS> 5000000uknow

Voting:

okp4d tx gov vote 5 yes --from $WALLET --chain-id=$OKP4_CHAIN_ID

Delegation and remuneration:

delegate to the validator:

okp4d tx staking delegate $OKP4_VALOPER_ADDRESS 5000000uknow --from=$WALLET --chain-id=$OKP4_CHAIN_ID --fees=500uknow --gas=auto

redelegate a steak from a validator to another validator:

okp4d tx staking redelegate <src_ValidatorAddress> <dest_ValidatorAddress> 5000000uknow --from=$WALLET --chain-id=$OKP4_CHAIN_ID --fees=500uknow --gas=auto

withdrawal of rewards with commission:

okp4d tx distribution withdraw-rewards $OKP4_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$OKP4_CHAIN_ID --fees=500uknow --gas=auto

Get a list of peers:

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

find out the RPC port:

echo -e "\033[0;32m$(grep -A 3 "\[rpc\]" ~/.okp4d/config/config.toml | egrep -o ":[0-9]+")\033[0m"

Edit validator:

okp4d tx staking edit-validator \
  --moniker=$NODENAME \
  --identity=<your_keybase_id> \
  --website="<your_website>" \
  --details="<your_validator_description>" \
  --chain-id=$OKP4_CHAIN_ID \
  --from=$WALLET \
  --fees=500uknow

Unjail validator:

okp4d tx slashing unjail \
  --broadcast-mode=block \
  --from=$WALLET \
  --chain-id=$OKP4_CHAIN_ID \
  --gas=auto \
  --fees=500uknow