# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export CASCADIA_CHAIN_ID="cascadia_6102-1"" >> $HOME/.bash_profile
source $HOME/.bash_profile
```

### WALLET MANAGEMENT

{% hint style="info" %}
*Add Wallet Specify the value \<wallet> with your own wallet name*
{% endhint %}

```bash
#Create Wallet
cascadiad keys add wallet

#Recover Wallet
cascadiad keys add wallet --recover

#List Wallet
cascadiad keys list

#Delete Wallet
cascadiad keys delete wallet

#Check Wallet Balance
cascadiad q bank balances $(cascadiad keys show wallet -a)
```

### VALIDATOR MANAGEMENT

{% hint style="info" %}
*Please adjust , MONIKER , YOUR\_KEYBASE\_ID , YOUR\_DETAILS , YOUR\_WEBSITE\_URL*
{% endhint %}

```bash
#Create Validator
cascadiad tx staking create-validator \
--amount=10000000aCC \
--pubkey=$(cascadiad tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$CASCADIA_CHAIN_ID \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1000 \
--from=wallet \
--gas-adjustment 1.5 \
--gas="auto" \
--gas-prices=10aCC \
-y

#Edit Validator
cascadiad tx staking edit-validator \
--new-moniker="YOUR MONIKER" \
--identity="IDENTITY KEYBASE" \
--details="DETAILS VALIDATOR" \
--website="LINK WEBSITE" \
--chain-id=$CASCADIA_CHAIN_ID \
--from=wallet \
--gas-adjustment=1.5 \
--gas="auto" \
--gas-prices=10aCC \
-y

#Unjail Validator
cascadiad tx slashing unjail --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Check Jailed Reason
cascadiad query slashing signing-info $(cascadiad tendermint show-validator)
```

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
cascadiad tx distribution withdraw-all-rewards --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Withdraw Rewards with Comission
cascadiad tx distribution withdraw-rewards $(cascadiad keys show wallet --bech val -a) --commission --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Delegate Token to your own validator
cascadiad tx staking delegate $(cascadiad keys show wallet --bech val -a) 1000000aCC --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Delegate Token to other validator
cascadiad tx staking redelegate $(cascadiad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000aCC --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Unbond Token from your validator
cascadiad tx staking unbond $(cascadiad keys show wallet --bech val -a) 1000000aCC --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#Send Token to another wallet
cascadiad tx bank send wallet <TO_WALLET_ADDRESS> 1000000uaum --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y
```

### GOVERNANCE

```bash
#Vote You can change the value of yes to no,abstain,nowithveto
cascadiad tx gov vote 1 yes --from wallet --chain-id $CASCADIA_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10aCC -y

#List all proposals
cascadiad query gov proposals

#Create new text proposal
cascadiad tx gov submit-proposal \
--title="Title" \
--description="Description" \
--deposit=100000000aCC \
--type="Text" \
--from=wallet \
--gas-prices=10aCC \ 
--gas-adjustment=1.5 \
--gas="auto" \
-y  
```

### SERVICES MANAGEMENT

```bash
# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable cascadiad

# Disable Service
sudo systemctl disable cascadiad

# Start Service
sudo systemctl start cascadiad

# Stop Service
sudo systemctl stop cascadiad

# Restart Service
sudo systemctl restart cascadiad

# Check Service Status
sudo systemctl status cascadiad

# Check Service Logs
sudo journalctl -u cascadia -f --no-hostname -o cat

```

### UTILITY

```bash
#Set Indexer NULL / KV
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.cascadiad/config/config.toml

#Get Validator info
cascadiad status 2>&1 | jq .ValidatorInfo

#Get denom info
cascadiad q bank denom-metadata -oj | jq

#Get sync status
cascadiad status 2>&1 | jq .SyncInfo.catching_up

#Get latest height
cascadiad status 2>&1 | jq .SyncInfo.latest_block_height

#Reset Node
cascadiad tendermint unsafe-reset-all --home $HOME/.cascadiad --keep-addr-book
```

### DELETE NODE

{% hint style="warning" %} <mark style="color:red;">**WARNING! Use this command wisely Backup your key first it will remove node from your system**</mark>
{% endhint %}

```bash
sudo systemctl stop cascadiad && sudo systemctl disable cascadiad && sudo rm /etc/systemd/system/cascadiad.service && sudo systemctl daemon-reload && sudo rm -rf $(which cascadiad) && rm -rf $HOME/.cascadiad && rm -rf $HOME/cascadia
```
