Skip to content

📑 Safrochain Cheat Sheet

🔧 Service Operations

Check logs

sudo journalctl -u safrochaind -fo cat

Check service status

sudo systemctl status safrochaind

Node info

safrochaind status 2>&1 | jq

Start service

sudo systemctl start safrochaind

Stop service

sudo systemctl stop safrochaind

Restart service

sudo systemctl restart safrochaind

Reload services

sudo systemctl daemon-reload

Enable service

sudo systemctl enable safrochaind

Disable service

sudo systemctl disable safrochaind

🔑 Key Management

Add New Wallet

safrochaind keys add $WALLET

Restore executing wallet

safrochaind keys add $WALLET --recover

List All Wallets

safrochaind keys list

Delete wallet

safrochaind keys delete $WALLET

Check Balance

safrochaind q bank balances $WALLET_ADDRESS

Export Key (save to wallet.backup)

safrochaind keys export $WALLET

View EVM Private Key

safrochaind keys unsafe-export-eth-key $WALLET

Import Key (restore from wallet.backup)

safrochaind keys import $WALLET wallet.backup

💰 Tokens

Withdraw all rewards

safrochaind tx distribution withdraw-all-rewards --from $WALLET --chain-id safro-testnet-1 --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Withdraw rewards and commission from your validator

safrochaind tx distribution withdraw-rewards $VALOPER_ADDRESS --from $WALLET --commission  --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Check your balance

safrochaind query bank balances $WALLET_ADDRESS

Delegate to Yourself

safrochaind tx staking delegate $(safrochaind keys show $WALLET --bech val -a) 1000000usaf --from $WALLET  --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Delegate

safrochaind tx staking delegate <TO_VALOPER_ADDRESS> 1000000usaf --from $WALLET --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Redelegate Stake to Another Validator

safrochaind tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000usaf --from $WALLET  --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Unbond

safrochaind tx staking unbond $(safrochaind keys show $WALLET --bech val -a) 1000000usaf --from $WALLET --chain-id safro-testnet-1 --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

Transfer Funds

safrochaind tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000usaf --from $WALLET --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf -y

🛡️ Validator Operations

Validator info

safrochaind status 2>&1 | jq

Validator Details

safrochaind q staking validator $(safrochaind keys show $WALLET --bech val -a)

Jailing info

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

Slashing parameters

safrochaind q slashing params

Unjail validator

safrochaind tx slashing unjail --from $WALLET --chain-id safro-testnet-1   --gas auto --gas-adjustment 1.2 --fees 50000usaf   -y

Active Validators List

safrochaind 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

[[ $(safrochaind q staking validator $VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(safrochaind status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"

Signing info

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

Edit Validator

safrochaind tx staking edit-validator \
--commission-rate 0.05 \
--new-moniker "$MONIKER" \
--identity "" \
--details "Kyronode for all" \
--from $$WALLET \
--chain-id safro-testnet-1 \
--gas auto \
--gas-adjustment 1.2 \
--fees 50000usaf \
-y

🏛 Governance

Proposals List

safrochaind query gov proposals

View proposal

safrochaind query gov proposal 1

Vote

safrochaind tx gov vote 1 yes --from $$WALLET --chain-id safro-testnet-1 --gas auto --gas-adjustment 1.2 --fees 50000usaf   -y