# Useful commands

## 🖊️Working with your wallet🖊️

**Add new key**

```
nolusd keys add wallet
```

**Recover existing key**

```
nolusd keys add wallet --recover
```

**Query wallet balance**

```
nolusd q bank balances $(nolusd keys show wallet -a)
```

**List all keys**

```
nolusd keys list
```

**Delete key**

```
nolusd keys delete wallet
```

**Export key to a file**

```
nolusd keys export wallet
```

**Import key from a file**

```
nolusd keys import wallet wallet.backup
```

***

## 🔧Service🔧

**Info**

```
nolusd status 2>&1 | jq .NodeInfo
nolusd status 2>&1 | jq .SyncInfo
nolusd status 2>&1 | jq .ValidatorInfo
```

**Check node logs**

```
sudo journalctl -fu nolusd -o cat
```

**Check service status**

```
sudo systemctl status nolusd
```

**Restart service**

```
sudo systemctl restart nolusd
```

**Stop service**

```
sudo systemctl stop nolusd
```

**Start service**

```
sudo systemctl start nolusd
```

**Reload, disable, enable**

```
sudo systemctl daemon-reload
sudo systemctl disable nolusd
sudo systemctl enable nolusd
```

**Your Peer**

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

***

## 🔗Validator Management🔗

**Create new validator**

```
nolusd tx staking create-validator \
  --amount 1000000unls \
  --from <walletName> \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.20" \
  --commission-rate "0.05" \
  --min-self-delegation "1" \
  --pubkey  $(nolusd tendermint show-validator) \
  --moniker YOUR_MONIKER_NAME \
  --chain-id pirin-1 \
  --identity="YOUR_KEYBASE_ID" \
  --details="YOUR_DETAILS" \
  --website="YOUR_WEBSITE_URL" -y
```

**Edit Validator**

```
nolusd tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--security-contact "Your_Email" \
--chain-id pirin-1 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--fees 2500unls \
-y
```

**Jail Info**

```
nolusd query slashing signing-info $(nolusd tendermint show-validator)
```

**Unjail**

```
nolusd tx slashing unjail --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Active Validators List**

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

**Inactive Validators List**

```
nolusd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
```

**View validator details**

```
nolusd q staking validator $(nolusd keys show wallet --bech val -a)
```

***

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

**List all proposals**

```
nolusd query gov proposals
```

**View specific proposal**

```
nolusd query gov proposal 1
```

**Vote yes**

```
nolusd tx gov vote 1 yes --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Vote no**

```
nolusd tx gov vote 1 no --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Vote abstain**

```
nolusd tx gov vote 1 abstain --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Vote no\_with\_veto**

```
nolusd tx gov vote 1 NoWithVeto --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

***

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

**Withdraw all rewards from all validators**

```
nolusd tx distribution withdraw-all-rewards --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Withdraw and commission from your Validator**

```
nolusd tx distribution withdraw-rewards $(nolusd keys show wallet --bech val -a) --commission --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Delegate tokens to your validator**

```
nolusd tx staking delegate Your_valpoer........ " 1000000unls --from Wallet_Name --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Delegate tokens to different validator**

```
nolusd tx staking delegate <TO_VALOPER_ADDRESS> 1000000unls --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Redelegate tokens to another validator**

```
nolusd tx staking redelegate $(nolusd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000unls --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Unbond tokens from your validator**

```
nolusd tx staking unbond $(nolusd keys show wallet --bech val -a) 1000000unls --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```

**Send tokens to the wallet**

```
nolusd tx bank send wallet <TO_WALLET_ADDRESS> 1000000unls --from wallet --chain-id pirin-1 --gas-adjustment 1.4 --gas auto --fees 2500unls -y
```


---

# 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://service.block-pro.net/mainnet/nolus/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.
