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] Beta TestNet - Supplier Cheatsheet #947

Merged
merged 34 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f1f6136
WIP - Supplier cheatsheet
Olshansk Nov 21, 2024
98c3a89
WIP
Olshansk Nov 22, 2024
6303665
[Docs] Update links to RPC & explorers (#950)
Olshansk Nov 21, 2024
bd24703
Merge branch 'main' into supplier_cheatsheet
Olshansk Nov 25, 2024
f88ca87
Saving some old WIP
Olshansk Nov 25, 2024
2db06ee
Removed configs that sholdn't have been commited
Olshansk Nov 25, 2024
9ce8b2f
Finishing the service cheatsheet
Olshansk Nov 25, 2024
65a825d
Merge branch 'main' into service_cheasheet
Olshansk Nov 25, 2024
9fa7461
self review
Olshansk Nov 25, 2024
d952e5c
self review
Olshansk Nov 25, 2024
3b3c78e
Add back the supplier cheatsheet
Olshansk Nov 25, 2024
0c0794b
self review
Olshansk Nov 25, 2024
b1c22f8
Merge branch 'service_cheasheet' into supplier_cheatsheet
Olshansk Nov 25, 2024
fefd306
Adding the supplier cheatsheet back
Olshansk Nov 25, 2024
081f13f
Checkpoint
Olshansk Nov 26, 2024
6d2edc4
Merge with main
Olshansk Nov 26, 2024
9aed445
Merge branch 'main' into supplier_cheatsheet
Olshansk Dec 3, 2024
c293e09
Checkpoint - reviewing full node configs
Olshansk Dec 4, 2024
b0c00cf
Finish reviewing the full node walkthrough
Olshansk Dec 4, 2024
10c6598
Update the cheatsheet
Olshansk Dec 4, 2024
c2a22ac
rm supplier docs
Olshansk Dec 4, 2024
f2ac3fc
add supplier docs
Olshansk Dec 4, 2024
b196471
Merge with main
Olshansk Dec 5, 2024
8d64e2a
Merge branch 'main' into supplier_cheatsheet
Olshansk Dec 12, 2024
46fea4d
Updated the supplier cheatsheet
Olshansk Dec 13, 2024
2b0a9ac
Merge branch 'main' into supplier_cheatsheet
Olshansk Dec 13, 2024
53df701
Merge branch 'main' into supplier_cheatsheet
Olshansk Dec 16, 2024
dcafa02
Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md
Olshansk Dec 16, 2024
c9e0ff3
Apply some suggestions from code review
Olshansk Dec 17, 2024
2090fad
Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md
Olshansk Dec 17, 2024
3c6148d
Apply suggestions from code review
Olshansk Dec 17, 2024
d0a4925
Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md
Olshansk Dec 17, 2024
a88ed62
Followed up on some comments
Olshansk Dec 17, 2024
19e6f9b
Follow up on all comments
Olshansk Dec 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
You can optionally create a new user and give it sudo permissions instead of using `root`.

```bash
export USERNAME=olshansky
sudo adduser $USERNAME
sudo usermod -aG sudo $USERNAME
sudo adduser poktroll
sudo usermod -aG sudo poktroll
su - poktroll
```

## Retrieve the source code
Expand All @@ -114,9 +114,9 @@ cp .env.sample .env

By default, the `.env` file uses `testnet-beta`. If you want to use a different network, update the `NETWORK_NAME` in your `.env` file to one of:

- `testnet-alpha` - Unstable testnet
- `testnet-beta` - Stable testnet (default)
- `mainnet` - Production network
- `testnet-alpha`: Unstable testnet (use at your own risk)
- `testnet-beta`: Stable testnet (default)
- `mainnet`: Production network (not launched yet)

Then set your external IP and source the environment:

Expand Down Expand Up @@ -179,7 +179,7 @@ FINALLY, `source .env` to update the environment variables.

## Fund your accounts

Run the following to see your addresses:
Run the following helper command to see your addresses:

```bash
show_actor_addresses
Expand All @@ -191,7 +191,8 @@ Get the faucet URL for your network:
show_faucet_url
```

Fund each address using the faucet URL shown above. Then run this helper to find each account on the explorer:
Fund each address using the faucet URL shown above.
Then run this helper to find each account on the explorer:

```bash
show_explorer_urls
Expand Down
25 changes: 7 additions & 18 deletions docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,40 +152,29 @@ Update `NODE_HOSTNAME` in `.env` to the IP address or hostname of your node. For
sed -i -e s/NODE_HOSTNAME=/NODE_HOSTNAME=69.42.690.420/g .env
```

### [Optional] Create a new user <!-- omit in toc -->

:::note

Make sure to replace `olshansky` with your username.

:::
### [Recommended] Create a new user <!-- omit in toc -->

You can generally do everything as the `root` user, but it's recommended to
create a new user and give it sudo permissions.

This is necessary, in particular, if you want to use [homebrew](https://brew.sh/) [to install `poktrolld`](../user_guide/install.md).

```bash
# Create a new user and give sudo permissions
export USERNAME=olshansky
sudo adduser $USERNAME
sudo usermod -aG sudo $USERNAME
```

Then, switch to the new user:
You can create a new user (e.g. poktroll), provide sudo permissions and switch users like so:

```bash
su - olshansky
sudo adduser poktroll
sudo usermod -aG sudo poktroll
su - poktroll
```

You can also avoid needing to pass in the password each time by running the following:
In order to avoid needing to pass in the password each time by running the following:

```bash
# Optionally avoid needing to provide a password
sudo vi /etc/sudoers

# Add the following line to the end of the file
olshansky ALL=(ALL) NOPASSWD:ALL
poktroll ALL=(ALL) NOPASSWD:ALL
```

## A. Deploying a Full Node
Expand Down
30 changes: 27 additions & 3 deletions docusaurus/docs/operate/quickstart/full_node_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
---
sidebar_position: 3
title: Full Node Cheat Sheet
sidebar_position: 3
---

This cheat sheet provides quick instructions for installing a Full Node using an automated script.
## Full Node Walkthrough (Using Systemd) <!-- omit in toc -->

This cheat sheet provides quick copy-pasta like instructions for installing and
running a Full Node using an automated scripts.

:::tip

If you're interesting in understanding everything, or having full control of every
step, check out the [Full Node Walkthrough](../run_a_node/full_node_walkthrough.md).

:::

- [Introduction](#introduction)
- [Pre-Requisites](#pre-requisites)
- [Install a Full Node using Cosmovisor](#install-a-full-node-using-cosmovisor)
- [What Gets Installed](#what-gets-installed)
Expand All @@ -17,6 +28,13 @@ This cheat sheet provides quick instructions for installing a Full Node using an
- [Advanced Operations](#advanced-operations)
- [Automatic Upgrades](#automatic-upgrades)

### Introduction

This guide will help you install a Full Node for Pocket Network,
**using helper that abstract out some of the underlying complexity.**

Running a Full Node is the first step toward becoming a Validator, Supplier, or Gateway.

### Pre-Requisites

1. **Linux-based System**: Ensure you have a Debian-based Linux distribution (other distributions may work but are not fully supported).
Expand Down Expand Up @@ -56,11 +74,13 @@ When you run the installation script, the following components are set up:
1. **System User**: A dedicated user (default: `poktroll`) is created to run the node securely.

2. **Cosmovisor**: A binary manager that handles chain upgrades automatically:

- Location: `/home/poktroll/bin/cosmovisor`
- Purpose: Manages different versions of `poktrolld` and handles chain upgrades
- Configuration: Set up to automatically download and switch to new binaries during upgrades

3. **Poktrolld**: The core node software:

- Location: `/home/poktroll/.poktroll/cosmovisor/genesis/bin/poktrolld`
- Configuration: `/home/poktroll/.poktroll/config/`
- Data: `/home/poktroll/.poktroll/data/`
Expand Down Expand Up @@ -107,21 +127,25 @@ sudo systemctl restart cosmovisor.service
#### Advanced Operations

Check the current version:

```bash
sudo -u poktroll poktrolld version
```

View the Cosmovisor directory structure:

```bash
ls -la /home/poktroll/.poktroll/cosmovisor/
```

Check if an upgrade is available:

```bash
ls -la /home/poktroll/.poktroll/cosmovisor/upgrades/
```

View node configuration:

```bash
cat /home/poktroll/.poktroll/config/config.toml
```
Expand All @@ -137,7 +161,7 @@ Your node is configured to handle chain upgrades automatically through Cosmoviso

No manual intervention is required for standard upgrades.

<!--
<!--
## Becoming a Validator

TODO(@okdas, #754): Add instructions for becoming a validator.
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/docs/operate/quickstart/gateway_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 7
title: Gateway Cheat Sheet
---

Expand Down Expand Up @@ -91,8 +91,8 @@ export APP_ADDR=$(poktrolld keys show application -a)

:::tip

You can put the above in a special `~/.pocketrc` and add `source ~/.pocketrc` to
your `~/.bashrc` file for a cleaner organization.
You can put the above in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to
your `~/.profile` file for a cleaner organization.

:::

Expand Down
9 changes: 5 additions & 4 deletions docusaurus/docs/operate/quickstart/service_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 6
sidebar_position: 5
title: Service Cheat Sheet
---

Expand Down Expand Up @@ -60,21 +60,22 @@ Here is an example of the output on Beta TestNet as of writing this document:
You can use the `add-service` command to create a new service like so:

```bash
poktrolld tx service add-service ${SERVICE_ID} "${SERVICE_NAME_OR_DESCRIPTION}" ${COMPUTE_UNITS_PER_RELAY} --from ${SERVICE_OWNER}
poktrolld tx service add-service ${SERVICE_ID} "${SERVICE_NAME_OR_DESCRIPTION}" ${COMPUTE_UNITS_PER_RELAY} \
--fees 1upokt --from ${SERVICE_OWNER} --chain-id ${CHAIN_ID}
```

Here is a concrete copy-pasta assuming you have created and funded a new account called `$USER`:

```bash
poktrolld tx service add-service "svc-$USER" "service description for $USER" 69 \
poktrolld tx service add-service "svc-$USER" "service description for $USER" 13 \
--node https://shannon-testnet-grove-rpc.beta.poktroll.com \
--fees 1upokt --from $USER --chain-id pocket-beta
```

Optionally, you can add some more flags to be ultra-verbose about your local environment:

```bash
poktrolld tx service add-service "svc-$USER" "service description for $USER" 69 \
poktrolld tx service add-service "svc-$USER" "service description for $USER" 13 \
--node https://shannon-testnet-grove-rpc.beta.poktroll.com \
--fees 1upokt --from $USER --chain-id pocket-beta \
--home ~/.poktroll --keyring-backend test \
Expand Down
163 changes: 163 additions & 0 deletions docusaurus/docs/operate/quickstart/supplier_cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
sidebar_position: 6
title: Supplier (RelayMiner) Cheat Sheet
---

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

- [Context](#context)
- [Pre-Requisites](#pre-requisites)
- [Suppliers](#suppliers)
- [How do I query for all existing onchain Suppliers?](#how-do-i-query-for-all-existing-onchain-suppliers)
- [How do I stake an onchain Supplier?](#how-do-i-stake-an-onchain-supplier)
- [Supplier Configuration](#supplier-configuration)
- [Supplier Transaction](#supplier-transaction)
- [How do I learn more about interacting with Suppliers?](#how-do-i-learn-more-about-interacting-with-suppliers)
- [Supplier Transactions](#supplier-transactions)
- [Supplier Queries](#supplier-queries)
- [RelayMiners](#relayminers)
- [Retrieve the source code](#retrieve-the-source-code)

### Context

This document is a cheat sheet to get you quickly started with two things:

1. Staking an onchain `Supplier`
2. Deploying an offchain `RelayMiner`

By the end of it, you should be able to serve Relays onchain.
Olshansk marked this conversation as resolved.
Show resolved Hide resolved

:::tip

It is intended to be a < 10 minute quick copy-pasta.

If you're interested in spending hours reading and understanding how things work,
please see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md)

:::

### Pre-Requisites

1. Make sure to [install the `poktrolld` CLI](../user_guide/install.md).
2. Make sure you know how to [create and fund a new `account`](../user_guide/create-new-wallet.md).
3. You have either [staked a new `service` or found an existing](./service_cheatsheet.md).
4. `[Optional]` You can run things locally or have dedicated long-running hardware. See the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) if you're interested in the latter.

### Suppliers

#### How do I query for all existing onchain Suppliers?

Then, you can query for all services like so:

```bash
poktrolld query supplier list-supplier --node https://shannon-testnet-grove-rpc.beta.poktroll.com --output json | jq
```

#### How do I stake an onchain Supplier?

:::tip

For an in-depth look at how to stake a supplier, see the [Supplier configuration docs](./../configs/supplier_staking_config.md).

:::

The following is a very quick and simple way to get you started by staking for
Pocket Network's Morse service on Shannon using a public RPC endpoint provided by
[Liquify](https://liquify.com/).

```yaml
owner_address: pokt1v6ap5mmaaldw35vrhtmwm6uxr9dn3jz8zj9cmk
operator_address: pokt1v6ap5mmaaldw35vrhtmwm6uxr9dn3jz8zj9cmk
stake_amount: 1000069upokt
default_rev_share_percent:
pokt1v6ap5mmaaldw35vrhtmwm6uxr9dn3jz8zj9cmk: 100
services:
- service_id: "morse"
endpoints:
- publicly_exposed_url: https://pocket-rpc.liquify.com
rpc_type: JSON_RPC
```

```
poktrolld tx supplier stake-supplier --config /var/folders/th/667_sx1j13343j4_k93ppf380000gn/T/tmp0gqsnj4k --from user_key_2ui31x --yes --output json --node tcp://127.0.0.1:26657 --chain-id poktroll --home /Users/olshansky/workspace/pocket/poktroll/localnet/poktrolld --keyring-backend test
```

Here is an example of the output on Beta TestNet as of writing this document:

```json
default_signing_key_names: [user_key_ste8bz]
smt_store_path: /tmp/poktroll/smt
metrics:
enabled: true
addr: :9091
pocket_node:
query_node_rpc_url: https://shannon-testnet-grove-rpc.beta.poktroll.com
query_node_grpc_url: https://shannon-testnet-grove-grpc.beta.poktroll.com
tx_node_rpc_url: https://shannon-testnet-grove-rpc.beta.poktroll.com
suppliers:
- service_id: svc_8ymf38
listen_url: http://localhost:8500
service_config:
backend_url: http://localhost:8547
publicly_exposed_endpoints:
- localhost
pprof:
enabled: false
addr: localhost:6060
ping:
enabled: false
addr: localhost:8082
```

#### Supplier Configuration

#### Supplier Transaction

poktrolld tx supplier stake-supplier --config /var/folders/th/667_sx1j13343j4_k93ppf380000gn/T/tmp0gqsnj4k --from user_key_2ui31x --yes --output json --node tcp://127.0.0.1:26657 --chain-id poktroll --home /Users/olshansky/workspace/pocket/poktroll/localnet/poktrolld --keyring-backend test
You can use the `ad d-service` command to create a new service like so:

```bash
poktrolld tx service add-service ${SERVICE_ID} "${SERVICE_NAME_OR_DESCRIPTION}" ${COMPUTE_UNITS_PER_RELAY} --from ${SERVICE_OWNER}
```

Here is a concrete copy-pasta assuming you have created and funded a new account called `$USER`:

```bash
poktrolld tx service add-service "svc-$USER" "service description for $USER" 69 \
--node https://shannon-testnet-grove-rpc.beta.poktroll.com \
--fees 1upokt --from $USER --chain-id pocket-beta
```

Optionally, you can add some more flags to be ultra-verbose about your local environment:

```bash
poktrolld tx service add-service "svc-$USER" "service description for $USER" 69 \
--node https://shannon-testnet-grove-rpc.beta.poktroll.com \
--fees 1upokt --from $USER --chain-id pocket-beta \
--home ~/.poktroll --keyring-backend test \
--yes --output json
```

### How do I learn more about interacting with Suppliers?

#### Supplier Transactions

```bash
poktrolld tx supplier -h
```

#### Supplier Queries

```bash
poktrolld query supplier -h
```

### RelayMiners

#### Retrieve the source code

```bash
mkdir ~/workspace && cd ~/workspace
git clone https://github.com/pokt-network/poktroll-docker-compose-example.git
cd poktroll-docker-compose-example
```
Loading
Loading