> For the complete documentation index, see [llms.txt](https://services.validexis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://services.validexis.com/testnets/celestia/validator-node-installation/useful-commands.md).

# 📜  Useful Commands

***Get validator info***

```bash
celestia-appd status 2>&1 | jq .ValidatorInfo
```

***Get sync info***

```bash
celestia-appd status 2>&1 | jq
```

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

***Add new key***

```bash
celestia-appd keys add wallet
```

***Recover existing key***

<pre class="language-bash"><code class="lang-bash"><strong>celestia-appd keys add wallet --recover
</strong></code></pre>

***List all keys***

```bash
celestia-appd keys list
```

***Delete key***

```bash
celestia-appd keys delete wallet
```

***Query wallet balance***

```bash
celestia-appd q bank balances $(celestia-appd keys show wallet -a)
```

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

Please make sure you have adjusted **moniker**, **identity**, **details** and **website** to match your values.

***Create new validator***

```bash
celestia-appd tx staking create-validator \
--amount 1000000utia \
--pubkey $(celestia-appd tendermint show-validator) \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id mocha-4 \
--commission-rate 0.05 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.05 \
--min-self-delegation 1 \
--from wallet \
--gas 200000 \
--gas-prices 0.002utia \
-y
```

***Edit existing validator***

```bash
celestia-appd tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id mocha-4 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas 200000 \
--gas-prices 0.002utia \
-y
```

***Validator Details***

```bash
celestia-appd q staking validator $(celestia-appd keys show wallet --bech val -a) 
```

***Jailing info***

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

***Slashing parameters***

```bash
celestia-appd q slashing params 
```

***Unjail validator***

```bash
celestia-appd tx slashing unjail --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

### *Token management* <a href="#token-management" id="token-management"></a>

***Withdraw rewards from all validators***

```bash
celestia-appd tx distribution withdraw-all-rewards --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Withdraw commission and rewards from your validator***

```bash
celestia-appd tx distribution withdraw-rewards $(celestia-appd keys show wallet --bech val -a) --commission --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Delegate tokens to yourself***

```bash
celestia-appd tx staking delegate $(celestia-appd keys show wallet --bech val -a) 1000000utia --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Delegate tokens to validator***

```bash
celestia-appd tx staking delegate <TO_VALOPER_ADDRESS> 1000000utia --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Redelegate tokens to another validator***

```bash
celestia-appd tx staking redelegate $(celestia-appd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000utia --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Unbond tokens from your validator***

```bash
celestia-appd tx staking unbond $(celestia-appd keys show wallet --bech val -a) 1000000utia --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Send tokens to the wallet***

```bash
celestia-appd tx bank send wallet <TO_WALLET_ADDRESS> 1000000utia --from wallet --chain-id mocha-4 --gas-adjustment 1.4 --gas auto --gas-prices 0.002utia -y
```

***Remove node***

Please, before proceeding with the next step! All chain data will be lost! Make sure you have backed up your **priv\_validator\_key.json**!

```bash
sudo systemctl stop celestia-appd
sudo systemctl disable celestia-appd
sudo rm -rf /etc/systemd/system/celestia-appd.service
sudo rm $(which celestia-appd)
sudo rm -rf $HOME/.celestia-app
sudo rm -rf $HOME/celestia-app
```

### *Service Management* <a href="#service-management" id="service-management"></a>

***Reload service configuration***

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

***Enable service***

```bash
sudo systemctl enable celestia-appd
```

***Disable service***

```bash
sudo systemctl disable celestia-appd
```

***Start service***

```bash
sudo systemctl start celestia-appd
```

***Stop service***

```bash
sudo systemctl stop celestia-appd
```

***Restart service***

```bash
sudo systemctl restart celestia-appd
```

***Check service status***

```bash
sudo systemctl status celestia-appd
```

***Check service logs***

```bash
sudo journalctl -u celestia-appd -f --no-hostname -o cat
```
