Mainnet
Safrochain
- Chain ID
- Version
- Go
Run these after the install guide, which sets $WALLET, $MONIKER and the chain variables.
Keys and wallet
Add a new key
safrochaind keys add $WALLETRecover a key
safrochaind keys add $WALLET --recoverList keys
safrochaind keys listWallet balance
safrochaind q bank balances $(safrochaind keys show $WALLET -a)
Validator
Create a validator
cat > $HOME/validator.json << EOF { "pubkey": $(safrochaind comet show-validator), "amount": "1000000usaf", "moniker": "$MONIKER", "identity": "", "website": "", "security": "", "details": "", "commission-rate": "0.05", "commission-max-rate": "0.20", "commission-max-change-rate": "0.05", "min-self-delegation": "1" } EOF safrochaind tx staking create-validator $HOME/validator.json --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yEdit the validator
safrochaind tx staking edit-validator --new-moniker "$MONIKER" --identity "" --website "" --details "" --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yUnjail
safrochaind tx slashing unjail --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yValidator details
safrochaind q staking validator $(safrochaind keys show $WALLET --bech val -a)
Tokens
Withdraw all rewards
safrochaind tx distribution withdraw-all-rewards --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yWithdraw commission and rewards
safrochaind tx distribution withdraw-rewards $(safrochaind keys show $WALLET --bech val -a) --commission --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yDelegate to yourself
safrochaind tx staking delegate $(safrochaind keys show $WALLET --bech val -a) 1000000usaf --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yRedelegate
safrochaind tx staking redelegate $(safrochaind keys show $WALLET --bech val -a) <TO_VALOPER> 1000000usaf --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -yUnbond
safrochaind tx staking unbond $(safrochaind keys show $WALLET --bech val -a) 1000000usaf --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -ySend tokens
safrochaind tx bank send $WALLET <TO_ADDRESS> 1000000usaf --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -y
Governance
List proposals
safrochaind q gov proposalsView a proposal
safrochaind q gov proposal <ID>Vote
safrochaind tx gov vote <ID> yes --from $WALLET --chain-id $SAF_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.05usaf -y # yes | no | abstain | no_with_veto
Maintenance
Node status
safrochaind status 2>&1 | jqNode peer address
echo $(safrochaind comet show-node-id)@$(wget -qO- eth0.me):$SAF_PORT656Live peers
curl -s localhost:$SAF_PORT657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr | split(":") | last)"' | paste -sd,Check the validator key
[[ $(safrochaind q staking validator $(safrochaind keys show $WALLET --bech val -a) -o json | jq -r .validator.consensus_pubkey.value) = $(safrochaind comet show-validator | jq -r .key) ]] && echo "match" || echo "MISMATCH"Reset chain data
safrochaind comet unsafe-reset-all --keep-addr-book --home $HOME/.safrochainRemove the node
sudo systemctl stop safrochaind sudo systemctl disable safrochaind sudo rm /etc/systemd/system/safrochaind.service sudo systemctl daemon-reload rm -rf $HOME/.safrochain $(which safrochaind)
Service
Service status
sudo systemctl status safrochaindFollow logs
sudo journalctl -fu safrochaind -o catRestart
sudo systemctl restart safrochaindStop
sudo systemctl stop safrochaind