Useful commands

Useful commands

Key Management

Add new key

Copy

swisstronikd keys add wallet

Recover existing key

Copy

swisstronikd keys add wallet --recover

List All key

Copy

swisstronikd keys list

Delete key

Copy

swisstronikd keys delete wallet

Export Key (save to wallet.backup)

Copy

swisstronikd keys export wallet

Import key

Copy

swisstronikd keys import wallet wallet.backup

Query Wallet Balance

Copy

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

Validator Management

Create Validator

Copy

swisstronikd tx staking create-validator \
  --amount "1000000uswrt" \
  --pubkey $(swisstronikd tendermint show-validator) \
  --moniker "<MONIKER>" \
  --identity "" \
  --website "YOUR WEBSITE" \
  --chain-id swisstronik_1291-1 \
  --commission-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-max-change-rate "0.01" \
  --min-self-delegation "1" \
  --gas-prices 7uswrt \
  --gas "auto" \
  --gas-adjustment "1.5" \
  --from wallet \
  -y

Edit Validator

Copy

swisstronikd tx staking edit-validator \
--new-moniker "<MONIKER>" \
--identity "" \
--details "Indonode Guide" \
--website "YOUR WEBSITE" \
--chain-id swisstronik_1291-1 \
--commission-rate "0.01" \
--gas-prices 7uswrt \
--gas "auto" \
--gas-adjustment "1.5" \
--from wallet \
-y

Unjail Validator

Copy

swisstronikd tx slashing unjail \
--chain-id swisstronik_1291-1 \
--gas-prices 7uswrt \
--gas-adjustment 1.5\
--gas "auto" \
--from wallet \
-y 

Signing Info

Copy

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

List all active validators

Copy

swisstronikd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl 

List all inactive validators

Copy

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

View validators details

Copy

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

Token Management

To valoper addressTo wallet addressAmount, uswrt

Withdraw rewards from all validators

Copy

swisstronikd tx distribution withdraw-all-rewards --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Withdraw comission and rewards from your validator

Copy

swisstronikd tx distribution withdraw-rewards $(swisstronikd keys show wallet --bech val -a) --commission --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Delegate to your validator

Copy

swisstronikd tx staking delegate $(swisstronikd keys show wallet --bech val -a) 1000000uswrt --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Delegate to other

Copy

c4ed tx staking delegate <TO_VALOPER_ADDRESS> 1000000uswrt --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Redelegate your stake to other validators

Copy

swisstronikd tx staking redelegate $(swisstronikd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uswrt --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Unbond stake

Copy

swisstronikd tx staking unbond $(swisstronikd keys show wallet --bech val -a) 1000000uswrt --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Send tokens

Copy

swisstronikd tx bank send wallet <TO_WALLET_ADDRESS> 1000000uswrt --from wallet --chain-id swisstronik_1291-1 --gas-prices 7uswrt  --gas-adjustment 1.5 --gas "auto" -y 

Governance

Create new text proposal

Copy

swisstronikd tx gov submit-proposal \
--title "" \
--description "" \
--deposit "1000000uswrt" \
--type "Text" \
--from wallet \
--gas-prices 7uswrt \ 
--gas-adjustment 1.5 \
--gas "auto" \
-y 

List all proposals

Copy

swisstronikd query gov proposals

Proposal IDProposal optionYesNoNo with vetoAbstain

Vote

Copy

swisstronikd tx gov vote 1 yes \
--from wallet \
--chain-id swisstronik_1291-1 \
--gas-prices 7uswrt \
--gas-adjustment 1.5 \
--gas "auto" \
-y 

Utility

Set IndexerNULLKV

Copy

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

Get Validator info

Copy

swisstronikd status 2>&1 | jq .ValidatorInfo

Get denom info

Copy

swisstronikd q bank denom-metadata -oj | jq

Get sync status

Copy

swisstronikd status 2>&1 | jq .SyncInfo.catching_up

Get latest height

Copy

swisstronikd status 2>&1 | jq .SyncInfo.latest_block_height

Reset Node

Copy

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

Delete Node

Copy

cd $HOME && sudo systemctl stop swisstronikd && sudo systemctl disable swisstronikd && sudo rm /etc/systemd/system/swisstronikd.service && sudo systemctl daemon-reload && sudo rm -rf $(which swisstronikd) && sudo rm -rf $HOME/.swisstronik && sudo rm -rf $(which swisstronikd) 

Services Management

Reload Service

Copy

sudo systemctl daemon-reload

Enable Service

Copy

sudo systemctl enable swisstronikd

Disable Service

Copy

sudo systemctl disable swisstronikd

Start Service

Copy

sudo systemctl start swisstronikd

Stop Service

Copy

sudo systemctl stop swisstronikd

Restart Service

Copy

sudo systemctl restart swisstronikd

Check Service Status

Copy

sudo systemctl status swisstronikd

Check Service Logs

Copy

sudo journalctl -u swisstronikd -f --no-hostname -o cat

Last updated