# Cheat Sheet

## Key management

#### Add new key

```
KEY_ALIAS="keysha"; namada wallet key gen --alias $KEY_ALIAS
```

#### Recover existing key

```
namada wallet key restore --alias $KEY_ALIAS --hd-path default
```

#### List all keys

```
namada wallet key list
```

#### Query wallet balance

```
namada client balance --owner $KEY_ALIAS
```

#### Add some token using faucet

```
https://faucet.heliax.click/
```

***

## Multisign

#### Generate key-1

```
namadaw key gen --alias my-key1
```

#### Generate key-2

```
namadaw key gen --alias my-key2
```

#### Generate implicit address

```
namadaw address gen --alias my-address
```

**init non-multisig account (single signer)**

```
namadac init-account --alias my-multisig-alias --public-keys my-key1 --signing-keys my-key1
```

**init multisig account (at least 2 signers)**

```
namadac init-account --alias my-multisig-alias --public-keys my-key1,my-key2 --signing-keys my-key1,my-key2 --threshold 2
```

**Submitting a multisignature transaction**

```
mkdir tx_dumps
```

#### Create transaction

```
namadac transfer --source my-multisig-alias --target some-established-account-alias --token NAM --amount 100 --signing-keys my-key1 --dump-tx --output-folder-path tx_dumps
```

#### Signing transaction

```
namadac transfer --source my-multisig-alias --target some-established-account-alias --token NAM --amount 100 --signing-keys my-key1 --dump-tx --output-folder-path tx_dumps
```

#### Save as a variable offline\_signature

```
export SIGNATURE_ONE="offline_signature_FB7246E3FC43F59D8AEEC234EBFDB9DF1AC9BB7B14E536D05A7E2617CA41D4CD_0.tx"
```

**Submit Transaction**

```
namadac tx --tx-path "tx_dumps/a45ef98a817290d6fc0efbd480bf66647ea8061aee1628ce09b4af4f4eeed1c2.tx" --signatures $SIGNATURE_ONE --signatures $SIGNATURE_TWO --owner my-multisig-alias --gas-payer my-key1
```

**Change the multisig threshold**

```
namadac update-account --address my-multisig-address --threshold 1 --signing-keys my-key1,my-key2
```

**Check the threshold has been updated**

```
namadac query-account --owner my-multisig-address
```

**Change the public keys of a multisig account**

```
namadac query-account --owner my-multisig-address
```

**Initialize an established account**

```
namada client init-account --alias establishment --public-keys keysha  --signing-keys keysha  --threshold 1
```

***

## MASP

#### Randomly generate a new spending key

```
namadaw masp gen-key --alias <your-spending-key-alias>
```

#### Create a new payment address

```
namadaw masp gen-addr  --key <your-spending-key-alias> --alias <your-payment-address-alias>
```

#### Send your shielding transfer

```
namadac transfer --source <your-established-account-alias>  --target <your-payment-address-alias>  --token btc --amount <amount-to-shield>
```

#### View balance

```
namadac balance --owner <your-spending-key-alias>
```

#### Shielded transfer (once the user has a shielded balance, it can be transferred to another shielded address)

```
namadac transfer  --source <your-spending-key-alias> --target <destination-payment-address>  --token btc --amount <amount-to-transfer> --signing-keys <your-implicit-account-alias>
```

**Unshielding transfers (it is also possible to transfer the balance to a transparent account)**

```
namadac transfer --source <your-spending-key-alias> --target <some-transparent-address-alias> --token btc  --amount <amount-to-unshield> --signing-keys <your-implicit-account-alias>
```

***

## Validator Operations

#### Check sync status and node info

```
curl http://127.0.0.1:26657/status | jq
```

#### Stake funds

```
namada client bond --validator $ALIAS  --amount 1500 --gas-limit 10000000
```

#### Check your validator bond status

```
namada client bonds --owner $ALIAS
```

#### Check all bonded nodes

```
namada client bonded-stake
```

#### Find all the slashes

```
namada client slashes
```

#### Self Unbonding

```
namada client unbond --validator $ALIAS --amount 0.3
```

#### Non-self unbonding

```
namada client unbond --source aliace --validator $ALIAS --amount 1.2
```

**Withdrawing unbonded tokens**

```
namada client withdraw --source aliace --validator $ALIAS
```

***

## Sync and Consensus

#### Check logs

```
sudo journalctl -u namadad -f
```

#### Check sync status and node info

```
curl http://127.0.0.1:26657/status | jq
```

**Check consensus state**

```
curl -s localhost:26657/consensus_state | jq .result.round_state.height_vote_set[0].prevotes_bit_array
```

**Full consensus state**

```
curl -s localhost:12657/dump_consensus_state
```

#### Your validator votes (prevote)

```
curl -s http://localhost:26657/dump_consensus_state | jq '.result.round_state.votes[0].prevotes' | grep $(curl -s http://localhost:26657/status | jq -r '.result.validator_info.address[:12]')
```

***

## 🚨 Maintenance

#### 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 %}

```
sudo systemctl stop namadad
sudo systemctl disable namadad
sudo rm -rf /etc/systemd/system/namadad.service
sudo systemctl daemon-reload
sudo rm $(which namada)
sudo rm -rf $HOME/.local/share/namada/public-testnet-15.0dacadb8d663
```


---

# 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/namada/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.
