Command Source

This is command about CLI Source

Key Management

we assume, variable name_your_wallet is name of your own wallet.

Install jq package for management json format

Ubuntu

apt install jq

CentOS

yum install jq

Arch Linux

pacman -S jq

Running in user (Assume) : salinem

We never use this username in our production!

Gas Fee

--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5

Add New Key

sourced keys add mywallet --home ${HOME}/.source 

Recover Key

With Passphrase

sourced keys add mywallet --recover  --home ${HOME}/.source       

With Keyring

sourced keys add mywallet --recover --keyring-backend os --home ${HOME}/.source       

List Key

sourced keys list --home ${HOME}/.source    

Delete Key

sourced keys delete mywallet --home ${HOME}/.source

Export Key

 sourced keys export mywallet --home ${HOME}/.source

Import Key

sourced keys import mywallet mywallet_file.backup --home ${HOME}/.source

Show All Balances Address

for mywallet in `sourced keys list --home ${HOME}/.source--output json| jq -r ".[] .address"`
do
   CHAIN_ID="source-1"
   RPC="http://localhost:16702"
   sourced q bank balances ${mywallet} --home ${HOME}/.source --chain-id ${CHAIN_ID} --node ${RPC}
done

Show Balance Address

sourced q bank balances mywallet_public_address --home ${HOME}/.source --chain-id source-1 --node http://localhost:16702

Validator Management

We assume,You have complete identities. Moniker, Website, Security and Details Your Validator

Install jq package for management json format

Ubuntu

apt install jq

CentOS

yum install jq

Arch Linux

pacman -S jq

Create New Validator

MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sourced tx staking create-validator \
--amount=1000000usource \
--pubkey=$(sourced tendermint show-validator --home ${HOME}/.source) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=source-1 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y

Edit Validator Identities Informations

MONIKER="NAME_OF_YOUR_VALIDATOR"
PROFILE="PGP_KEY_OF_KEYBASE"
DETAILS="Describes Your Validator"
WEBSITE="https://yourwebsite.com"

sourced tx staking edit-validator \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=source-1 \
--commission-rate=0.05 \
--from=mywallet \
--node http://localhost:16702 \
--home ${HOME}/.source \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y

Get Validator Info

sourced status 2>&1 | jq .ValidatorInfo

Get Syncing Block

sourced status 2>&1 | jq .SyncInfo

Get Peer Own Node

echo $(sourced tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.source/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Get Peer Node

curl -sS http://localhost:16701/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

Unjail Validator

sourced tx slashing unjail \
--from mywallet \
--chain-id source-1 \
 --home ${HOME}/.source\
 --node  http://localhost:16702 \
 --gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
 -y

Jail Reason

sourced query slashing signing-info $(sourced tendermint show-validator) \
 --node  http://localhost:16702 \
 --home ${HOME}/.source

List All Active Validator

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

List All Inactive Validator

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

Show Validator Details

sourced \
query staking validator \
$(sourced keys show \ 
                $(sourced keys list --home ${HOME}/.source--output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id source-1 \
--node http://localhost:16702

Token Management

Withdraw All Reward From Validator

sourced tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id source-1 \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y

Withdraw Commision Reward From Validator

sourced tx distribution withdraw-rewards $(sourced keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id source-1 \
--node http://localhost:16702 \
--home ${HOME}/.source\
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

Delegate My Token to Own Validator

sourced tx staking delegate $(sourced keys show wallet --bech val -a) 100000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y

Delegate Your Token To Our Validator

sourced tx staking delegate prefixVALOPExxxxxx 100000usource \ 
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y

Redelegate Tokens to Another Validator

sourced tx staking redelegate $(sourced keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000usource \
--from mywallet 
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

Unbound or Unstake Your Tokens

sourced tx staking unbond $(sourced keys show wallet --bech val -a) 1000000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

Send tokens to the wallet

sourced tx bank send wallet <TO_WALLET_ADDRESS> 1000000usource \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

Governance

Install jq package for management json format

Ubuntu

apt install jq

CentOS

yum install jq

Arch Linux

pacman -S jq

List All Proposal

sourced query gov proposals

How to Vote

### vote yes
sourced tx gov vote 1 yes \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote no
sourced tx gov vote 1 no \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote abstain
sourced tx gov vote 1 abstain \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

### vote No With Veto
sourced tx gov vote 1 nowithveto \
--from mywallet \
--home ${HOME}/.source\
--node http://localhost:16702 \
--chain-id source-1 \
--gas=1000000 --gas-prices=30000000000usource --gas-adjustment=1.5 \
-y 

Last updated