# CLI Cheatsheet

This page describes usefull commands, which can be used both in `swisstronikd` or `swisstronikcli`.

### Chain IDs:

{% hint style="info" %}
Testnet chain ID is used in the examples. If you want to interact with mainnet, ensure that you're using appropriate chain ID
{% endhint %}

| Type    | Chain ID            |
| ------- | ------------------- |
| Mainnet | swisstronik\_1848-1 |
| Testnet | swisstronik\_1291-1 |

### Swisstronik Testnet CLI Cheatsheet

This cheatsheet collects commonly used CLI commands for node operators to easily copy and paste. A few conventions we follow:

* Capitalized words indicate placeholders
* Always use our own RPC endpoints
* Always specify `--chain-id` and `--node` flags even when they are unnecessary
* Query CLI command always uses `--output json` flag and pipes result through `jq`

**Bank: Send**

```sh
swisstronikd tx bank send KEY RECEIVER_ADDRESS 1000000uswtr \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657  \
  --from KEY
```

**Distribution: Withdraw Rewards including Commission**

```sh
swisstronikd tx distribution withdraw-rewards VALIDATOR_OPERATOR \
  --commission \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657  \
  --from KEY
```

**Gov: Query Proposal**

```sh
swisstronikd query gov proposal PROPOSAL_NUMBER \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657 \
  --output json | jq
```

**Gov: Vote**

VOTE\_OTION: `yes`, `no`, `no_with_veto` and `abstain`.

```sh
swisstronikd tx gov vote PROPOSAL_NUMBER VOTE_OPTION \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657  \
  --from KEY
```

**Slashing: Unjail**

```sh
swisstronikd tx slashing unjail \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657  \
  --from KEY
```

**Staking: Create Validator**

Note: We use example filed values instead of capitalized dummy words for demo purpose in this command. Please make sure to adjust accordingly for your use.

```sh
swisstronikd tx staking create-validator \
  --amount 1000000uswtr \
  --commission-max-change-rate "0.05" \
  --commission-max-rate "0.10" \
  --commission-rate "0.05" \
  --min-self-delegation "1" \
  --pubkey=$(swisstronikd tendermint show-validator) \
  --moniker 'validator' \
  --website "https://validator.com" \
  --identity "0A6AF02D1557E5B4" \
  --details "Validator is the trusted staking service provider for blockchain projects. 100% refund for downtime slash. " \
  --security-contact="hello@validator.com" \
  --chain-id swisstronik_1291-1 \
  --node http://148.113.8.228:26657  \
  --from KEY
```

If you have feedback or find errors in this cheatsheet, please let us know your feedback. Thanks!


---

# 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.swisstronik.com/swisstronik-docs/node-setup/cli-cheatsheet.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.
