# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export NIBIRU_CHAIN_ID="nibiru-itn-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
nibid keys add wallet

#Recover Wallet
nibid keys add wallet --recover

#List Wallet
nibid keys list

#Delete Wallet
nibid keys delete wallet

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

### VALIDATOR MANAGEMENT

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

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

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

#Unjail Validator
nibid tx slashing unjail --from wallet --chain-id $NIBIRU_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10unibi -y

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

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
nibid tx distribution withdraw-all-rewards --from wallet --chain-id $NIBIRU_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10unibi -y

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

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

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

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

#Send Token to another wallet
nibid tx bank send wallet <TO_WALLET_ADDRESS> 1000000unibi --from wallet --chain-id $NIBIRU_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10unibi -y
```

### GOVERNANCE

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

#List all proposals
nibid query gov proposals

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

### SERVICES MANAGEMENT

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

# Enable Service
sudo systemctl enable nibid

# Disable Service
sudo systemctl disable nibid

# Start Service
sudo systemctl start nibid

# Stop Service
sudo systemctl stop nibid

# Restart Service
sudo systemctl restart nibid

# Check Service Status
sudo systemctl status nibid

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

### UTILITY

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

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

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

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

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

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