πŸ’‘ Useful commands

βš™οΈ Service Commands

Check Logs

sudo journalctl -u oraid -f -o cat

Start service

sudo systemctl start oraid 

Stop service

sudo systemctl stop oraid 

Restart service

sudo systmctl restart oraid 

Check status

sudo systemctl status oraid 

Enable Service

sudo systemctl enable oraid 

Reload service

sudo systemctl daemon-reload

Disable service

sudo systemctl disable oraid 

Check synchronization status

while true; do 
  local_height=$(oraid status | jq -r .sync_info.latest_block_height)
  network_height=$(curl -s https://rpc.oraichain-mainnet.unitynodes.com/status | jq -r '.result.sync_info.latest_block_height')
  blocks_left=$((network_height - local_height))

  echo -e "\033[1;33m[Sync Status]\033[0m \033[1;32mNode Height:\033[0m \033[1;37m$local_height\033[0m | \033[1;32mNetwork Height:\033[0m \033[1;37m$network_height\033[0m | \033[1;32mBlocks Left:\033[0m \033[1;31m$blocks_left\033[0m"

  sleep 5
done

If "Block left - 0" - synchronized

Check the latest block of your validator

oraid status | jq '.SyncInfo.latest_block_height // .sync_info.latest_block_height'

View the ports used node

ss -tulpn | grep oraid

βš™οΈ Key Command

Create new wallet

oraid keys add wallet

Recovery wallet

oraid keys add wallet --recover

List all wallet

oraid keys list

Delete wallet

oraid keys delete wallet

Export wallet

oraid keys export wallet

Import wallet

oraid keys import wallet wallet.backup 

Check wallet balance

oraid q bank balances $(oraid keys show wallet -a) 

βš™οΈ Validator Commands

Create validator

oraid tx staking create-validator \
  --amount 100000orai \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.05" \
  --min-self-delegation "1" \
  --pubkey=$(oraid tendermint show-validator) \
  --moniker "" \ #Validator name, displayed in explorers. 
  --website "" \ #Your website is available, or leave the field blank
  --identity "" \ #Use your KeyBase ID. If you don't have one, leave it empty.
  --details "" \ #Any details about your validator.
  --security-contact="" \ #Your mail
  --chain-id Oraichain \
  --from wallet #Wallet name, as specified during creation, or typically 'wallet'.

You can leave the text after # unchanged - it's a commented hint that won't affect validator creation.

β—½ Replace the following values with your own: WALLET - usually it's 'wallet', or your wallet's name. MONIKER - any convenient name for your validator, displayed in the explorer. IDENTITY - validator's avatar, displayed in the explorer. Create a KeyBase ID following the instructions or leave it empty, and it will default to a standard one. DETAILS - details about your validator, also displayed in the explorer.

Replace all necessary values indicated above with the $ sign to successfully create your validator. β—½ Example: lavad tx staking create-validator \

oraid tx staking create-validator \
  --amount 100000orai \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.05" \
  --min-self-delegation "1" \
  --pubkey=$(oraid tendermint show-validator) \
  --moniker "Unity Nodes" \ #Validator name, displayed in explorers. 
  --website "https://unitynodes.com/" \ #Your website is available, or leave the field blank
  --identity "" \ #Use your KeyBase ID. If you don't have one, leave it empty.
  --details "Trusted Blockchain Validator" \ #Any details about your validator.
  --security-contact="contact@unitynodes.com" \ #Your mail
  --chain-id Oraichain \
  --from wallet #Wallet name, as specified during creation, or typically 'wallet'.

Update validator information

oraid tx staking edit-validator \
  --moniker=$NODENAME \
  --identity="" \
  --website="$WEBSITE" \
  --details="$VALIDATOR_DESCRIPTION" \
  --chain-id=Oraichain \
  --from=$WALLET
  --gas-adjustment 1.4 \
  --gas "auto" \
  -y 

Validator details

oraid q staking validator $(oraid keys show wallet --bech val -a)

Jailing info

oraid q staking validator $(oraid keys show wallet --bech val -a) | grep -E "jailed"

If "true" - your validator is jailed // "false" - your validator is not jailed

Jail reason

oraid q slashing signing-info $(oraid tendermint show-validator)

Unjail command

oraid tx slashing unjail \
--chain-id Oraichain \
--fees 5000orai \
--from wallet \ # Or another wallet name
-y 

Information about delegation at your validator

oraid q staking validator $(oraid keys show wallet --bech val -a) | grep -E "tokens"

Active Validators list

oraid 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

Inactive Validator list

oraid q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED" or .status=="BOND_STATUS_UNBONDING")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl 

Signing Info

oraid query slashing signing-info $(oraid tendermint show-validator) 

βš™οΈ Tokens Commands

Delegate to yourself

oraid tx staking delegate $(oraid keys show wallet --bech val -a) 1000000orai --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Delegate to another validator

oraid tx staking delegate <TO_VALOPER_ADDRESS> 1000000orai --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Redelegate your stake to other validator

oraid tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000orai --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Unbond stake

oraid tx staking unbond $(nibid keys show $WALLET --bech val -a) 1000000orai --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Send tokens

oraid tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000orai --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Check wallet balance

oraid q bank balances $(oraid keys show wallet -a)

Transaction details

oraid query tx HASH_TX

Withdraw all rewards

oraid tx distribution withdraw-all-rewards --from $WALLET --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Withdraw rewards and commission from your validator

oraid tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

βš™οΈ Governance

List All Proposals

oraid query gov proposals

View proposal by ID

oraid query gov proposal ID

Vote "YES"

oraid tx gov vote PROPOSAL_ID yes --from wallet --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Vote "NO"

oraid tx gov vote PROPOSAL_ID no --from wallet --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Vote "NO_WITH_VETO"

oraid tx gov vote PROPOSAL_ID no_with_veto --from wallet --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Vote "ABSTAIN"

oraid tx gov vote PROPOSAL_ID abstain --from wallet --chain-id Oraichain --gas-adjustment 1.4 --gas "auto" -y

Create new text proposal

oraid tx gov submit-proposal \
--title="Title" \ #Change Title
--description="Description" \
--deposit=1000000orai \
--type="Text" \   #Change text proposal
--from=wallet \   #Change name wallet
--fees 300orai
-y 

βš™οΈ Utility

Set Custom Port


# Change CUSTOM_PORT to any other value, or leave it as is.
CUSTOM_PORT=19
sed -i.bak -e "s%^proxy_app = "tcp://127.0.0.1:26658"%proxy_app = "tcp://127.0.0.1:${CUSTOM_PORT}658"%; s%^laddr = "tcp://127.0.0.1:26657"%laddr = "tcp://127.0.0.1:${CUSTOM_PORT}657"%; s%^pprof_laddr = "localhost:6060"%pprof_laddr = "localhost:${CUSTOM_PORT}060"%; s%^laddr = "tcp://0.0.0.0:26656"%laddr = "tcp://0.0.0.0:${CUSTOM_PORT}656"%; s%^prometheus_listen_addr = ":26660"%prometheus_listen_addr = ":${CUSTOM_PORT}660"%" $HOME/.oraid/config/config.toml
sed -i.bak -e "s%^address = "tcp://0.0.0.0:1317"%address = "tcp://0.0.0.0:${CUSTOM_PORT}317"%; s%^address = ":8080"%address = ":${CUSTOM_PORT}080"%; s%^address = "0.0.0.0:9090"%address = "0.0.0.0:${CUSTOM_PORT}090"%; s%^address = "0.0.0.0:9091"%address = "0.0.0.0:${CUSTOM_PORT}091"%; s%^address = "0.0.0.0:8545"%address = "0.0.0.0:${CUSTOM_PORT}545"%; s%^ws-address = "0.0.0.0:8546"%ws-address = "0.0.0.0:${CUSTOM_PORT}546"%" $HOME/.oraid/config/app.toml

Set Indexer

sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.oraid/config/config.toml

Update Pruning

sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "17"|' $HOME/.oraid/config/app.toml

Reset node

oraid tendermint unsafe-reset-all --home $HOME/.oraid --keep-addr-book

Get denom info

oraid q bank denom-metadata -oj | jq

Get Node Peer

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

Update server name

 sudo hostnamectl set-hostname server_name

How much SSD use node (currently)

du -sh $HOME/.oraid/

How much RAM use node (currently)

sudo systemctl status oraid | grep "Memory:"

How much CPU use node (currently)

ps -C oraid -o %cpu --no-headers | awk '{print $1"% CPU"}'

Delete node

sudo systemctl stop oraid 
sudo systemctl disable oraid 
sudo rm -rf /etc/systemd/system/oraid.service
sudo rm $(which oraid)
sudo rm -rf $HOME/.oraid
sudo rm -rf $HOME/orai

Last updated