πŸ’‘ Useful commands

βš™οΈ Service Commands

Check Logs

sudo journalctl -u lavad -f -o cat

Start service

sudo systemctl start lavad

Stop service

sudo systemctl stop lavad

Restart service

sudo systmctl restart lavad

Check status

sudo systemctl status lavad

Enable Service

sudo systemctl enable lavad

Reload service

sudo systemctl daemon-reload

Disable service

sudo systemctl disable lavad

Check synchronization status

lavad status | jq | grep "catching_up"

If "true" - not synchronized // "false" - synchronized

Check the latest block of your validator and the last block of the network

local_height=$(lavad status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://rpc.lava-testnet.unitynodes.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"

Example:

View the ports used node

ss -tulpn | grep lavad

βš™οΈ Key Command

Create new wallet

lavad keys add wallet

Recovery wallet

lavad keys add wallet --recover

List all wallet

lavad keys list

Delete wallet

lavad keys delete wallet

Export wallet

lavad keys export wallet

Import wallet

lavad keys import wallet wallet.backup 

Check wallet balance

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

βš™οΈ Validator Commands

Create validator

lavad tx staking create-validator \
--amount 1000000ulava \
--from $WALLET \ #Wallet name, as specified during creation, or typically 'wallet'.
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(lavad tendermint show-validator) \
--moniker "$MONIKER" \ #Validator name, displayed in explorers. 
--identity "" \        #Use your KeyBase ID. If you don't have one, leave it empty.
--details "$DESCRIPTION_OF_YOUR_VALIDATOR" \ #Any details about your validator.
--chain-id lava-testnet-2 \
--fees 300ulava \
-y

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 \

--amount 1000000ulava \
--from wallet \ 
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(lavad tendermint show-validator) \
--moniker "Oliver" \ 
--identity "" \        
--details "Reliable validator for your network." \ 
--chain-id lava-testnet-2 \
--fees 300ulava \
-y

Update validator information

lavad tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "$NEW_DETAILS" \
--from $WALLET \
--chain-id lava-testnet-2 \
--fees 300ulava \
-y

Validator details

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

Jailing info

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

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

Jail reason

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

Unjail command

lavad tx slashing unjail \
--chain-id lava-testnet-2 \
--gas-prices 0.005ulava \
--gas-adjustment 1.5 \
--from wallet \ # Or another wallet name
-y 

Information about delegation at your validator

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

Active Validators list

lavad 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

lavad 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

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

βš™οΈ Tokens Commands

Delegate to yourself

lavad tx staking delegate $(lavad keys show wallet --bech val -a) 1000000ulava --from wallet --chain-id lava-testnet-2 --gas-prices 0.000001ulava --gas-adjustment 1.5 -y 

Delegate to another validator

lavad tx staking delegate <TO_VALOPER_ADDRESS> 1000000ulava --from $WALLET --chain-id lava-testnet-2 --fees 300ulava -y

Redelegate your stake to other validator

lavad tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000ulava --from $WALLET --chain-id lava-testnet-2 --fees 300ulava -y

Unbond stake

lavad tx staking unbond $(lavad keys show $WALLET --bech val -a) 1000000ulava --from $WALLET --chain-id lava-testnet-2 --fees 300ulava -y

Send tokens

lavad tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000ulava --fees 300ulava -y

Check wallet balance

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

Transaction details

lavad query tx HASH_TX

Withdraw all rewards

lavad tx distribution withdraw-all-rewards --from $WALLET --chain-id lava-testnet-2 --fees 300ulava

Withdraw rewards and commission from your validator

lavad tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission --chain-id lava-testnet-2 --fees 300ulava -y

βš™οΈ Governance

List All Proposals

lavad query gov proposals

View proposal by ID

lavad query gov proposal ID

Vote "YES"

lavad tx gov vote PROPOSAL_ID yes --from wallet --chain-id lava-testnet-2 --gas-prices 0.000001ulava --gas-adjustment 1.5 -y 

Vote "NO"

lavad tx gov vote PROPOSAL_ID no --from wallet --chain-id lava-testnet-2 --gas-prices 0.000001ulava --gas-adjustment 1.5 -y 

Vote "NO_WITH_VETO"

lavad tx gov vote PROPOSAL_ID no_with_veto --from wallet --chain-id lava-testnet-2 --gas-prices 0.000001ulava --gas-adjustment 1.5 -y 

Vote "ABSTAIN"

lavad tx gov vote PROPOSAL_ID abstain --from wallet --chain-id lava-testnet-2 --gas-prices 0.000001ulava --gas-adjustment 1.5 -y 

Create new text proposal

lavad tx gov submit-proposal \
--title="Title" \ #Change Title
--description="Description" \
--deposit=1000000ulava \
--type="Text" \   #Change text proposal
--from=wallet \   #Change name wallet
--gas-prices=0.000001ulava \
--gas-adjustment=1.5 \
-y 

βš™οΈ Utility

Set Custom Port

# Change CUSTOM_PORT to any other value, or leave it as is.
CUSTOM_PORT=33
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%; s%:26657%:${CUSTOM_PORT}657%; s%:6060%:${CUSTOM_PORT}060%; s%:26656%:${CUSTOM_PORT}656%; s%:26660%:${CUSTOM_PORT}660%" $HOME/.lava/config/config.toml && sed -i.bak -e "s%:9090%:${CUSTOM_PORT}090%; s%:9091%:${CUSTOM_PORT}091%; s%:1317%:${CUSTOM_PORT}317%; s%:8545%:${CUSTOM_PORT}545%; s%:8546%:${CUSTOM_PORT}546%; s%:6065%:${CUSTOM_PORT}065%" $HOME/.lava/config/app.toml && sed -i.bak -e "s%:26657%:${CUSTOM_PORT}657%" $HOME/.lava/config/client.toml
sudo systemctl restart lavad
journalctl -u lavad -f -o cat

Set Indexer

sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.lava/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/.lava/config/app.toml

Reset node

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

Get denom info

lavad q bank denom-metadata -oj | jq

Get Node Peer

echo $(lavad tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.lava/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/.lava/

How much RAM use node (currently)

ps -p $(pgrep lavad) -o rss= | awk '{printf("The process uses memory:: %.2f MB\n", $1/1024)}'

How much CPU use node (currently)

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

Delete node

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

Last updated