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 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 offchain, and claim onchain

## 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
194 changes: 181 additions & 13 deletions docusaurus/docs/operate/quickstart/validator_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,196 @@ title: Validator Cheat Sheet
sidebar_position: 4
---

## Validator Cheat Sheet <!-- omit in toc -->
This cheat sheet provides quick copy-pasta instructions for staking and running a Validator node on Pocket Network.

<!-- TODO_MAINNET(@okdas, #754): Update this page with all the details. -->
:::info

This cheat sheet provides quick copy-pasta like instructions for installing and
running a Validator using an automated script.
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 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)
- [Troubleshooting and Critical Notes](#troubleshooting-and-critical-notes)

## Prerequisites

1. **CLI**: Make sure to [install the `poktrolld` CLI](../user_guide/poktrolld_cli.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

:::tip

If you're interested in understanding everything, or having full control of every
step, check out the [Validator Walkthrough](../run_a_node/validator_walkthrough.md).
if you're running a full node using the [Full Node Cheat Sheet](./full_node_cheatsheet.md), you can can switch to
the user you created in the full node setup to get access to the `poktrolld` CLI. Like this:

```bash
su - poktroll # or a different user if you used a different name
```

:::

- [Introduction](#introduction)
- [Pre-Requisites](#pre-requisites)
### Create the Validator Account

Create a new key pair for the validator:

```bash
poktrolld keys add validator
```

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

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

:::tip

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 $NODE_FLAGS
```

:::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:

```bash
poktrolld comet show-validator
```

This will output something like:

```json
{
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="
}
okdas marked this conversation as resolved.
Show resolved Hide resolved
```

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

### 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="
},
"amount": "1000000upokt",
"moniker": "YourValidatorName",
"identity": "",
"website": "",
"security": "",
"details": "",
"commission-rate": "0.100000000000000000",
"commission-max-rate": "0.200000000000000000",
"commission-max-change-rate": "0.010000000000000000",
"min-self-delegation": "1"
}
```

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

Run the following command to create the validator:

```bash
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.

For example:

```bash
poktrolld tx staking create-validator ./validator.json --from=validator $TX_PARAM_FLAGS $NODE_FLAGS
```

### Verify the Validator Status

You can verify the status of your validator by running:

```bash
poktrolld query staking validator $VALIDATOR_ADDR
```

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

## Validator FAQ

### 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
```

## Introduction
### How do I unbond (undelegate) tokens from my validator?

This guide will help you install a Validator on Pocket Network,
**using helpers that abstract out some of the underlying complexity.**
```bash
poktrolld tx staking unbond $VALIDATOR_ADDR 500000upokt --from your_account --chain-id=pocket-beta --gas=auto --gas-adjustment=1.5 --gas-prices=1upokt
```

### Pre-Requisites
## Troubleshooting and Critical Notes

1. **Run a Full Node**: Make sure you have followed the [Full Node Cheat Sheet](../quickstart/full_node_cheatsheet.md) to install and run a Full Node first
- 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%).
Loading
Loading