mars-icon

Useful command mars hub

useful command , list of cli interactions to nodes mars hub

Note

1 MARS = 1000000umars
the first one you can use
                    
marsd --help
                    
to see a list of all available commands

gas-setting:
                        
# you may need to adjust the composition of the gas fee when doing cli with basic tx ,
example format :

--gas-prices # decimal format [AMOUNT]umars
--gas #  gas limit default is "200000"
--fees # format [AMOUNT]umars
--gas-adjustment # default "1"

                        
define your own combination
below is an example of the command, make sure you remove the `[ ]` and replace the value

keys :

  • add keys
    marsd keys add wallet
  • delete keys
    marsd keys delete wallet
  • recover keys from a seed passphrase
    marsd keys add wallet --recover
  • list all keys
    marsd keys list
  • tx-bank :

  • send balance
    marsd tx bank send wallet [TO_ADDRESS] [AMOUNT]umars \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • multi send balance
    marsd tx bank multi-send wallet [TO_ADDRESS1] [TO_ADDRESS2] [TO_ADDRESS3] [AMOUNT]umars \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • tx staking :

  • create-validator
    marsd tx staking create-validator \
    --amount 1000000umars \
    --pubkey $(marsd tendermint show-validator) \
    --chain-id mars-1 \
    --min-self-delegation 1 \
    --commission-max-change-rate 0.01 \
    --commission-max-rate 0.2 \
    --commission-rate 0.05 \
    --moniker ["VALIDATOR-MONIKER"] \
    --identity ["VALIDATOR-IDENTITY"] \
    --details ["VALIDATOR-DESCRIPTION"] \
    --website ["VALIDATOR-WEBSITE"] \
    --security-contact ["VALIDATOR-CONTACT"] \
    --from "wallet" \
    --gas "200000"
    
  • edit-validator
    marsd tx staking edit-validator \
    --chain-id mars-1 \
    --commission-rate 0.05 \
    --new-moniker ["NEW-VALIDATOR-MONIKER"] \
    --identity ["NEW-VALIDATOR-IDENTITY"] \
    --details ["NEW-VALIDATOR-DESCRIPTION"] \
    --website ["NEW-VALIDATOR-WEBSITE"] \
    --security-contact ["NEW-VALIDATOR-CONTACT"] \
    --from "wallet" \
    --gas "200000"
  • delegate / stake
    marsd tx staking delegate [TO_VALOPER_ADDRESS] [AMOUNT]umars \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • redelegate
    marsd tx staking redelegate [SRC_VALOPER_ADDRESS] [TO_VALOPER_ADDRESS] [AMOUNT]umars \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • tx slashing :

  • unjail-validator
    marsd tx slashing unjail \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • tx gov :

  • query all proposals:
    marsd query gov proposals
  • query specific proposals by id:
    marsd query gov proposal [PROPOSAL_ID]
  • vote proposal:

    OPTION_VALUE: yes , no , no_with_veto and abstain

    marsd tx gov vote [PROPOSAL_ID] [OPTION] \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • tx distribution :

  • Withdraw all rewards :
    marsd tx distribution withdraw-all-rewards \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"
  • Withdraw reward and commission:
    marsd tx distribution withdraw-rewards $(marsd keys show wallet --bech val -a) \
    --commission \
    --chain-id mars-1 \
    --from "wallet" \
    --gas "200000"