Skip to content

Commit

Permalink
Merge remote-tracking branch 'pokt/main' into issues/1034/scaffold/mo…
Browse files Browse the repository at this point in the history
…rse_claimable_account

* pokt/main:
  [Docs] Validator cheatsheet and walkthrough (#1012)
  [Dependencies] Bump `cosmos-sdk` client lib and switch `mockgen` to `uber`'s fork (#1069)
  • Loading branch information
bryanchriswhite committed Feb 14, 2025
2 parents a8387ce + e2f3c84 commit 091bc35
Show file tree
Hide file tree
Showing 57 changed files with 552 additions and 181 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ endif

# TODO_IMPROVE(@okdas): Add other dependencies (ignite, docker, k8s, etc) here
.PHONY: install_ci_deps
install_ci_deps: ## Installs `mockgen` and other go tools
go install "github.com/golang/mock/[email protected]" && mockgen --version
install_ci_deps: ## Installs `golangci-lint` and other go tools
go install github.com/golangci/golangci-lint/cmd/[email protected] && golangci-lint --version
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/mikefarah/yq/v4@latest
Expand Down
3 changes: 1 addition & 2 deletions api/poktroll/application/types.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions docusaurus/docs/develop/developer_guide/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ Run the following command to install `golang` dependencies:
make install_ci_deps
```

If you encounter issues related to `mockgen` not being found or failing, try running the following command to verify its installation:

```bash
make check_mockgen
```

Compile protobufs, generate mocks and verify that all tests are passing by running:

```bash
Expand Down
3 changes: 3 additions & 0 deletions docusaurus/docs/operate/cheat_sheets/gateway_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ streamline development and reduce friction for any new potential contributor.
- [Create and fund the `Gateway` and `Application` accounts](#create-and-fund-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 @@ -116,6 +117,8 @@ You can find all the explorers, faucets and tools at the [tools page](../../tool

:::

## Gateway and Application Configurations

### Stake the `Gateway`

Create a Gateway stake configuration file:
Expand Down
10 changes: 5 additions & 5 deletions docusaurus/docs/operate/cheat_sheets/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](../../tool

:::

## Supplier Configuration

### Stake the Supplier

:::info
Expand Down
151 changes: 139 additions & 12 deletions docusaurus/docs/operate/cheat_sheets/validator_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,153 @@ sidebar_position: 6

## Validator Cheat Sheet <!-- omit in toc -->

<!-- TODO_MAINNET(@okdas, #754): Update this page with all the details. -->
**🖨 🍝 instructions to get you up and running with a `Validator` on Pocket Network ✅**

This cheat sheet provides quick copy-pasta like instructions for installing and
running a Validator using an automated script.
:::warning There is lots of scripting and some details are abstracted away

See the [Validator Walkthrough](../walkthroughs/validator_walkthrough.md) if you want to understand what's happening under the hood.

:::

## Table of Contents <!-- omit in toc -->

- [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)

## Prerequisites

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

:::tip `poktroll` user

If you followed [Full Node Cheat Sheet](./full_node_cheatsheet.md), you can switch
to user running the full node (which has `poktrolld` installed) like so:

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

:::

## Account Setup

### Create the Validator Account

Create a new key pair for the validator like so:

```bash
poktrolld keys add validator
```

### Prepare your environment

Run the following commands to set up your environment:

```bash
cat << 'EOT' > ~/.poktrollrc
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)
EOT

echo "source ~/.poktrollrc" >> ~/.bashrc
```

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

If you're interested in understanding everything, or having full control of every
step, check out the [Validator Walkthrough](../walkthroughs/validator_walkthrough.md).
If you know someone at [Grove](https://grove.city) who maintains Beta TestNet, you
can ask them to run this command:

```bash
pkd_beta_tx tx bank send faucet_beta $VALIDATOR_ADDR 6900000000042upokt
```

:::

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

### Get the Validator's PubKey

Run the following command to get the `pubkey` of your validator:

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

This will output something like:

```json
{ "@type": "/cosmos.crypto.ed25519.PubKey", "key": "YourPublicKeyHere" }
```

### Create the Validator JSON File

Create a JSON file named `validator.json` with the content below while make these 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 (`validator` is the default we provided).
- You can optionally fill in `"identity"`, `"website"`, `"security"`, and `"details"`.

```bash
cat << 'EOF' > validator.json
{
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "YdlQyhjtrq9pk7afmz6oQ275L4FElzjzEJvB1fj3e1w="
},
"amount": "1000000upokt",
"moniker": "validator",
"identity": "",
"website": "",
"security": "",
"details": "",
"commission-rate": "0.100000000000000000",
"commission-max-rate": "0.200000000000000000",
"commission-max-change-rate": "0.010000000000000000",
"min-self-delegation": "1"
}
EOF
```

### Create the Validator

Run the following command to create the validator:

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

This guide will help you install a Validator on Pocket Network,
**using helpers that abstract out some of the underlying complexity.**
### Verify the Validator Status

### Pre-Requisites
Verify the status of your validator by running:

1. **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
```bash
poktrolld query staking validator $VALIDATOR_ADDR
```
70 changes: 70 additions & 0 deletions docusaurus/docs/operate/faq/validator_faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
sidebar_position: 2
title: Validator FAQ
---

## How do I delegate additional tokens to my Validator?

To increase your self-delegation or allow others to delegate to your Validator, use:

```bash
poktrolld tx staking delegate $VALIDATOR_ADDR <amount> --from <delegator_account> $TX_PARAM_FLAGS $NODE_FLAGS
```

Example with specific parameters:

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

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

To unbond a portion of your staked tokens:

```bash
poktrolld tx staking unbond $VALIDATOR_ADDR <amount> --from <delegator_account> $TX_PARAM_FLAGS $NODE_FLAGS
```

Example with specific parameters:

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

:::note Unbonding lock period

Unbonding initiates a lock period during which tokens cannot be transferred. The duration depends on network configuration.

:::

## How do I check if my node is synchronized?

Use the following command to check your node's synchronization status:

```bash
poktrolld status
```

:::note Synchronization status

Ensure that the `sync_info.catching_up` field is `false` to confirm that your node is fully synchronized.

Your Full Node must be fully synchronized before creating a Validator.

:::

## How do I stay updated with network upgrades?

**Monitor and follow**:

- Upgrade notifications in [Pocket Network's Discord](https://discord.com/invite/pocket-network)
- The [latest recommended version](../../operate/upgrades/upgrade_list.md) documentation

## What security practices should I follow?

- Never share or expose your mnemonic phrases and private keys
- Store private keys and mnemonics in secure locations
- Regularly monitor your Validator's status to prevent jailing from downtime
- When setting up your validator:
- The `commission-rate`, `commission-max-rate`, and `commission-max-change-rate` should be expressed as decimals (e.g., `0.1` for 10%)
- Ensure you have sufficient balance for your specified amounts in `validator.json` and delegations
2 changes: 0 additions & 2 deletions docusaurus/docs/operate/upgrades/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ TODO(#791): The process of adding the `consensus-breaking` label is still not fo
- **Find consensus breaking changes**: Review merged Pull Requests (PRs) with the `consensus-breaking` label.
If any exist, assume the release will require an upgrade.
[Here is a link](https://github.com/pokt-network/poktroll/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Amerged+label%3Aconsensus-breaking) for convenience.

- **Verify a Full Node**: Deploy a Full Node on TestNet and allow it to sync and operate for a few days to verify that no accidentally introduced consensus-breaking changes affect the ability to sync. See the instructions in the [Quickstart Guide](../../operate/cheat_sheets/docker_compose_debian_cheatsheet.md for deploying a Full Node.

- **Update Upgrade List**: If the new release includes an upgrade transaction for automatic upgrades, add the new release to the table in the [Upgrades List](./upgrade_list.md).

:::danger
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/operate/walkthroughs/full_node_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Full Node (Docker)
sidebar_position: 3
---

# Run a Full Node using Docker <!-- omit in toc -->
## Run a Full Node using Docker <!-- omit in toc -->

- [What is a Full Node](#what-is-a-full-node)
- [Roles \& Responsibilities](#roles--responsibilities)
Expand Down Expand Up @@ -56,7 +56,7 @@ Please see the [Hardware Requirements](../configs/hardware_requirements.md#valid

## Docker Compose Example

Please refer to the `Deploying a Full Node` section in [Docker Compose Walkthrough](../walkthroughs/docker_compose_walkthrough.md)
Please refer to the `Deploying a Full Node` section in [Docker Compose Walkthrough](../walkthroughs/full_node_docker.md) for instructions
on how to deploy a Full Node using `docker-compose`.

## Kubernetes Example
Expand Down
Loading

0 comments on commit 091bc35

Please sign in to comment.