# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export OJO_CHAIN_ID="ojo-devnet"" >> $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
ojod keys add wallet

#Recover Wallet
ojod keys add wallet --recover

#List Wallet
ojod keys list

#Delete Wallet
ojod keys delete wallet

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

### VALIDATOR MANAGEMENT

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

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

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

#Unjail Validator
ojod tx slashing unjail --from wallet --chain-id $OJO_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uojo -y

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

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
ojod tx distribution withdraw-all-rewards --from wallet --chain-id $OJO_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uojo -y

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

#Delegate Token to your own validator
ojod tx staking delegate $(ojod keys show wallet --bech val -a) 100000000uojo --from wallet --chain-id $OJO_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uojo -y

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

#Unbond Token from your validator
ojod tx staking unbond $(ojod keys show wallet --bech val -a) 1000000000uojo --from wallet --chain-id $OJO_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uojo -y

#Send Token to another wallet
ojod tx bank send wallet <TO_WALLET_ADDRESS> 100000000uojo --from wallet --chain-id $OJO_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uojo -y

```

### GOVERNANCE

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

#List all proposals
ojod query gov proposals

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

### SERVICES MANAGEMENT

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

# Enable Service
sudo systemctl enable ojod

# Disable Service
sudo systemctl disable ojod

# Start Service
sudo systemctl start ojod

# Stop Service
sudo systemctl stop ojod

# Restart Service
sudo systemctl restart ojod

# Check Service Status
sudo systemctl status ojod

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

### UTILITY

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

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

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

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

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

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