Node CLI Cheatsheet
CLI Cheatsheet
- Always be careful with the capitalized words
- Specify
--chain-id
Wallet Management
Add Wallet Specify the value <wallet>
with your own wallet name
medasdigitald keys add wallet
Recover Wallet
medasdigitald keys add wallet --recover
List Wallet
medasdigitald keys list
Delete Wallet
medasdigitald keys delete wallet
Check Wallet Balance
medasdigitald q bank balances $(medasdigitald keys show wallet -a)
Validator Management
Please adjust <wallet>
, MONIKER
, YOUR_KEYBASE_ID
, YOUR_DETAILS
, YOUUR_WEBSITE_URL
Create Validator (Staking)
medasdigitald tendermint show-validator
nano /root/.medasdigital/validator.json
{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"......"},
"amount": "115000000umedas",
"moniker": "",
"identity": "",
"website": "https://service.vinjan.xyz",
"security": "",
"details": "Staking Provider-IBC Relayer",
"commission-rate": "0.05",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.05",
"min-self-delegation": "1"
}
medasdigitald tx staking create-validator $HOME/.medasdigital/validator.json \
--from wallet \
--chain-id medasdigital-2 \
--gas-prices 0.025umedas \
--gas-adjustment 1.5 \
--gas auto
Edit Validator
medasdigitald tx staking edit-validator \
--new-moniker="Vinjan.Inc" \
--identity="7C66E36EA2B71F68" \
--commission-rate="0.1" \
--chain-id=medasdigital-2 \
--from=wallet \
--gas-prices 0.025umedas \
--gas-adjustment 1.5 \
--gas auto
Unjail Validator
medasdigitald tx slashing unjail --from wallet --chain-id medasdigital-2
Check Jailed Reason
medasdigitald query slashing signing-info $(medasdigitald tendermint show-validator)
Token Management
Withdraw Rewards
medasdigitald tx distribution withdraw-all-rewards --from wallet --chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Withdraw Rewards with Comission
medasdigitald tx staking delegate $(medasdigitald keys show wallet --bech val -a) --commission --from wallet --chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Delegate Token to your own validator
medasdigitald tx staking delegate $(medasdigitald keys show wallet --bech val -a) 1000000umedas --from wallet --chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Delegate Token to other validator
medasdigitald tx staking redelegate $(medasdigitald keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000umedas --from wallet ---chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Unbond Token from your validator
medasdigitald tx staking unbond $(medasdigitald keys show wallet --bech val -a) 1000000umedas --from wallet --chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Send Token to another wallet
medasdigitald tx bank send wallet <TO_WALLET_ADDRESS> 1000000umeads --from wallet --chain-id medasdigital-2 --gas-adjustment 1.5 --gas-prices 0.025umedas --gas auto
Governance
Vote You can change the value of yes
to no
,abstain
,nowithveto
medasdigitald tx gov vote 2 yes --from wallet --chain-id medasdigital-2
Other
Set Your own Custom Ports You can change value CUSTOM_PORT=44
To any other ports
- PORT=23
sed -i.bak -e "s%^node = \"tcp://localhost:26657\"%node = \"tcp://localhost:23657\"%" $HOME/.medasdigital/config/client.toml
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:23658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:23657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:23060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:23656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":23660\"%" $HOME/.medasdigital/config/config.toml
sed -i.bak -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://localhost:23317\"%; s%^address = \"localhost:9090\"%address = \"localhost:23090\"%" $HOME/.medasdigital/config/app.toml
Enable Indexing usually enabled by default
sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.medasdigital/config/config.toml
Disable Indexing
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.medasdigital/config/config.toml
Reset Chain Data
medasdigitald tendermint unsafe-reset-all --home $HOME/.medasdigital --keep-addr-book
Delete Node
WARNING! Use this command wisely Backup your key first it will remove Defund from your system
sudo systemctl stop medasdigitald
sudo systemctl disable medasdigitald
sudo rm /etc/systemd/system/medasdigitald.service
sudo systemctl daemon-reload
rm -f $(which medasdigitald)
rm -rf .medasdigital
rm -rf medasdigital