Useful commands
Service operations ⚙️
Check logs
sudo journalctl -u ojod -f
Start service
sudo systemctl start ojod
Stop service
sudo systemctl stop ojod
Restart service
sudo systemctl restart ojod
Check service status
sudo systemctl status ojod
Reload services
sudo systemctl daemon-reload
Enable Service
sudo systemctl enable ojod
Disable Service
sudo systemctl disable ojod
Sync info
ojod status 2>&1 | jq .SyncInfo
Node info
ojod status 2>&1 | jq .NodeInfo
Your node peer
echo $(ojod tendermint show-node-id)'@'$(wget -qO- eth0.me)':'$(cat $HOME/.ojo/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Key management
Add New Wallet
ojod keys add $WALLET
Restore executing wallet
ojod keys add $WALLET --recover
List All Wallets
ojod keys list
Delete wallet
ojod keys delete $WALLET
Check Balance
ojod q bank balances $(ojod keys show $WALLET -a)
Export Key (save to wallet.backup)
ojod keys export $WALLET
Import Key (restore from wallet.backup)
ojod keys import $WALLET wallet.backup
Tokens
Withdraw all rewards
ojod tx distribution withdraw-all-rewards --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5
Withdraw rewards and commission from your validator
ojod tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Check your balance
ojod query bank balances $WALLET_ADDRESS
Delegate to Yourself
ojod tx staking delegate $(ojod keys show $WALLET --bech val -a) 1000000uojo --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Delegate
ojod tx staking delegate <TO_VALOPER_ADDRESS> 1000000uojo --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Redelegate Stake to Another Validator
ojod tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000uojo --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Unbond
ojod tx staking unbond $(ojod keys show $WALLET --bech val -a) 1000000uojo --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Transfer Funds
ojod tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000uojo --gas auto --gas-adjustment 1.5 -y
Validator operations
Create New Validator
ojod tx staking create-validator \
--amount 1000000uojo \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(ojod tendermint show-validator) \
--moniker "$MONIKER" \
--identity "" \
--details "XXXXXXXXXX" \
--chain-id ojo-devnet \
--gas auto --gas-adjustment 1.5 \
-y
Edit Existing Validator
ojod tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "XXXXXXXXXXXXX" \
--from $WALLET \
--chain-id ojo-devnet \
--gas auto --gas-adjustment 1.5 \
-y
Validator info
ojod status 2>&1 | jq .ValidatorInfo
Validator Details
ojod q staking validator $(ojod keys show $WALLET --bech val -a)
Jailing info
ojod q slashing signing-info $(ojod tendermint show-validator)
Unjail validator
ojod tx slashing unjail --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Active Validators List
ojod 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
[[ $(ojod q staking validator $VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(ojod status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"
Signing info
ojod q slashing signing-info $(ojod tendermint show-validator)
Governance
Create New Text Proposal
ojod tx gov submit-proposal \
--title "" \
--description "" \
--deposit 1000000uojo \
--type Text \
--from $WALLET \
--gas auto --gas-adjustment 1.5 \
-y
Proposals List
ojod query gov proposals
Proposal
View proposal
ojod query gov proposal 1
Vote
ojod tx gov vote 1 yes --from $WALLET --chain-id ojo-devnet --gas auto --gas-adjustment 1.5 -y
Delete Node
sudo systemctl stop ojod
sudo systemctl disable ojod
sudo rm -rf /etc/systemd/system/ojod.service
sudo rm $(which ojod)
sudo rm -rf $HOME/.ojo
sed -i "/OJO_/d" $HOME/.bash_profile
Last updated