# Cheat Sheet

## Key management

#### Add new key

```
symphonyd keys add $SYMPHONY_WALLET
```

#### Recover existing key

```
symphonyd keys add $SYMPHONY_WALLET --recover
```

#### List all keys

```
symphonyd keys list
```

#### Delete key

```
symphonyd keys delete $SYMPHONY_WALLET
```

#### Export key to the file

```
symphonyd keys export $SYMPHONY_WALLET
```

#### Import key from the file

```
symphonyd keys import $SYMPHONY_WALLET wallet.backup
```

#### Query wallet balance

```
symphonyd q bank balances $(symphonyd keys show $SYMPHONY_WALLET -a)
```

***

## Validator management

{% hint style="info" %}
Please make sure you have adjusted **moniker**, **identity and** **details** to match your values.
{% endhint %}

#### Create new validator

```
symphonyd tx staking create-validator \
  --amount 1000000note \
  --from $WALLET \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(symphonyd tendermint show-validator) \
  --moniker $NODENAME \
  --chain-id $SYMPHONY_CHAIN_ID
  --gas-adjustment 1.4 \
  --gas auto \
  --fees 800note
```

#### Edit existing validator

```
symphonyd tx staking edit-validator \
--commission-rate 0.1 \
--new-moniker "" \
--identity "" \
--details "" \
--from $SYMPHONY_WALLET \
--chain-id $SYMPHONY_CHAIN_ID \
--fees 200note \
-y 
```

#### Unjail validator

```
symphonyd tx slashing unjail --from $SYMPHONY_WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### List all active validators

```
symphonyd 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
```

#### View validator details

```
symphonyd q staking validator $(symphonyd keys show $SYMPHONY_WALLET --bech val -a)
```

***

## Token management

#### Withdraw rewards from all validators

```
symphonyd tx distribution withdraw-all-rewards --from $SYMPHONY_WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note 
```

#### Withdraw commission and rewards from your validator

```
symphonyd tx distribution withdraw-rewards <your_valoper-address> --from $SYMPHONY_WALLET --commission --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Delegate tokens to yourself

```
symphonyd tx staking delegate $(symphonyd keys show $SYMPHONY_WALLET --bech val -a) 1000000note --from $SYMPHONY_WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Delegate tokens to validator

```
symphonyd tx staking delegate <TO_VALOPER_ADDRESS> 1000000amf --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 	
```

#### Redelegate tokens to another validator

```
symphonyd tx staking redelegate $VALOPER_ADDRESS <TO_VALOPER_ADDRESS> 1000000amf --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Unbond tokens from your validator

```
symphonyd tx staking unbond $(symphonyd keys show $WALLET --bech val -a) 1000000amf --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Send tokens to the wallet

```
symphonyd tx bank send $WALLET_ADDRESS <TO_WALLET_ADDRESS> 1000000note --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

***

## Governance

#### List all proposals

```
symphonyd query gov proposals
```

#### View proposal by id

```
symphonyd query gov proposal 1
```

#### Vote 'Yes'

```
symphonyd tx gov vote 1 yes --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Vote 'No'

```
symphonyd tx gov vote 1 no --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Vote 'Abstain'

```
symphonyd tx gov vote 1 abstain --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

#### Vote 'NoWithVeto'

```
symphonyd tx gov vote 1 no_with_veto --from $WALLET --chain-id $SYMPHONY_CHAIN_ID --fees 200note -y 
```

***

## 🚨 Maintenance

#### Get validator info

```
symphonyd status 2>&1 | jq .ValidatorInfo
```

#### Get sync info

```
symphonyd status 2>&1 | jq .SyncInfo
```

#### Get node peer

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

#### Get live peers

```
curl -sS http://localhost:26657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
```

#### Reset chain data

```
symphonyd tendermint unsafe-reset-all --keep-addr-book --home $HOME/.symphonyd --keep-addr-book
```

#### Remove node

{% hint style="danger" %}
Please, before proceeding with the next step! All chain data will be lost! Make sure you have backed up your **priv\_validator\_key.json** !
{% endhint %}

```
sudo systemctl stop symphonyd
sudo systemctl disable symphonyd 
sudo rm -rf /etc/systemd/system/symphonyd.service
sudo rm $(which symphonyd)
sudo rm -rf $HOME/.symphonyd 
sed -i "/AIRCHAIN_/d" $HOME/.bash_profile
```

***

## Service Management

#### Reload service configuration

```
sudo systemctl daemon-reload
```

#### Enable service

```
sudo systemctl enable symphonyd 
```

#### Disable service

```
sudo systemctl disable symphonyd 
```

#### Start service

```
sudo systemctl start symphonyd 
```

#### Stop service

```
sudo systemctl stop symphonyd 
```

#### Restart service

```
sudo systemctl restart symphonyd 
```

#### Check service status

```
sudo systemctl status symphonyd 
```

#### Check service logs

```
sudo journalctl -u symphonyd -f --no-hostname -o cat
```
