Useful commands
List of commands used to manage the validator and node
Wallet interaction
Create Wallet
structsd keys add <WALLET_NAME>
Restore wallet
structsd keys add <WALLET_NAME> --recover
Show all wallets
Delete wallet
structsd keys delete <WALLET_NAME>
Export wallet
structsd keys export <WALLET_NAME>
Import wallet
structsd keys import <WALLET_NAME> <WALLET_NAME>.backup
Show balance
query <WALLET_NAME> balance
Validator control
Create a validator
structsd tx staking create-validator \
--chain-id structstestnet-74 \
--commission-rate 0.05 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.1 \
--min-self-delegation "1" \
--amount 100alpha \
--pubkey $(structsd tendermint show-validator) \
--moniker "<YOUR_MONIKER>" \
--from <WALLET_NAME> \
--gas auto
Edit validator
tx staking edit-validator \
--new-moniker="<YOUR_MONIKER_NAME>" \
--identity="<YOUR_KEYBASE_ID>" \
--details="<YOUR_DETAILS>" \
--website="<YOUR_WEBSITE_URL>"
--chain-id structstestnet-74 \
--commission-rate="0.10" \
--from=<WALLET_NAME> -y
Unjail
structsd tx slashing unjail --from <WALLET_NAME> chain-id structstestnet-74 -y
Jail reason
structsd query slashing signing-info $(structsd tendermint show-validator)
Active validators
structsd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Inactive validators
structsd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Information about the validator
structsd q staking validator $(structsd keys show <WALLET_NAME> --bech val -a)
Balance management
Withdrawal of all rewards
structsd tx distribution withdraw-all-rewards --from <WALLET_NAME> --gas auto -y
Withdrawal of rewards and commissions
structsd tx distribution withdraw-rewards <WALLET_NAME> --from <WALLET_NAME> --gas auto --commission -y
Self-delegation
structsd tx staking delegate <WALLET_NAME> 1000000alpha --from <WALLET_NAME> --gas auto -y
Delegation to validator
structsd tx staking delegate <TO_VALOPER_ADDRESS> 1000000alpha --from <WALLET_NAME> chain-id
Redelegation to another validator
structsd tx staking redelegate $(structsd keys show <WALLET_NAME> --bech val -a) <TO_VALOPER_ADDRESS> 1000000alpha --from <WALLET_NAME> chain-id structstestnet-74 -y
Unbond tokens
structsd tx staking unbond $(structsd keys show <WALLET_NAME> --bech val -a) 1000000alpha --from <WALLET_NAME> chain-id structstestnet-74 -y
Sending tokens to a wallet
structsd tx bank send <WALLET_NAME> <TO_<WALLET_ADDRESS> 1000000alpha --from <WALLET_NAME> chain-id structstestnet-74
Governance
All proposals
structsd query gov proposals
All proposals by ID
structsd query gov proposal 1
Vote "YES"
structsd tx gov vote 1 yes --from <WALLET_NAME> chain-id structstestnet-74 -y
Vote "NO"
structsd tx gov vote 1 no --from <WALLET_NAME> chain-id structstestnet-74 -y
Vote "Abstain"
structsd tx gov vote 1 abstain --from <WALLET_NAME> chain-id structstestnet-74 -y
Vote "NoWithVeto"
structsd tx gov vote 1 nowithveto --from <WALLET_NAME> chain-id structstestnet-74 -y
Utility
Update ports
CUSTOM_PORT=10
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/.structs/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\"%" $HOME/.structs/config/app.toml
Disable Indexer
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.structs/config/config.toml
Enable Indexer
sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.structs/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 = "10"|' $HOME/.structs/config/app.toml
Node support
Validator Info
structsd status 2>&1 | jq .ValidatorInfo
Sync info
structsd status 2>&1 | jq .SyncInfo
Deleting a node
Before deleting a node make sure you save priv_validator_key.json
systemctl stop structsd
systemctl disable structsd
rm /etc/systemd/system/structsd.service
systemctl daemon-reload
cd $HOME
rm -rf .structs structsd
rm -rf $(which structsd)
Service setup
Reload service configuration
sudo systemctl daemon-reload
Enable service
sudo systemctl enable structsd
Disable service
sudo systemctl disable structsd
Start service
sudo systemctl start structsd
Stop service
sudo systemctl stop structsd
Restart service
sudo systemctl restart structsd
Check service status
sudo systemctl status structsd
Check service logs
sudo journalctl -u structsd -f --no-hostname -o cat
Last updated