-
Notifications
You must be signed in to change notification settings - Fork 13
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
okdas
wants to merge
5
commits into
main
Choose a base branch
from
validator-cheatsheet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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: | ||
|
||
|
@@ -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: | ||
|
||
|
@@ -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 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": "", | ||
|
@@ -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: | ||
|
||
|
@@ -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? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). | ||
|
||
::: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.