# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export BABYLOND_CHAIN_ID="bbn-test-2"" >> $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
babylond keys add wallet

#Recover Wallet
babylond keys add wallet --recover

#List Wallet
babylond keys list

#Delete Wallet
babylond keys delete wallet

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

### VALIDATOR MANAGEMENT

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

```bash
#Create Validator
babylond tx staking create-validator \
--amount=10000000ubbn \
--pubkey=$(babylond tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=$BABYLOND_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=10ubbn \
-y

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

#Unjail Validator
babylond tx slashing unjail --from wallet --chain-id $BABYLOND_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10ubbn -y

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

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
babylond tx distribution withdraw-all-rewards --from wallet --chain-id $BABYLOND_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10ubbn -y

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

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

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

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

#Send Token to another wallet
babylond tx bank send wallet <TO_WALLET_ADDRESS> 1000000ubbn --from wallet --chain-id $BABYLOND_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10ubbn -y

```

### GOVERNANCE

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

#List all proposals
babylond query gov proposals

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

```

### SERVICES MANAGEMENT

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

# Enable Service
sudo systemctl enable babylond

# Disable Service
sudo systemctl disable babylond

# Start Service
sudo systemctl start babylond

# Stop Service
sudo systemctl stop babylond

# Restart Service
sudo systemctl restart babylond

# Check Service Status
sudo systemctl status babylond

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

### UTILITY

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

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

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

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

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

#Reset Node
babylond tendermint unsafe-reset-all --home $HOME/.babylond --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 babylond && sudo systemctl disable babylond && sudo rm /etc/systemd/system/babylond.service && sudo systemctl daemon-reload && sudo rm -rf $(which babylond) && rm -rf $HOME/.babylond && rm -rf $HOME/babylon
```
