# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export HEDGE_CHAIN_ID="berberis-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
#Add new wallet
hedged keys add wallet

#Recover Wallet
hedged keys add wallet --recover

#List Wallet
hedged keys list

#Delete Wallet
hedged keys delete wallet

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

### VALIDATOR MANAGEMENT

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

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

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

#Unjail Validator
hedged tx slashing unjail --from wallet --chain-id $HEDGE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uhedge -y

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

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
hedged tx distribution withdraw-all-rewards --from wallet --chain-id $HEDGE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 10uhedge -y

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

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

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

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

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

### GOVERNANCE

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

#List all proposals
hedged query gov proposals

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

### SERVICES MANAGEMENT

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

# Enable Service
sudo systemctl enable hedged

# Disable Service
sudo systemctl disable hedged

# Start Service
sudo systemctl start hedged

# Stop Service
sudo systemctl stop hedged

# Restart Service
sudo systemctl restart hedged

# Check Service Status
sudo systemctl status hedged

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

### UTILITY

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

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

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

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

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.syanodes.my.id/hedge/useful-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
