Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Validator cheatsheet and walkthrough #1012

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docusaurus/docs/operate/quickstart/gateway_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ streamline development and reduce friction for any new potential contributor.

- [Pre-Requisites](#pre-requisites)
- [Account Setup](#account-setup)
- [Create and fund the `Gateway` and `Application` accounts](#create-and-fund-the-gateway-and-application-accounts)
- [Create the Gateway and Application accounts](#create-the-gateway-and-application-accounts)
- [Prepare your environment](#prepare-your-environment)
- [Fund the Gateway and Application accounts](#fund-the-gateway-and-application-accounts)
- [Gateway and Application Configurations](#gateway-and-application-configurations)
- [Stake the `Gateway`](#stake-the-gateway)
- [Stake the delegating `Application`](#stake-the-delegating-application)
- [Delegate the `Application` to the `Gateway`](#delegate-the-application-to-the-gateway)
Expand Down Expand Up @@ -54,7 +55,7 @@ This is not recommended but provided for convenience for NON PRODUCTION USE ONLY

## Account Setup

### Create and fund the `Gateway` and `Application` accounts
### Create the Gateway and Application accounts

Create a new key pair for the delegating `Application`:

Expand Down Expand Up @@ -116,6 +117,8 @@ You can find all the explorers, faucets and tools at the [tools page](../../expl

:::

## Gateway and Application Configurations

### Stake the `Gateway`

Create a Gateway stake configuration file:
Expand Down
10 changes: 5 additions & 5 deletions docusaurus/docs/operate/quickstart/supplier_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ streamline development and reduce friction for any new potential contributor.
- [Pre-Requisites](#pre-requisites)
- [Context](#context)
- [Account Setup](#account-setup)
- [Create and fund the `Supplier` account](#create-and-fund-the-supplier-account)
- [Create the `Supplier` account](#create-the-supplier-account)
- [Prepare your environment](#prepare-your-environment)
- [Supplier Configuration](#supplier-configuration)
- [Fund the Supplier account](#fund-the-supplier-account)
- [Supplier Configuration](#supplier-configuration)
- [Stake the Supplier](#stake-the-supplier)
- [RelayMiner Configuration](#relayminer-configuration)
- [Configure the RelayMiner](#configure-the-relayminer)
Expand Down Expand Up @@ -66,7 +66,7 @@ By the end of it, you should be able to serve Relays off-chain, and claim on-cha

## Account Setup

### Create and fund the `Supplier` account
### Create the `Supplier` account

Create a new key pair for the `Supplier`

Expand Down Expand Up @@ -96,8 +96,6 @@ your `~/.profile` (or `~/.bashrc`) file for a cleaner organization.

:::

## Supplier Configuration

### Fund the Supplier account

Run the following command to get the `Supplier`:
Expand All @@ -121,6 +119,8 @@ You can find all the explorers, faucets and tools at the [tools page](../../expl

:::

## Supplier Configuration

### Stake the Supplier

:::info
Expand Down
146 changes: 97 additions & 49 deletions docusaurus/docs/operate/quickstart/validator_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,34 @@ sidebar_position: 4

This cheat sheet provides quick copy-pasta instructions for staking and running a Validator node on Pocket Network.

:::info

If you're interested in understanding everything validator related, or having full control of every
step, check out the [Validator Walkthrough](../run_a_node/validator_walkthrough.md).

:::

- [Prerequisites](#prerequisites)
- [Account Setup](#account-setup)
- [Create and Fund the Validator Account](#create-and-fund-the-validator-account)
- [Get the Validator's PubKey](#get-the-validators-pubkey)
- [Create the Validator JSON File](#create-the-validator-json-file)
- [Create the Validator](#create-the-validator)
- [Verify the Validator Status](#verify-the-validator-status)
- [Additional Commands](#additional-commands)
- [Notes](#notes)
- [Create the Validator Account](#create-the-validator-account)
- [Prepare your environment](#prepare-your-environment)
- [Fund the Validator account](#fund-the-validator-account)
- [Configure the Validator](#configure-the-validator)
- [Get the Validator's PubKey](#get-the-validators-pubkey)
- [Create the Validator JSON File](#create-the-validator-json-file)
- [Create the Validator](#create-the-validator)
- [Verify the Validator Status](#verify-the-validator-status)
- [Validator FAQ](#validator-faq)
- [How do I delegate additional tokens to my validator?](#how-do-i-delegate-additional-tokens-to-my-validator)
- [How do I unbond (undelegate) tokens from my validator?](#how-do-i-unbond-undelegate-tokens-from-my-validator)
- [How do I withdraw my validator rewards?](#how-do-i-withdraw-my-validator-rewards)
- [How do I check my validator's commission and rewards?](#how-do-i-check-my-validators-commission-and-rewards)
- [Troubleshooting and Critical Notes](#troubleshooting-and-critical-notes)

## Prerequisites

**Run a Full Node**: Make sure you have followed the [Full Node Cheat Sheet](./full_node_cheatsheet.md) to install and run a Full Node first.
1. **CLI**: Make sure to [install the `poktrolld` CLI](../user_guide/install.md).
2. **Full Node**: Make sure you have followed the [Full Node Cheat Sheet](./full_node_cheatsheet.md) to install and run a Full Node first.

## Account Setup

Expand All @@ -32,7 +47,7 @@ su - poktroll # or a different user if you used a different name

:::

### Create and Fund the Validator Account
### Create the Validator Account

Create a new key pair for the validator:

Expand All @@ -42,21 +57,53 @@ poktrolld keys add validator

This will generate a new address and mnemonic. **Save the mnemonic securely**.

Set the validator address in an environment variable for convenience:
### Prepare your environment

For convenience, we're setting several environment variables to streamline
the process of interacting with the Shannon network:

We recommend you put these in your `~/.bashrc` file:

```bash
export NODE="https://shannon-testnet-grove-rpc.beta.poktroll.com"
export NODE_FLAGS="--node=https://shannon-testnet-grove-rpc.beta.poktroll.com"
export TX_PARAM_FLAGS="--gas=auto --gas-prices=1upokt --gas-adjustment=1.5 --chain-id=pocket-beta --yes"
export VALIDATOR_ADDR=$(poktrolld keys show validator -a)
```

Fund the validator account using [the faucet](../../explore/tools.md) or by transferring tokens from another account.
:::tip

Check the balance:
As an alternative to appending directly to `~/.bashrc`, you can put the above
in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to
your `~/.profile` (or `~/.bashrc`) file for a cleaner organization.

:::

### Fund the Validator account

Run the following command to get the `Validator`:

```bash
echo "Validator address: $VALIDATOR_ADDR"
```

Then use the [Shannon Beta TestNet faucet](https://faucet.beta.testnet.pokt.network/) to fund the validator account.

Afterwards, you can query the balance using the following command:

```bash
poktrolld query bank balances $VALIDATOR_ADDR
poktrolld query bank balances $VALIDATOR_ADDR $NODE_FLAGS
```

## Get the Validator's PubKey
:::tip

You can find all the explorers, faucets and tools at the [tools page](../../explore/tools.md).

:::

## Configure the Validator

### Get the Validator's PubKey

To get the validator's public key, run:

Expand All @@ -67,18 +114,24 @@ poktrolld comet show-validator
This will output something like:

```json
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="}
{
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI - the output is actually a minimized version.

```

Copy the entire output; you will need it in the next step.
**Copy the entire output; you will need it in the next step.**

## Create the Validator JSON File
### Create the Validator JSON File

Create a JSON file named `validator.json` with the following content:

```json
{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="},
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="
},
"amount": "1000000upokt",
"moniker": "YourValidatorName",
"identity": "",
Expand All @@ -92,28 +145,30 @@ Create a JSON file named `validator.json` with the following content:
}
```

Make the following changes:

- Replace the `"pubkey"` value with the output from `poktrolld comet show-validator`.
- Update the `"amount"` field with the amount you wish to stake (e.g., `"1000000upokt"`).
- Set the `"moniker"` to your validator's name.
- You can optionally fill in `"identity"`, `"website"`, `"security"`, and `"details"`.

## Create the Validator
### Create the Validator

Run the following command to create the validator:

```bash
poktrolld tx staking create-validator ./validator.json --from=validator --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
poktrolld tx staking create-validator ./validator.json --from=validator $TX_PARAM_FLAGS $NODE_FLAGS
```

This command uses the `validator.json` file to submit the `create-validator` transaction.

**Example**:
For example:

```bash
poktrolld tx staking create-validator ./validator.json --from=validator --chain-id=pocket-beta --gas=auto --gas-prices=1upokt --gas-adjustment=1.5
poktrolld tx staking create-validator ./validator.json --from=validator $TX_PARAM_FLAGS $NODE_FLAGS
```

## Verify the Validator Status
### Verify the Validator Status

You can verify the status of your validator by running:

Expand All @@ -123,43 +178,36 @@ poktrolld query staking validator $VALIDATOR_ADDR

This will display information about your validator, including its status and delegation.

## Additional Commands
## Validator FAQ

- **Delegate additional tokens to your validator**:
### How do I delegate additional tokens to my validator?

```bash
poktrolld tx staking delegate $VALIDATOR_ADDR 1000000upokt --from your_account --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```
```bash
poktrolld tx staking delegate $VALIDATOR_ADDR 1000000upokt --from your_account --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```

- **Unbond (undelegate) tokens from your validator**:
### How do I unbond (undelegate) tokens from my validator?

```bash
poktrolld tx staking unbond $VALIDATOR_ADDR 500000upokt --from your_account --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```
```bash
poktrolld tx staking unbond $VALIDATOR_ADDR 500000upokt --from your_account --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```

- **Withdraw rewards**:
### How do I withdraw my validator rewards?

```bash
poktrolld tx distribution withdraw-rewards $VALIDATOR_ADDR --commission --from validator --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```
```bash
poktrolld tx distribution withdraw-rewards $VALIDATOR_ADDR --commission --from validator --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```

- **Check validator's commission and rewards**:
### How do I check my validator's commission and rewards?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel if we remove this completely? I don't believe we mint tokens for validators. Here are mint module params:

        inflation_rate_change: "0.0"
        inflation_max: "0.0"
        inflation_min: "0.0"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, let's remove it


```bash
poktrolld query distribution commission $VALIDATOR_ADDR
poktrolld query distribution rewards $VALIDATOR_ADDR
```
```bash
poktrolld query distribution commission $VALIDATOR_ADDR
poktrolld query distribution rewards $VALIDATOR_ADDR
```

## Notes
## Troubleshooting and Critical Notes

- Ensure your node is fully synced before attempting to create the validator.
- Keep your mnemonic and private keys secure.
- Adjust the `"amount"` in `validator.json` and delegation amounts according to your available balance.
- The `commission-rate`, `commission-max-rate`, and `commission-max-change-rate` are expressed as decimal numbers (e.g., `0.1` for 10%).

:::tip

If you're interested in understanding everything validator related, or having full control of every
step, check out the [Validator Walkthrough](../run_a_node/validator_walkthrough.md).

:::
Loading