How to withdraw validator rewards

Assuming you have a validator running, or have tokens staked to a validator, you'll eventually want to withdraw your rewards. Here's how to do it.

To find your validator address:

$ mtcli keys show <key name> --bech val -a
microvaloper15hs9l7mzjfe9s507l0sjg7d4ulmst2l2lcrtx4

To query your outstanding rewards:

$ mtcli query distribution rewards <owner address>

To query your outstanding commission:

$ mtcli query distribution commission <validator address>

To withdraw rewards and commission from a particular validator:

$ mtcli tx distrbution withdraw-rewards <validator address> --commission --from <owner address>

Withdraw rewards using offline signing:

On an online machine, query the account number, sequence number and chain ID parameters:

$ mtcli query auth account <owner address>

On any machine, generate the transaction and save into a file:

$ mtcli tx distribution withdraw-rewards <validator address> --commission --from <owner address> --generate-only --chain-id <chain ID>

On the offline machine with your account private key, sign the transaction you saved into the file in the last step:

$ mtcli tx sign <filename> --from <validator account> --offline --account-number <account number> --sequence <sequence number> --chain-id <chain ID>

On an online machine, broadcast the Tx:

$mtcli tx broadcast <filename>