# Useful commands

```bash
# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export ENTANGLE_CHAIN_ID="entangle_33033-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
entangled keys add wallet

#Recover Wallet
entangled keys add wallet --recover

#List Wallet
entangled keys list

#Delete Wallet
entangled keys delete wallet

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

### VALIDATOR MANAGEMENT

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

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

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

#Unjail Validator
entangled tx slashing unjail --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y

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

### TOKEN MANAGEMENT

```bash
#Withdraw Rewards
entangled tx distribution withdraw-all-rewards --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y

#Withdraw Rewards with Comission
entangled tx distribution withdraw-rewards $(entangled keys show wallet --bech val -a) --commission --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y

#Delegate Token to your own validator
entangled tx staking delegate $(entangled keys show wallet --bech val -a) 100000000aNGL --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y

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

#Unbond Token from your validator
entangled tx staking unbond $(entangled keys show wallet --bech val -a) 1000000000aNGL --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y

#Send Token to another wallet
entangled tx bank send wallet <TO_WALLET_ADDRESS> 100000000aNGL --from wallet --chain-id $ENTANGLE_CHAIN_ID --gas-adjustment 1.5 --gas auto --gas-prices 20aNGL -y
```

### GOVERNANCE

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

#List all proposals
entangled query gov proposals

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

### SERVICES MANAGEMENT

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

# Enable Service
sudo systemctl enable entangled

# Disable Service
sudo systemctl disable entangled

# Start Service
sudo systemctl start entangled

# Stop Service
sudo systemctl stop entangled

# Restart Service
sudo systemctl restart entangled

# Check Service Status
sudo systemctl status entangled

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

### UTILITY

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

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

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

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

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

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