# Cheat Sheet

## Key management

{% hint style="info" %}
If you got an error "Error: provided algorithm "eth\_secp256k1" is not supported", specify an additional parameter for keyring `--keyring-backend test` or `--keyring-backend file`
{% endhint %}

#### Add new key

```
swisstronikd keys add wallet
```

#### Recover existing key

```
swisstronikd keys add wallet --recover
```

#### List all keys

```
swisstronikd keys list
```

#### Delete key

```
swisstronikd keys delete wallet
```

#### Export key to the file

```
swisstronikd keys export wallet
```

#### Import key from the file

```
swisstronikd keys import wallet wallet.backup
```

#### Query wallet balance

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

***

## Validator management

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

#### Create new validator

```
swisstronikd tx staking create-validator \
  --amount 1000000uswtr \
  --commission-max-change-rate "0.1" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(swisstronikd tendermint show-validator) \
  --moniker "<your moniker>" \
  --website "<your website>" \
  --identity "<your identity> \
  --details "<your descriptions> \
  --chain-id $SWISSTRONIK_CHAIN_ID \
  --gas-prices 7uswtr \
  --from wallet \
  -y
```

#### Edit existing validator

```
swisstronikd tx staking edit-validator \
  --moniker=<your moniker> \
  --identity=<your_keybase_id> \
  --website=<your_website> \
  --details=<your_validator_description> \
  --chain-id=$SWISSTRONIK_CHAIN_ID \
  --from=wallet \
  -y
```

#### Unjail validator

```
swisstronikd tx slashing unjail \
  --broadcast-mode=block \
  --chain-id=$SWISSTRONIK_CHAIN_ID \
  --gas=auto \
  --from=wallet \
  -y
```

#### View validator details

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

***

## Token management

#### Withdraw rewards from all validators

```
swisstronikd tx distribution withdraw-all-rewards --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Withdraw commission and rewards from your validator

```
swisstronikd tx distribution withdraw-rewards $(swisstronikd keys show wallet --bech val -a) --commission --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Delegate tokens to yourself

```
swisstronikd tx staking delegate $(swisstronikd keys show wallet --bech val -a) 10000000uswtr --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Redelegate tokens to another validator

```
swisstronikd tx staking redelegate $(swisstronikd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 10000000usge --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Unbond tokens from your validator

```
swisstronikd tx staking unbond $(swisstronikd keys show wallet --bech val -a) 1000000usge --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Send tokens to the wallet

```
swisstronikd tx bank send wallet <TO_WALLET_ADDRESS> 1000000usge --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

***

## Governance

#### List all proposals

```
swisstronikd query gov proposals
```

#### View proposal by id

```
swisstronikd query gov proposal 1
```

#### Vote 'Yes'

```
swisstronikd tx gov vote 1 yes --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Vote 'No'

```
swisstronikd tx gov vote 1 no --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Vote 'Abstain'

```
swisstronikd tx gov vote 1 abstain --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

#### Vote 'NoWithVeto'

```
swisstronikd tx gov vote 1 NoWithVeto --from wallet --chain-id $SWISSTRONIK_CHAIN_ID --gas-adjustment 1.4 --gas auto --gas-prices 7uswtr -y
```

***

## Utility

#### Update ports

```
CUSTOM_PORT=110
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}66\"%" $HOME/.swisstronik/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}17\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}80\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}91\"%" $HOME/.swisstronik/config/app.toml
```

#### Get sync info

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

#### 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)}'
```

#### Enable prometheus

```
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.swisstronik/config/config.toml
```

#### Reset chain data

```
swisstronikd tendermint unsafe-reset-all --keep-addr-book --home $HOME/.swisstronik --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 %}

```
cd $HOME
sudo systemctl stop swisstronikd
sudo systemctl disable swisstronikd
sudo rm /etc/systemd/system/swisstronikd.service
sudo systemctl daemon-reload
rm -f $(which swisstronikd)
rm -rf $HOME/.swisstronik
rm -rf $HOME/swisstronik
```


---

# 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.logosnodos.online/testnet-node/swisstronik/cheat-sheet.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.
