Skip to content

Commit

Permalink
Merge branch 'todo_beta/refactor/supplier_staking_fee' into todo_beta…
Browse files Browse the repository at this point in the history
…/params/global_inflation_per_claim

* todo_beta/refactor/supplier_staking_fee: (21 commits)
  chore: add localnet_config option to disable hot-reloading (#979)
  [Code Health] fix: tokenomics module gRPC return errors (#963)
  [Code Health] fix: supplier module gRPC return errors (#962)
  [Supplier] feat: add `staking_fee` param to supplier module (#944)
  [Code Health] fix: application module gRPC status error returns (#954)
  [Code Health] fix: shared module gRPC return errors (#961)
  [Code Health] fix: session module gRPC status return errors (#960)
  [Code Health] fix: service module gRPC status error returns (#959)
  [Code Health] fix: proof module gRPC status error returns (#956)
  [Code Health] fix: gateway module gRPC status error returns (#955)
  [Tokenomics] feat: add `target_num_relays` param to service module (#930)
  chore: review feedback improvements
  chore: review feedback improvements
  [Docs/Tools] Validator: support multiple networks + cheat sheet (#941)
  [Docs] Upgrade list (#928)
  [Service] refactor: `TargetNumRelays` var usage to param usage (#943)
  [Docs] Beta TestNet - Service Cheatsheet (#965)
  Commit outdated proto files
  [Docs] adding params - fix gRPC status error code (#958)
  [Docs] Update links to RPC & explorers (#950)
  ...
  • Loading branch information
bryanchriswhite committed Dec 2, 2024
2 parents a9c9cdd + 9d1c26f commit 89d0554
Show file tree
Hide file tree
Showing 66 changed files with 1,270 additions and 393 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,9 @@ cmd/poktrolld/*debug_bin*
job.yaml

# tmp directory for locally produced artifacts
tmp/*
tmp/*

# Common testing configurations
relayminer_config.yaml
gateway_config.yaml
path_config.yaml
48 changes: 25 additions & 23 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def merge_dicts(base, updates):
# environment is not broken for future engineers.
localnet_config_path = "localnet_config.yaml"
localnet_config_defaults = {
"hot-reloading": True,
"validator": {
"cleanupBeforeEachStart": True,
"logs": {
Expand Down Expand Up @@ -182,29 +183,30 @@ secret_create_generic(
# Import configuration files into Kubernetes ConfigMap
configmap_create("poktrolld-configs", from_file=listdir("localnet/poktrolld/config/"), watch=True)

# Hot reload protobuf changes
local_resource(
"hot-reload: generate protobufs",
"make proto_regen",
deps=["proto"],
labels=["hot-reloading"],
)
# Hot reload the poktrolld binary used by the k8s cluster
local_resource(
"hot-reload: poktrolld",
"GOOS=linux ignite chain build --skip-proto --output=./bin --debug -v",
deps=hot_reload_dirs,
labels=["hot-reloading"],
resource_deps=["hot-reload: generate protobufs"],
)
# Hot reload the local poktrolld binary used by the CLI
local_resource(
"hot-reload: poktrolld - local cli",
"ignite chain build --skip-proto --debug -v -o $(go env GOPATH)/bin",
deps=hot_reload_dirs,
labels=["hot-reloading"],
resource_deps=["hot-reload: generate protobufs"],
)
if localnet_config["hot-reloading"]:
# Hot reload protobuf changes
local_resource(
"hot-reload: generate protobufs",
"make proto_regen",
deps=["proto"],
labels=["hot-reloading"],
)
# Hot reload the poktrolld binary used by the k8s cluster
local_resource(
"hot-reload: poktrolld",
"GOOS=linux ignite chain build --skip-proto --output=./bin --debug -v",
deps=hot_reload_dirs,
labels=["hot-reloading"],
resource_deps=["hot-reload: generate protobufs"],
)
# Hot reload the local poktrolld binary used by the CLI
local_resource(
"hot-reload: poktrolld - local cli",
"ignite chain build --skip-proto --debug -v -o $(go env GOPATH)/bin",
deps=hot_reload_dirs,
labels=["hot-reloading"],
resource_deps=["hot-reload: generate protobufs"],
)

# Build an image with a poktrolld binary
docker_build_with_restart(
Expand Down
2 changes: 1 addition & 1 deletion api/poktroll/application/event.pulsar.go

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

2 changes: 1 addition & 1 deletion api/poktroll/application/types.pulsar.go

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

2 changes: 1 addition & 1 deletion api/poktroll/supplier/event.pulsar.go

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

2 changes: 1 addition & 1 deletion api/poktroll/supplier/tx.pulsar.go

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

2 changes: 1 addition & 1 deletion api/poktroll/tokenomics/event.pulsar.go

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

2 changes: 1 addition & 1 deletion api/poktroll/tokenomics/types.pulsar.go

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

2 changes: 1 addition & 1 deletion docusaurus/docs/develop/developer_guide/adding_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Prepare `x/examplemod/keeper/msg_server_update_param.go` to handle parameter upd
+
+ if k.GetAuthority() != msg.Authority {
+ return nil, status.Error(
+ codes.InvalidArgument,
+ codes.PermissionDenied,
+ examplemodtypes.ErrExamplemodInvalidSigner.Wrapf(
+ "invalid authority; expected %s, got %s",
+ k.GetAuthority(), msg.Authority,
Expand Down
13 changes: 6 additions & 7 deletions docusaurus/docs/explore/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ sidebar_position: 3

## Types of RPC Endpoints


You can review the difference between them in the [Cosmos SDK docs](https://docs.cosmos.network/main/learn/advanced/grpc_rest#comparison-table).

## Beta TestNet
Expand All @@ -22,9 +21,9 @@ You can review the difference between them in the [Cosmos SDK docs](https://docs

We provide `gRPC`, `JSON-RPC` and `REST` endpoints, which are available here:

- **RPC**: `https://shannon-testnet-grove-seed-rpc.beta.poktroll.com`
- **gRPC**: `https://shannon-testnet-grove-seed-grpc.beta.poktroll.com`
- **REST**: `https://shannon-testnet-grove-seed-api.beta.poktroll.com`
- **RPC**: `https://shannon-testnet-grove-rpc.beta.poktroll.com`
- **gRPC**: `https://shannon-testnet-grove-grpc.beta.poktroll.com`
- **REST**: `https://shannon-testnet-grove-api.beta.poktroll.com`

### Beta JSON-RPC Example

Expand All @@ -46,9 +45,9 @@ poktrolld query block --type=height 0 --node https://shannon-testnet-grove-seed-

We provide `gRPC`, `JSON-RPC` and `REST` endpoints, which are available here:

- **RPC**: `https://shannon-testnet-grove-seed-rpc.alpha.poktroll.com`
- **gRPC**: `https://shannon-testnet-grove-seed-grpc.alpha.poktroll.com`
- **REST**: `https://shannon-testnet-grove-seed-api.alpha.poktroll.com`
- **RPC**: `https://shannon-testnet-grove-rpc.alpha.poktroll.com`
- **gRPC**: `https://shannon-testnet-grove-grpc.alpha.poktroll.com`
- **REST**: `https://shannon-testnet-grove-api.alpha.poktroll.com`

### Alpha JSON-RPC Example

Expand Down
14 changes: 8 additions & 6 deletions docusaurus/docs/explore/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ sidebar_position: 1

## Beta TestNet

- 🪙 [Shannon Beta Token Faucet](https://faucet.beta.testnet.pokt.network/)
- 🗺️ [Shannon Beta Explorer](https://shannon.beta.testnet.pokt.network)
- 🗺️ [PoktScan's Shannon Beta Explorer](https://shannon.beta.poktscan.com/)
- 🪙 [Token Faucet](https://faucet.beta.testnet.pokt.network/)
- 🗺️ [Explorer](https://shannon.beta.testnet.pokt.network)
- 🗺️ [POKTScan's Explorer](https://shannon-beta.poktscan.com/)
- 👨‍💻 [POKTScan's GraphQL Playground](https://shannon-beta-api.poktscan.com/)

## Alpha TestNet

- 🪙 [Shannon Alpha Token Faucet](https://faucet.alpha.testnet.pokt.network/)
- 🗺️ [Shannon Alpha Explorer](https://shannon.alpha.testnet.pokt.network)
- 🗺️ [PoktScan's Shannon Alpha Explorer](https://shannon.alpha.poktscan.com/)
- 🪙 [Token Faucet](https://faucet.alpha.testnet.pokt.network/)
- 🗺️ [Explorer](https://shannon.alpha.testnet.pokt.network)
- 🗺️ [POKTScan's Explorer](https://shannon-alpha.poktscan.com/)
- 👨‍💻 [POKTScan's GraphQL Playground](https://shannon-alpha-api.poktscan.com/)

## 🛠️ Tools & References

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import ReactPlayer from "react-player";
- [Faucet is not ready and you need to fund the accounts manually](#faucet-is-not-ready-and-you-need-to-fund-the-accounts-manually)
- [Start the RelayMiner](#start-the-relayminer)
- [Start the AppGate Server](#start-the-appgate-server)
- [Re-stake the gateway](#re-stake-the-gateway)

## Results

Expand Down Expand Up @@ -73,7 +72,7 @@ sudo apt-get update
if command -v ufw > /dev/null 2>&1; then
sudo ufw allow from 172.16.0.0/12
sudo ufw allow from 192.168.0.0/16
echo "UFW rules added for Docker networks"
echo "UFW rules added for Docker networks and validator endpoint"
else
echo "UFW is not installed, skipping firewall configuration"
fi
Expand All @@ -85,6 +84,16 @@ And then install docker:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

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

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

## Retrieve the source code

Then pull the github repo
Expand All @@ -97,9 +106,18 @@ cd poktroll-docker-compose-example

## Update your environment

First, copy the sample environment file:
```bash
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

Then set your external IP and source the environment:
```bash
EXTERNAL_IP=$(curl -4 ifconfig.me/ip)
sed -i -e s/NODE_HOSTNAME=/NODE_HOSTNAME=$EXTERNAL_IP/g .env

Expand All @@ -110,6 +128,13 @@ source ~/.bashrc

## Start up the full node


:::warning
The Alpha TestNet currently requires manual steps to sync the node to the latest block. Please find the affected block(s)
in [this document](../../protocol/upgrades/upgrade_list.md), which leads to the manual upgrade instructions.
:::


```bash
docker compose up -d full-node
# Optional: watch the block height sync up & logs
Expand Down Expand Up @@ -153,15 +178,19 @@ FINALLY, `source .env` to update the environment variables.

## Fund your accounts

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

```bash
show_actor_addresses
```

For each one, fund the accounts using the [faucet](https://faucet.testnet.pokt.network/)
Get the faucet URL for your network:

Next, run this helper (it's part of `helpers.sh`) to find each of them on the explorer:
```bash
show_faucet_url
```

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 Expand Up @@ -320,5 +349,3 @@ docker compose up -d appgate
# View
docker logs -f --tail 100 appgate
```

### Re-stake the gateway
43 changes: 42 additions & 1 deletion docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ flowchart TB
_Note: the system must be capable of exposing ports to the internet for
peer-to-peer communication._

### 0. Software & Tooling <!-- omit in toc -->
### Software & Tooling <!-- omit in toc -->

Ensure the following software is installed on your system:

Expand Down Expand Up @@ -152,10 +152,51 @@ 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.

:::

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:

```bash
su - olshansky
```

You can also 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
```

## A. Deploying a Full Node

### Launch the Node <!-- omit in toc -->

:::warning
The Alpha TestNet currently requires manual steps to sync the node to the latest block. Please find the affected block(s)
in [this document](../../protocol/upgrades/upgrade_list.md), which leads to the manual upgrade instructions.
:::

_Note: You may need to replace `docker-compose` with `docker compose` if you are
running a newer version of Docker where `docker-compose` is integrated into `docker` itself._

Expand Down
Loading

0 comments on commit 89d0554

Please sign in to comment.