# Useful commands

### Service operations  <a href="#service-operations" id="service-operations"></a>

Check logs

```bash
sudo journalctl -u canined -f
```

Start service

```bash
sudo systemctl start canined 
```

Stop service

```bash
sudo systemctl stop canined 
```

Restart service

```bash
sudo systemctl restart canined 
```

Check service status

```bash
sudo systemctl status canined 
```

Reload services

```bash
sudo systemctl daemon-reload
```

Enable Service

```bash
sudo systemctl enable canined 
```

Disable Service

```bash
sudo systemctl disable canined 
```

Node info

```bash
canined status 2>&1 | jq
```

Your node peer

```bash
echo $(canined tendermint show-node-id)'@'$(wget -qO- eth0.me)':'$(cat $HOME/.canine/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

```

### Key management <a href="#key-management" id="key-management"></a>

Add New Wallet

```bash
canined keys add $WALLET
```

Restore executing wallet

```bash
canined keys add $WALLET --recover
```

List All Wallets

```bash
canined keys list
```

Delete wallet

```bash
canined keys delete $WALLET
```

Check Balance

```bash
canined q bank balances $WALLET_ADDRESS 
```

Export Key (save to wallet.backup)

```bash
canined keys export $WALLET
```

View EVM Prived Key

```bash
canined keys unsafe-export-eth-key $WALLET
```

Import Key (restore from wallet.backup)

```bash
canined keys import $WALLET wallet.backup
```

### Tokens <a href="#tokens" id="tokens"></a>

**WITHDRAW REWARDS FROM ALL VALIDATORS**

```
canined tx distribution withdraw-all-rewards --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**WITHDRAW COMMISSION AND REWARDS FROM YOUR VALIDATOR**

```
canined tx distribution withdraw-rewards $(canined keys show wallet --bech val -a) --commission --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**DELEGATE TOKENS TO YOURSELF**

```
canined tx staking delegate $(canined keys show wallet --bech val -a) 1000000ujkl --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**DELEGATE TOKENS TO VALIDATOR**

```
canined tx staking delegate <TO_VALOPER_ADDRESS> 1000000ujkl --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**REDELEGATE TOKENS TO ANOTHER VALIDATOR**

```
canined tx staking redelegate $(canined keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000ujkl --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**UNBOND TOKENS FROM YOUR VALIDATOR**

```
canined tx staking unbond $(canined keys show wallet --bech val -a) 1000000ujkl --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**SEND TOKENS TO THE WALLET**

```
canined tx bank send wallet <TO_WALLET_ADDRESS> 1000000ujkl --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

### Governance <a href="#governance" id="governance"></a>

**LIST ALL PROPOSALS**

```
canined query gov proposals
```

**VIEW PROPOSAL BY ID**

```
canined query gov proposal 1
```

**VOTE ‘YES’**

```
canined tx gov vote 1 yes --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**VOTE ‘NO’**

```
canined tx gov vote 1 no --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**VOTE ‘ABSTAIN’**

```
canined tx gov vote 1 abstain --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

**VOTE ‘NOWITHVETO’**

```
canined tx gov vote 1 NoWithVeto --from wallet --chain-id lupulella-2 --gas-adjustment 1.4 --gas auto --gas-prices 0.002ujkl -y
```

### Validator operations <a href="#validator-operations" id="validator-operations"></a>

Create New Validator

```bash
canined tx staking create-validator \
  --amount 1000000ujkl \
  --from <yourwallet> \
  --commission-max-change-rate "0.1" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(canined tendermint show-validator) \
  --moniker $yourMONIKER \
  --chain-id lupulella-2 \
  --identity="" \
  --details="" \
  --website="" -y
```

Edit Existing Validator

```bash
canined tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "$MONIKER" \
--identity "" \
--details "" \
--from $WALLET \
--chain-id lupulella-2 \
--gas auto --gas-adjustment 1.5 \
-y 
```

Validator info

```bash
canined status 2>&1 | jq
```

Validator Details

```bash
canined q staking validator $(canined keys show $WALLET --bech val -a) 
```

Jailing info

```bash
canined q slashing signing-info $(canined tendermint show-validator) 
```

Slashing parameters

```bash
canined q slashing params 
```

Unjail validator

```bash
canined tx slashing unjail --from $WALLET --chain-id lupulella-2 --gas auto --gas-adjustment 1.5 -y 
```

Active Validators List

```bash
canined q staking validators -oj --limit=2000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " 	 " + .description.moniker' | sort -gr | nl 
```

Check Validator key

```bash
[[ $(canined q staking validator $VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(arkhd status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "Your key status is ok" || echo -e "Your key status is error"
```

Signing info

```bash
canined q slashing signing-info $(canined tendermint show-validator) 

```

**REMOVE NODE**<br>

```
cd $HOME
sudo systemctl stop canined .service
sudo systemctl disable canined .service
sudo rm /etc/systemd/system/canined.service
sudo systemctl daemon-reload
rm -f $(which canined)
rm -rf $HOME/.canine
rm -rf $HOME/canine-chain
```
