# CLI Cheatsheet

## Republic Node Command Reference

***

## Check Node Synchronization Status

```
republicd status 2>&1 | jq .sync_info
```

> Be careful with **capitalized parameters** and always specify `--chain-id` when required.

***

## Frequently Used Status Command

```
republicd status 2>&1 | jq .sync_info
```

***

## Wallet Operations

### Create a New Wallet

Replace `<wallet>` with your preferred wallet name.

```
republicd keys add wallet
```

***

### Restore an Existing Wallet from Mnemonic

```
republicd keys add wallet --recover
```

***

### Display Available Wallets

```
republicd keys list
```

***

### Remove a Wallet from the Keyring

```
republicd keys delete wallet
```

***

### Check Wallet Balance

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

***

## Validator Setup & Management

Please replace the following values with your own information:

`<wallet>` , `MONIKER` , `YOUR_KEYBASE_ID` , `YOUR_DETAILS` , `YOUR_WEBSITE_URL`

***

### Retrieve Validator Public Key

```
republicd comet show-validator
```

***

### Create Validator Configuration File

```
nano $HOME/.republic/validator.json
```

```
{
  "pubkey":  ,
  "amount": "1000000000000000000arai",
  "moniker": "",
  "identity": "",
  "website": "",
  "security": "",
  "details": "",
  "commission-rate": "0.05",
  "commission-max-rate": "0.2",
  "commission-max-change-rate": "0.05",
  "min-self-delegation": "1"
}
```

***

### Submit Validator Creation Transaction

```
republicd tx staking create-validator $HOME/.republic/validator.json \
--from wallet \
--chain-id raitestnet_77701-1 \
--gas-prices=2500000000arai \
--gas-adjustment=1.5 \
--gas=auto
```

***

### Restore Validator from Jailed State

```
republicd tx slashing unjail --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### View Validator Slashing Information

```
republicd query slashing signing-info $(republicd comet show-validator)
```

***

## Token & Delegation Operations

***

### Claim All Staking Rewards

```
republicd tx distribution withdraw-all-rewards --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### Claim Validator Rewards Including Commission

```
republicd tx distribution withdraw-rewards $(republicd keys show wallet --bech val -a) --commission --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### Delegate Tokens to Your Validator

```
republicd tx staking delegate $(republicd keys show wallet --bech val -a) 1000000000000000000arai --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### Redelegate Tokens to Another Validator

```
republicd tx staking redelegate $(republicd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000000000000000arai --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### Undelegate Tokens from Your Validator

```
republicd tx staking unbond $(republicd keys show wallet --bech val -a) 1000000000000000000arai --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```

***

### Transfer Tokens to Another Wallet

```
republicd tx bank send wallet <TO_WALLET_ADDRESS> 1000000000000000000arai --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas-adjustment=1.5 --gas=auto
```
