# Commands

## Key Management

**Add a new key**

```bash
quasarnoded keys add wallet_name
```

**Recover an existing wallet**

```bash
quasarnoded keys add wallet_name --recover
```

**List all keys**

```bash
quasarnoded keys list
```

## Validator Management

**Create a new validator**

```bash
quasarnoded tx staking create-validator \
--amount=1000000 \
--pubkey=$(quasarnoded tendermint show-validator) \
--moniker="YOUR_MONIKER_NAME" \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL"
--chain-id=qsr-questnet-04 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet_name \
--gas-adjustment=1.4 \
--gas=auto \
--gas-prices=0.00uqsr
```

**Unjail a validator**

```bash
quasarnoded tx slashing unjail --from wallet_name --chain-id qsr-questnet-04 --gas-adjustment 1.0 --gas auto --gas-prices 0.00uqsr
```

**Query Jail Reason**

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

## Token Management

**Query wallet balance**

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

**Withdraw all rewards from validator, excluding commission**

```bash
quasarnoded tx distribution withdraw-all-rewards --from wallet_name --chain-id qsr-questnet-04 --gas-adjustment 1.0 --gas auto --gas-prices 0.00uqsr
```

**Withdraw all rewards and commission from validator**

```bash
quasarnoded tx distribution withdraw-rewards $(quasarnoded keys show wallet --bech val -a) --commission --from wallet_name --chain-id qsr-questnet-04 --gas-adjustment 1.0 --gas auto --gas-prices 0.00uqsr
```

**Delegate tokens to yourself**

```bash
quasarnoded tx staking delegate $(quasarnoded keys show wallet --bech val -a) 1000000uqsr --from wallet_name --chain-id qsr-questnet-04 --gas-adjustment 1.0 --gas auto --gas-prices 0.00uqsr
```

## Governance

**List all proposals**

```bash
quasarnoded query gov proposals
```

**View a specific proposal**

> **NOTE:** Replace 1 with the desired proposal id

```bash
quasarnoded query gov proposal 1
```

**Vote on a proposal**

> **NOTE:** Replace "1" with the desired proposal id. Replace "yes" with one of the cli commands from the table below.

The valid vote options are:

| CLI Command | Name         | Description                                                                                 |
| ----------- | ------------ | ------------------------------------------------------------------------------------------- |
| yes         | Yes          | Vote to pass the proposal                                                                   |
| no          | No           | Vote to not pass the proposal                                                               |
| abstain     | Abstain      | Vote to abstain from the proposal                                                           |
| nowithveto  | No With Veto | Vote to fail the proposal and burn the deposit. Typically only used for spam/scam proposals |

```bash
quasarnoded tx gov vote 1 yes --from wallet_name --chain-id qsr-questnet-04 --gas-adjustment 1.0 --gas auto --gas-prices 0.00uqsr
```

## Config Changes

## Maintenance and status

**Get validator info**

```bash
quasarnoded status 2>&1 | jq .ValidatorInfo
```

**Get syncing info**

```bash
quasarnoded status 2>&1 | jq .SyncInfo
```

**Get live peers**

> **NOTE:** Replace the `CUSTOM_PORT` value as needed. 26657 is the default port, but can change based on the `config.toml` settings.

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

**Reset chain data**

```bash
quasarnoded tendermint unsafe-reset-all --home $HOME/.quasarnode --keep-addr-book || \
quasarnoded unsafe-reset-all --home $HOME/.quasarnode --keep-addr-book
```

## Linux Service Management

**Check daemon/cosmovisor logs**

> **NOTE:** Replace `cosmovisor` with the systemd service name if different

```bash
sudo journalctl -fu cosmovisor -o cat
```


---

# 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://docs.cryptochemistry.io/testnets/quasar/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.
