From f1f6136608ce25ca0e9e069c94753ea76099937b Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 21 Nov 2024 12:30:42 -0800 Subject: [PATCH 01/25] WIP - Supplier cheatsheet --- .../operate/quickstart/supplier_cheatsheet.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 5e991ed70..278b9f467 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -1,10 +1,16 @@ --- sidebar_position: 4 -title: Supplier Cheat Sheet +title: Supplier (RelayMiner) Cheat Sheet --- ## Supplier Cheat Sheet +You can follow the simple copy-pasta guide below to quickly deploy a RelayMiner +and become a Supplier on the Pocket Network. + +- [0. Deploy your Server \& Install Dependencies](#0-deploy-your-server--install-dependencies) +- [1. Retrieve the source code](#1-retrieve-the-source-code) + :::tip See the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md) for an in-depth guide on setting up a Supplier. @@ -12,3 +18,19 @@ See the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md) for an i ::: TODO_BETA(@olshansk): Finish this page. + +### 0. Deploy your Server & Install Dependencies + +You can deploy a RelayMiner on any server. + +If you are just getting started, you can follow along the team at Grove and follow +the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) +to deploy a Debian server on a Vultr instance. + +### 1. 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 +``` From 98c3a895812acd7d027428a1a4b2a0d7fb3cd294 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 21 Nov 2024 16:04:55 -0800 Subject: [PATCH 02/25] WIP --- .../docker_compose_debian_cheatsheet.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index 6493b012e..d7f6619ad 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -10,6 +10,7 @@ import ReactPlayer from "react-player"; - [Results](#results) - [Deploy your server](#deploy-your-server) - [Install Dependencies](#install-dependencies) + - [Create a new user](#create-a-new-user) - [Retrieve the source code](#retrieve-the-source-code) - [Update your environment](#update-your-environment) - [Start up the full node](#start-up-the-full-node) @@ -85,6 +86,26 @@ And then install docker: sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` +### Create a new user + +Make sure to replace `olshansky` with your username. + +```bash +# Create a new user and give sudo permissions +export USERNAME=olshansky +sudo adduser olshansky +sudo usermod -aG sudo olshansky + +# Optionally avoid needing to provide a password +sudo /etc/sudoers + +# Add the following line to the end of the file +olshansky ALL=(ALL) NOPASSWD:ALL + +# Switch to the new user +su - olshansky +``` + ## Retrieve the source code Then pull the github repo From 6303665cf0467bbef107cdbccde1248edb5ededb Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 21 Nov 2024 13:37:57 -0800 Subject: [PATCH 03/25] [Docs] Update links to RPC & explorers (#950) Update links to RPC endpoints, faucet & explorers --- docusaurus/docs/explore/rpc.md | 13 ++++++------- docusaurus/docs/explore/tools.md | 14 ++++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docusaurus/docs/explore/rpc.md b/docusaurus/docs/explore/rpc.md index a87c5e1a2..5a407e2ce 100644 --- a/docusaurus/docs/explore/rpc.md +++ b/docusaurus/docs/explore/rpc.md @@ -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 @@ -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 @@ -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 diff --git a/docusaurus/docs/explore/tools.md b/docusaurus/docs/explore/tools.md index 1034d1565..9e46f4f64 100644 --- a/docusaurus/docs/explore/tools.md +++ b/docusaurus/docs/explore/tools.md @@ -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 From f88ca878b16142c8469b60c45bd4f3d7155f3cd4 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 12:08:10 -0800 Subject: [PATCH 04/25] Saving some old WIP --- api/poktroll/application/event.pulsar.go | 2 +- api/poktroll/application/types.pulsar.go | 2 +- api/poktroll/supplier/event.pulsar.go | 2 +- api/poktroll/supplier/tx.pulsar.go | 2 +- api/poktroll/tokenomics/event.pulsar.go | 2 +- api/poktroll/tokenomics/types.pulsar.go | 2 +- config/app.toml | 259 ++++++++++++ config/client.toml | 17 + config/config.toml | 498 +++++++++++++++++++++++ pkg/appgateserver/cmd/cmd.go | 3 +- pkg/relayer/cmd/cmd.go | 3 +- relayminer_config.toml | 23 ++ ~/.poktroll/config/app.toml | 259 ++++++++++++ ~/.poktroll/config/client.toml | 17 + ~/.poktroll/config/config.toml | 498 +++++++++++++++++++++++ 15 files changed, 1581 insertions(+), 8 deletions(-) create mode 100644 config/app.toml create mode 100644 config/client.toml create mode 100644 config/config.toml create mode 100644 relayminer_config.toml create mode 100644 ~/.poktroll/config/app.toml create mode 100644 ~/.poktroll/config/client.toml create mode 100644 ~/.poktroll/config/config.toml diff --git a/api/poktroll/application/event.pulsar.go b/api/poktroll/application/event.pulsar.go index 292a46750..09bac55c2 100644 --- a/api/poktroll/application/event.pulsar.go +++ b/api/poktroll/application/event.pulsar.go @@ -3,11 +3,11 @@ package application import ( _ "cosmossdk.io/api/cosmos/base/v1beta1" + _ "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/application/types.pulsar.go b/api/poktroll/application/types.pulsar.go index ca032ba67..f482e77bb 100644 --- a/api/poktroll/application/types.pulsar.go +++ b/api/poktroll/application/types.pulsar.go @@ -3,11 +3,11 @@ package application import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/supplier/event.pulsar.go b/api/poktroll/supplier/event.pulsar.go index 8558365eb..22dcc4989 100644 --- a/api/poktroll/supplier/event.pulsar.go +++ b/api/poktroll/supplier/event.pulsar.go @@ -3,11 +3,11 @@ package supplier import ( _ "cosmossdk.io/api/cosmos/base/v1beta1" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index 7a709f7f0..1d2057b01 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -5,11 +5,11 @@ import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/tokenomics/event.pulsar.go b/api/poktroll/tokenomics/event.pulsar.go index e62c41344..af0c412dc 100644 --- a/api/poktroll/tokenomics/event.pulsar.go +++ b/api/poktroll/tokenomics/event.pulsar.go @@ -3,10 +3,10 @@ package tokenomics import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + proof "github.com/pokt-network/poktroll/api/poktroll/proof" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - proof "github.com/pokt-network/poktroll/api/poktroll/proof" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/api/poktroll/tokenomics/types.pulsar.go b/api/poktroll/tokenomics/types.pulsar.go index 9ca1a54f9..e48600e95 100644 --- a/api/poktroll/tokenomics/types.pulsar.go +++ b/api/poktroll/tokenomics/types.pulsar.go @@ -3,11 +3,11 @@ package tokenomics import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + proof "github.com/pokt-network/poktroll/api/poktroll/proof" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - proof "github.com/pokt-network/poktroll/api/poktroll/proof" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" diff --git a/config/app.toml b/config/app.toml new file mode 100644 index 000000000..ad5cb1837 --- /dev/null +++ b/config/app.toml @@ -0,0 +1,259 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1,0.0001token2). +minimum-gas-prices = "0.000000001upokt" + +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "nothing" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from CometBFT. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning CometBFT blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: CometBFT block pruning is dependant on this parameter in conjunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs CometBFT what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in CometBFT's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = true + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 86400 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "mem" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "" + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = true + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +# NOTE: gRPC-Web uses the same address as the API server. +enable = true + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 0 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### State Streaming ### +############################################################################### + +# Streaming allows nodes to stream state to external systems. +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] + +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] + +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "" + +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = 10000 + + ############################################################################### + ### Poktroll ### + ############################################################################### + + # Poktroll-specific app configuration for Full Nodes and Validators. + [poktroll] + + # Telemetry configuration in addition to the [telemetry] settings. + [poktroll.telemetry] + + # Cardinality level for telemetry metrics collection + # This controls the level of detail (number of unique labels) in metrics. + # Options: + # - "low": Collects basic metrics with low cardinality. + # Suitable for production environments with tight performance constraints. + # - "medium": Collects a moderate number of labels, balancing detail and performance. + # Suitable for moderate workloads or staging environments. + # - "high": WARNING: WILL CAUSE STRESS TO YOUR MONITORING ENVIRONMENT! Collects detailed metrics with high + # cardinality, including labels with many unique values (e.g., application_id, session_id). + # Recommended for debugging or testing environments. + cardinality-level = "medium" + \ No newline at end of file diff --git a/config/client.toml b/config/client.toml new file mode 100644 index 000000000..99d761c8f --- /dev/null +++ b/config/client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "poktroll" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/config/config.toml b/config/config.toml new file mode 100644 index 000000000..2a83acf8a --- /dev/null +++ b/config/config.toml @@ -0,0 +1,498 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or +# relative to the home directory (e.g. "data"). The home directory is +# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable +# or --home cmd flag. + +# The version of the CometBFT binary that created or +# last modified the config file. Do not modify this. +version = "0.38.10" + +####################################################################### +### Main Base Config Options ### +####################################################################### + +# TCP or UNIX socket address of the ABCI application, +# or the name of an ABCI application compiled in with the CometBFT binary +proxy_app = "tcp://127.0.0.1:26658" + +# A custom human readable name for this node +moniker = "olshansky-mbp.local" + +# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb +# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# - pure go +# - stable +# * cleveldb (uses levigo wrapper) +# - fast +# - requires gcc +# - use cleveldb build tag (go build -tags cleveldb) +# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) +# - EXPERIMENTAL +# - may be faster is some use-cases (random reads - indexer) +# - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) +# * badgerdb (uses github.com/dgraph-io/badger) +# - EXPERIMENTAL +# - use badgerdb build tag (go build -tags badgerdb) +db_backend = "goleveldb" + +# Database directory +db_dir = "data" + +# Output level for logging, including package level options +log_level = "info" + +# Output format: 'plain' (colored text) or 'json' +log_format = "plain" + +##### additional base config options ##### + +# Path to the JSON file containing the initial validator set and other meta data +genesis_file = "config/genesis.json" + +# Path to the JSON file containing the private key to use as a validator in the consensus protocol +priv_validator_key_file = "config/priv_validator_key.json" + +# Path to the JSON file containing the last sign state of a validator +priv_validator_state_file = "data/priv_validator_state.json" + +# TCP or UNIX socket address for CometBFT to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" + +# Mechanism to connect to the ABCI application: socket | grpc +abci = "socket" + +# If true, query the ABCI app on connecting to a new peer +# so the app can decide if we should keep the connection or not +filter_peers = false + + +####################################################################### +### Advanced Configuration Options ### +####################################################################### + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://127.0.0.1:26657" + +# A list of origins a cross-domain request can be executed from +# Default value '[]' disables cors support +# Use '["*"]' to allow any origin +cors_allowed_origins = [] + +# A list of methods the client is allowed to use with cross-domain requests +cors_allowed_methods = ["HEAD", "GET", "POST", ] + +# A list of non simple headers the client is allowed to use with cross-domain requests +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] + +# TCP or UNIX socket address for the gRPC server to listen on +# NOTE: This server only supports /broadcast_tx_commit +grpc_laddr = "" + +# Maximum number of simultaneous connections. +# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +grpc_max_open_connections = 900 + +# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool +unsafe = false + +# Maximum number of simultaneous connections (including WebSocket). +# Does not include gRPC connections. See grpc_max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 + +# Maximum number of unique clientIDs that can /subscribe +# If you're using /broadcast_tx_commit, set to the estimated maximum number +# of broadcast_tx_commit calls per block. +max_subscription_clients = 100 + +# Maximum number of unique queries a given client can /subscribe to +# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to +# the estimated # maximum number of broadcast_tx_commit calls per block. +max_subscriptions_per_client = 5 + +# Experimental parameter to specify the maximum number of events a node will +# buffer, per subscription, before returning an error and closing the +# subscription. Must be set to at least 100, but higher values will accommodate +# higher event throughput rates (and will use more memory). +experimental_subscription_buffer_size = 200 + +# Experimental parameter to specify the maximum number of RPC responses that +# can be buffered per WebSocket client. If clients cannot read from the +# WebSocket endpoint fast enough, they will be disconnected, so increasing this +# parameter may reduce the chances of them being disconnected (but will cause +# the node to use more memory). +# +# Must be at least the same as "experimental_subscription_buffer_size", +# otherwise connections could be dropped unnecessarily. This value should +# ideally be somewhat higher than "experimental_subscription_buffer_size" to +# accommodate non-subscription-related RPC responses. +experimental_websocket_write_buffer_size = 200 + +# If a WebSocket client cannot read fast enough, at present we may +# silently drop events instead of generating an error or disconnecting the +# client. +# +# Enabling this experimental parameter will cause the WebSocket connection to +# be closed instead if it cannot read fast enough, allowing for greater +# predictability in subscription behavior. +experimental_close_on_slow_client = false + +# How long to wait for a tx to be committed during /broadcast_tx_commit. +# WARNING: Using a value larger than 10s will result in increasing the +# global HTTP write timeout, which applies to all connections and endpoints. +# See https://github.com/tendermint/tendermint/issues/3435 +timeout_broadcast_tx_commit = "10s" + +# Maximum number of requests that can be sent in a batch +# If the value is set to '0' (zero-value), then no maximum batch size will be +# enforced for a JSON-RPC batch request. +max_request_batch_size = 10 + +# Maximum size of request body, in bytes +max_body_bytes = 1000000 + +# Maximum size of request header, in bytes +max_header_bytes = 1048576 + +# The path to a file containing certificate that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# If the certificate is signed by a certificate authority, +# the certFile should be the concatenation of the server's certificate, any intermediates, +# and the CA's certificate. +# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_cert_file = "" + +# The path to a file containing matching private key that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_key_file = "" + +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = "localhost:6060" + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# Address to advertise to peers for them to dial. If empty, will use the same +# port as the laddr, and will introspect on the listener to figure out the +# address. IP and port are required. Example: 159.89.10.97:26656 +external_address = "" + +# Comma separated list of seed nodes to connect to +seeds = "" + +# Comma separated list of nodes to keep persistent connections to +persistent_peers = "" + +# Path to address book +addr_book_file = "config/addrbook.json" + +# Set true for strict address routability rules +# Set false for private or local networks +addr_book_strict = true + +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 10 + +# List of node IDs, to which a connection will be (re)established ignoring any existing limits +unconditional_peer_ids = "" + +# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) +persistent_peers_max_dial_period = "0s" + +# Time to wait before flushing messages out on the connection +flush_throttle_timeout = "100ms" + +# Maximum size of a message packet payload, in bytes +max_packet_msg_payload_size = 1024 + +# Rate at which packets can be sent, in bytes/second +send_rate = 5120000 + +# Rate at which packets can be received, in bytes/second +recv_rate = 5120000 + +# Set true to enable the peer-exchange reactor +pex = true + +# Seed mode, in which node constantly crawls the network and looks for +# peers. If another node asks it for addresses, it responds and disconnects. +# +# Does not work if the peer-exchange reactor is disabled. +seed_mode = false + +# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) +private_peer_ids = "" + +# Toggle to disable guard against peers connecting from the same ip. +allow_duplicate_ip = false + +# Peer connection configuration. +handshake_timeout = "20s" +dial_timeout = "3s" + +####################################################### +### Mempool Configuration Option ### +####################################################### +[mempool] + +# The type of mempool for this node to use. +# +# Possible types: +# - "flood" : concurrent linked list mempool with flooding gossip protocol +# (default) +# - "nop" : nop-mempool (short for no operation; the ABCI app is responsible +# for storing, disseminating and proposing txs). "create_empty_blocks=false" is +# not supported. +type = "flood" + +# Recheck (default: true) defines whether CometBFT should recheck the +# validity for all remaining transaction in the mempool after a block. +# Since a block affects the application state, some transactions in the +# mempool may become invalid. If this does not apply to your application, +# you can disable rechecking. +recheck = true + +# recheck_timeout is the time the application has during the rechecking process +# to return CheckTx responses, once all requests have been sent. Responses that +# arrive after the timeout expires are discarded. It only applies to +# non-local ABCI clients and when recheck is enabled. +# +# The ideal value will strongly depend on the application. It could roughly be estimated as the +# average size of the mempool multiplied by the average time it takes the application to validate one +# transaction. We consider that the ABCI application runs in the same location as the CometBFT binary +# so that the recheck duration is not affected by network delays when making requests and receiving responses. +recheck_timeout = "1s" + +# Broadcast (default: true) defines whether the mempool should relay +# transactions to other peers. Setting this to false will stop the mempool +# from relaying transactions to other peers until they are included in a +# block. In other words, if Broadcast is disabled, only the peer you send +# the tx to will see it until it is included in a block. +broadcast = true + +# WalPath (default: "") configures the location of the Write Ahead Log +# (WAL) for the mempool. The WAL is disabled by default. To enable, set +# WalPath to where you want the WAL to be written (e.g. +# "data/mempool.wal"). +wal_dir = "" + +# Maximum number of transactions in the mempool +size = 5000 + +# Limit the total size of all txs in the mempool. +# This only accounts for raw transactions (e.g. given 1MB transactions and +# max_txs_bytes=5MB, mempool will only accept 5 transactions). +max_txs_bytes = 1073741824 + +# Size of the cache (used to filter transactions we saw earlier) in transactions +cache_size = 10000 + +# Do not remove invalid transactions from the cache (default: false) +# Set to true if it's not possible for any invalid transaction to become valid +# again in the future. +keep-invalid-txs-in-cache = false + +# Maximum size of a single transaction. +# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. +max_tx_bytes = 1048576 + +# Maximum size of a batch of transactions to send to a peer +# Including space needed by encoding (one varint per transaction). +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 +max_batch_bytes = 0 + +# Experimental parameters to limit gossiping txs to up to the specified number of peers. +# We use two independent upper values for persistent and non-persistent peers. +# Unconditional peers are not affected by this feature. +# If we are connected to more than the specified number of persistent peers, only send txs to +# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those +# persistent peers disconnects, activate another persistent peer. +# Similarly for non-persistent peers, with an upper limit of +# ExperimentalMaxGossipConnectionsToNonPersistentPeers. +# If set to 0, the feature is disabled for the corresponding group of peers, that is, the +# number of active connections to that group of peers is not bounded. +# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental +# performance results using the default P2P configuration. +experimental_max_gossip_connections_to_persistent_peers = 0 +experimental_max_gossip_connections_to_non_persistent_peers = 0 + +####################################################### +### State Sync Configuration Options ### +####################################################### +[statesync] +# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine +# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in +# the network to take and serve state machine snapshots. State sync is not attempted if the node +# has any local state (LastBlockHeight > 0). The node will have a truncated block history, +# starting from the height of the snapshot. +enable = false + +# RPC servers (comma-separated) for light client verification of the synced state machine and +# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding +# header hash obtained from a trusted source, and a period during which validators can be trusted. +# +# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 +# weeks) during which they can be financially punished (slashed) for misbehavior. +rpc_servers = "" +trust_height = 0 +trust_hash = "" +trust_period = "168h0m0s" + +# Time to spend discovering snapshots before initiating a restore. +discovery_time = "15s" + +# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). +# Will create a new, randomly named directory within, and remove it when done. +temp_dir = "" + +# The timeout duration before re-requesting a chunk, possibly from a different +# peer (default: 1 minute). +chunk_request_timeout = "10s" + +# The number of concurrent chunk fetchers to run (default: 1). +chunk_fetchers = "4" + +####################################################### +### Block Sync Configuration Options ### +####################################################### +[blocksync] + +# Block Sync version to use: +# +# In v0.37, v1 and v2 of the block sync protocols were deprecated. +# Please use v0 instead. +# +# 1) "v0" - the default block sync implementation +version = "v0" + +####################################################### +### Consensus Configuration Options ### +####################################################### +[consensus] + +wal_file = "data/cs.wal/wal" + +# How long we wait for a proposal block before prevoting nil +timeout_propose = "1m0s" +# How much timeout_propose increases with each round +timeout_propose_delta = "5s" +# How long we wait after receiving +2/3 prevotes for β€œanything” (ie. not a single block or nil) +timeout_prevote = "10s" +# How much the timeout_prevote increases with each round +timeout_prevote_delta = "5s" +# How long we wait after receiving +2/3 precommits for β€œanything” (ie. not a single block or nil) +timeout_precommit = "10s" +# How much the timeout_precommit increases with each round +timeout_precommit_delta = "5s" +# How long we wait after committing a block, before starting on the new +# height (this gives us a chance to receive some more precommits, even +# though we already have +2/3). +timeout_commit = "1m0s" + +# How many blocks to look back to check existence of the node's consensus votes before joining consensus +# When non-zero, the node will panic upon restart +# if the same consensus key was used to sign {double_sign_check_height} last blocks. +# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. +double_sign_check_height = 0 + +# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) +skip_timeout_commit = false + +# EmptyBlocks mode and possible interval between empty blocks +create_empty_blocks = true +create_empty_blocks_interval = "0s" + +# Reactor sleep duration parameters +peer_gossip_sleep_duration = "100ms" +peer_query_maj23_sleep_duration = "2s" + +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + +####################################################### +### Transaction Indexer Configuration Options ### +####################################################### +[tx_index] + +# What indexer to use for transactions +# +# The application will set which txs to index. In some cases a node operator will be able +# to decide which txs to index based on configuration set in the application. +# +# Options: +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. +indexer = "kv" + +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + +####################################################### +### Instrumentation Configuration Options ### +####################################################### +[instrumentation] + +# When true, Prometheus metrics are served under /metrics on +# PrometheusListenAddr. +# Check out the documentation for the list of available metrics. +prometheus = true + +# Address to listen for Prometheus collector(s) connections +prometheus_listen_addr = ":26660" + +# Maximum number of simultaneous connections. +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +max_open_connections = 3 + +# Instrumentation namespace +namespace = "cometbft" diff --git a/pkg/appgateserver/cmd/cmd.go b/pkg/appgateserver/cmd/cmd.go index 124d8ceb5..9bcba415d 100644 --- a/pkg/appgateserver/cmd/cmd.go +++ b/pkg/appgateserver/cmd/cmd.go @@ -75,7 +75,8 @@ provided that: cmd.Flags().String(cosmosflags.FlagKeyringBackend, "", "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().StringVar(&flagNodeRPCURL, cosmosflags.FlagNode, omittedDefaultFlagValue, "Register the default Cosmos node flag, which is needed to initialize the Cosmos query context correctly. It can be used to override the `QueryNodeUrl` field in the config file if specified.") cmd.Flags().StringVar(&flagNodeGRPCURL, cosmosflags.FlagGRPC, omittedDefaultFlagValue, "Register the default Cosmos node grpc flag, which is needed to initialize the Cosmos query context with grpc correctly. It can be used to override the `QueryNodeGRPCUrl` field in the config file if specified.") - cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + // cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, false, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") cmd.Flags().StringVar(&flagLogLevel, cosmosflags.FlagLogLevel, "debug", "The logging level (debug|info|warn|error)") return cmd diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index 18cd07d42..aeeed52c2 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -72,7 +72,8 @@ for such operations.`, cmd.Flags().String(cosmosflags.FlagKeyringBackend, "", "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().StringVar(&flagNodeRPCURL, cosmosflags.FlagNode, omittedDefaultFlagValue, "Register the default Cosmos node flag, which is needed to initialize the Cosmos query and tx contexts correctly. It can be used to override the `QueryNodeRPCURL` and `TxNodeRPCURL` fields in the config file if specified.") cmd.Flags().StringVar(&flagNodeGRPCURL, cosmosflags.FlagGRPC, omittedDefaultFlagValue, "Register the default Cosmos node grpc flag, which is needed to initialize the Cosmos query context with grpc correctly. It can be used to override the `QueryNodeGRPCURL` field in the config file if specified.") - cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + // cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, false, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") cmd.Flags().String(cosmosflags.FlagChainID, "poktroll", "The network chain ID") cmd.Flags().StringVar(&flagLogLevel, cosmosflags.FlagLogLevel, "debug", "The logging level (debug|info|warn|error)") diff --git a/relayminer_config.toml b/relayminer_config.toml new file mode 100644 index 000000000..3d8151266 --- /dev/null +++ b/relayminer_config.toml @@ -0,0 +1,23 @@ + +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 diff --git a/~/.poktroll/config/app.toml b/~/.poktroll/config/app.toml new file mode 100644 index 000000000..ad5cb1837 --- /dev/null +++ b/~/.poktroll/config/app.toml @@ -0,0 +1,259 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1,0.0001token2). +minimum-gas-prices = "0.000000001upokt" + +# The maximum gas a query coming over rest/grpc may consume. +# If this is set to zero, the query can consume an unbounded amount of gas. +query-gas-limit = "0" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "nothing" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from CometBFT. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning CometBFT blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: CometBFT block pruning is dependant on this parameter in conjunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs CometBFT what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache (in number of nodes). +iavl-cache-size = 781250 + +# IAVLDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# The fallback is the db_backend value set in CometBFT's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = true + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 86400 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +# MetricsSink defines the type of metrics sink to use. +metrics-sink = "mem" + +# StatsdAddr defines the address of a statsd server to send metrics to. +# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". +statsd-addr = "" + +# DatadogHostname defines the hostname to use when emitting metrics to +# Datadog. Only utilized if MetricsSink is set to "dogstatsd". +datadog-hostname = "" + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = true + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://localhost:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "localhost:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +# NOTE: gRPC-Web uses the same address as the API server. +enable = true + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 0 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### State Streaming ### +############################################################################### + +# Streaming allows nodes to stream state to external systems. +[streaming] + +# streaming.abci specifies the configuration for the ABCI Listener streaming service. +[streaming.abci] + +# List of kv store keys to stream out via gRPC. +# The store key names MUST match the module's StoreKey name. +# +# Example: +# ["acc", "bank", "gov", "staking", "mint"[,...]] +# ["*"] to expose all keys. +keys = [] + +# The plugin name used for streaming via gRPC. +# Streaming is only enabled if this is set. +# Supported plugins: abci +plugin = "" + +# stop-node-on-err specifies whether to stop the node on message delivery error. +stop-node-on-err = true + +############################################################################### +### Mempool ### +############################################################################### + +[mempool] +# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). +# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. +# +# Note, this configuration only applies to SDK built-in app-side mempool +# implementations. +max-txs = 10000 + + ############################################################################### + ### Poktroll ### + ############################################################################### + + # Poktroll-specific app configuration for Full Nodes and Validators. + [poktroll] + + # Telemetry configuration in addition to the [telemetry] settings. + [poktroll.telemetry] + + # Cardinality level for telemetry metrics collection + # This controls the level of detail (number of unique labels) in metrics. + # Options: + # - "low": Collects basic metrics with low cardinality. + # Suitable for production environments with tight performance constraints. + # - "medium": Collects a moderate number of labels, balancing detail and performance. + # Suitable for moderate workloads or staging environments. + # - "high": WARNING: WILL CAUSE STRESS TO YOUR MONITORING ENVIRONMENT! Collects detailed metrics with high + # cardinality, including labels with many unique values (e.g., application_id, session_id). + # Recommended for debugging or testing environments. + cardinality-level = "medium" + \ No newline at end of file diff --git a/~/.poktroll/config/client.toml b/~/.poktroll/config/client.toml new file mode 100644 index 000000000..99d761c8f --- /dev/null +++ b/~/.poktroll/config/client.toml @@ -0,0 +1,17 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "poktroll" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/~/.poktroll/config/config.toml b/~/.poktroll/config/config.toml new file mode 100644 index 000000000..2a83acf8a --- /dev/null +++ b/~/.poktroll/config/config.toml @@ -0,0 +1,498 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or +# relative to the home directory (e.g. "data"). The home directory is +# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable +# or --home cmd flag. + +# The version of the CometBFT binary that created or +# last modified the config file. Do not modify this. +version = "0.38.10" + +####################################################################### +### Main Base Config Options ### +####################################################################### + +# TCP or UNIX socket address of the ABCI application, +# or the name of an ABCI application compiled in with the CometBFT binary +proxy_app = "tcp://127.0.0.1:26658" + +# A custom human readable name for this node +moniker = "olshansky-mbp.local" + +# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb +# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# - pure go +# - stable +# * cleveldb (uses levigo wrapper) +# - fast +# - requires gcc +# - use cleveldb build tag (go build -tags cleveldb) +# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) +# - EXPERIMENTAL +# - may be faster is some use-cases (random reads - indexer) +# - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) +# * badgerdb (uses github.com/dgraph-io/badger) +# - EXPERIMENTAL +# - use badgerdb build tag (go build -tags badgerdb) +db_backend = "goleveldb" + +# Database directory +db_dir = "data" + +# Output level for logging, including package level options +log_level = "info" + +# Output format: 'plain' (colored text) or 'json' +log_format = "plain" + +##### additional base config options ##### + +# Path to the JSON file containing the initial validator set and other meta data +genesis_file = "config/genesis.json" + +# Path to the JSON file containing the private key to use as a validator in the consensus protocol +priv_validator_key_file = "config/priv_validator_key.json" + +# Path to the JSON file containing the last sign state of a validator +priv_validator_state_file = "data/priv_validator_state.json" + +# TCP or UNIX socket address for CometBFT to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" + +# Mechanism to connect to the ABCI application: socket | grpc +abci = "socket" + +# If true, query the ABCI app on connecting to a new peer +# so the app can decide if we should keep the connection or not +filter_peers = false + + +####################################################################### +### Advanced Configuration Options ### +####################################################################### + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://127.0.0.1:26657" + +# A list of origins a cross-domain request can be executed from +# Default value '[]' disables cors support +# Use '["*"]' to allow any origin +cors_allowed_origins = [] + +# A list of methods the client is allowed to use with cross-domain requests +cors_allowed_methods = ["HEAD", "GET", "POST", ] + +# A list of non simple headers the client is allowed to use with cross-domain requests +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] + +# TCP or UNIX socket address for the gRPC server to listen on +# NOTE: This server only supports /broadcast_tx_commit +grpc_laddr = "" + +# Maximum number of simultaneous connections. +# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +grpc_max_open_connections = 900 + +# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool +unsafe = false + +# Maximum number of simultaneous connections (including WebSocket). +# Does not include gRPC connections. See grpc_max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 + +# Maximum number of unique clientIDs that can /subscribe +# If you're using /broadcast_tx_commit, set to the estimated maximum number +# of broadcast_tx_commit calls per block. +max_subscription_clients = 100 + +# Maximum number of unique queries a given client can /subscribe to +# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to +# the estimated # maximum number of broadcast_tx_commit calls per block. +max_subscriptions_per_client = 5 + +# Experimental parameter to specify the maximum number of events a node will +# buffer, per subscription, before returning an error and closing the +# subscription. Must be set to at least 100, but higher values will accommodate +# higher event throughput rates (and will use more memory). +experimental_subscription_buffer_size = 200 + +# Experimental parameter to specify the maximum number of RPC responses that +# can be buffered per WebSocket client. If clients cannot read from the +# WebSocket endpoint fast enough, they will be disconnected, so increasing this +# parameter may reduce the chances of them being disconnected (but will cause +# the node to use more memory). +# +# Must be at least the same as "experimental_subscription_buffer_size", +# otherwise connections could be dropped unnecessarily. This value should +# ideally be somewhat higher than "experimental_subscription_buffer_size" to +# accommodate non-subscription-related RPC responses. +experimental_websocket_write_buffer_size = 200 + +# If a WebSocket client cannot read fast enough, at present we may +# silently drop events instead of generating an error or disconnecting the +# client. +# +# Enabling this experimental parameter will cause the WebSocket connection to +# be closed instead if it cannot read fast enough, allowing for greater +# predictability in subscription behavior. +experimental_close_on_slow_client = false + +# How long to wait for a tx to be committed during /broadcast_tx_commit. +# WARNING: Using a value larger than 10s will result in increasing the +# global HTTP write timeout, which applies to all connections and endpoints. +# See https://github.com/tendermint/tendermint/issues/3435 +timeout_broadcast_tx_commit = "10s" + +# Maximum number of requests that can be sent in a batch +# If the value is set to '0' (zero-value), then no maximum batch size will be +# enforced for a JSON-RPC batch request. +max_request_batch_size = 10 + +# Maximum size of request body, in bytes +max_body_bytes = 1000000 + +# Maximum size of request header, in bytes +max_header_bytes = 1048576 + +# The path to a file containing certificate that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# If the certificate is signed by a certificate authority, +# the certFile should be the concatenation of the server's certificate, any intermediates, +# and the CA's certificate. +# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_cert_file = "" + +# The path to a file containing matching private key that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_key_file = "" + +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = "localhost:6060" + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# Address to advertise to peers for them to dial. If empty, will use the same +# port as the laddr, and will introspect on the listener to figure out the +# address. IP and port are required. Example: 159.89.10.97:26656 +external_address = "" + +# Comma separated list of seed nodes to connect to +seeds = "" + +# Comma separated list of nodes to keep persistent connections to +persistent_peers = "" + +# Path to address book +addr_book_file = "config/addrbook.json" + +# Set true for strict address routability rules +# Set false for private or local networks +addr_book_strict = true + +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 10 + +# List of node IDs, to which a connection will be (re)established ignoring any existing limits +unconditional_peer_ids = "" + +# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) +persistent_peers_max_dial_period = "0s" + +# Time to wait before flushing messages out on the connection +flush_throttle_timeout = "100ms" + +# Maximum size of a message packet payload, in bytes +max_packet_msg_payload_size = 1024 + +# Rate at which packets can be sent, in bytes/second +send_rate = 5120000 + +# Rate at which packets can be received, in bytes/second +recv_rate = 5120000 + +# Set true to enable the peer-exchange reactor +pex = true + +# Seed mode, in which node constantly crawls the network and looks for +# peers. If another node asks it for addresses, it responds and disconnects. +# +# Does not work if the peer-exchange reactor is disabled. +seed_mode = false + +# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) +private_peer_ids = "" + +# Toggle to disable guard against peers connecting from the same ip. +allow_duplicate_ip = false + +# Peer connection configuration. +handshake_timeout = "20s" +dial_timeout = "3s" + +####################################################### +### Mempool Configuration Option ### +####################################################### +[mempool] + +# The type of mempool for this node to use. +# +# Possible types: +# - "flood" : concurrent linked list mempool with flooding gossip protocol +# (default) +# - "nop" : nop-mempool (short for no operation; the ABCI app is responsible +# for storing, disseminating and proposing txs). "create_empty_blocks=false" is +# not supported. +type = "flood" + +# Recheck (default: true) defines whether CometBFT should recheck the +# validity for all remaining transaction in the mempool after a block. +# Since a block affects the application state, some transactions in the +# mempool may become invalid. If this does not apply to your application, +# you can disable rechecking. +recheck = true + +# recheck_timeout is the time the application has during the rechecking process +# to return CheckTx responses, once all requests have been sent. Responses that +# arrive after the timeout expires are discarded. It only applies to +# non-local ABCI clients and when recheck is enabled. +# +# The ideal value will strongly depend on the application. It could roughly be estimated as the +# average size of the mempool multiplied by the average time it takes the application to validate one +# transaction. We consider that the ABCI application runs in the same location as the CometBFT binary +# so that the recheck duration is not affected by network delays when making requests and receiving responses. +recheck_timeout = "1s" + +# Broadcast (default: true) defines whether the mempool should relay +# transactions to other peers. Setting this to false will stop the mempool +# from relaying transactions to other peers until they are included in a +# block. In other words, if Broadcast is disabled, only the peer you send +# the tx to will see it until it is included in a block. +broadcast = true + +# WalPath (default: "") configures the location of the Write Ahead Log +# (WAL) for the mempool. The WAL is disabled by default. To enable, set +# WalPath to where you want the WAL to be written (e.g. +# "data/mempool.wal"). +wal_dir = "" + +# Maximum number of transactions in the mempool +size = 5000 + +# Limit the total size of all txs in the mempool. +# This only accounts for raw transactions (e.g. given 1MB transactions and +# max_txs_bytes=5MB, mempool will only accept 5 transactions). +max_txs_bytes = 1073741824 + +# Size of the cache (used to filter transactions we saw earlier) in transactions +cache_size = 10000 + +# Do not remove invalid transactions from the cache (default: false) +# Set to true if it's not possible for any invalid transaction to become valid +# again in the future. +keep-invalid-txs-in-cache = false + +# Maximum size of a single transaction. +# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. +max_tx_bytes = 1048576 + +# Maximum size of a batch of transactions to send to a peer +# Including space needed by encoding (one varint per transaction). +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 +max_batch_bytes = 0 + +# Experimental parameters to limit gossiping txs to up to the specified number of peers. +# We use two independent upper values for persistent and non-persistent peers. +# Unconditional peers are not affected by this feature. +# If we are connected to more than the specified number of persistent peers, only send txs to +# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those +# persistent peers disconnects, activate another persistent peer. +# Similarly for non-persistent peers, with an upper limit of +# ExperimentalMaxGossipConnectionsToNonPersistentPeers. +# If set to 0, the feature is disabled for the corresponding group of peers, that is, the +# number of active connections to that group of peers is not bounded. +# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental +# performance results using the default P2P configuration. +experimental_max_gossip_connections_to_persistent_peers = 0 +experimental_max_gossip_connections_to_non_persistent_peers = 0 + +####################################################### +### State Sync Configuration Options ### +####################################################### +[statesync] +# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine +# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in +# the network to take and serve state machine snapshots. State sync is not attempted if the node +# has any local state (LastBlockHeight > 0). The node will have a truncated block history, +# starting from the height of the snapshot. +enable = false + +# RPC servers (comma-separated) for light client verification of the synced state machine and +# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding +# header hash obtained from a trusted source, and a period during which validators can be trusted. +# +# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 +# weeks) during which they can be financially punished (slashed) for misbehavior. +rpc_servers = "" +trust_height = 0 +trust_hash = "" +trust_period = "168h0m0s" + +# Time to spend discovering snapshots before initiating a restore. +discovery_time = "15s" + +# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). +# Will create a new, randomly named directory within, and remove it when done. +temp_dir = "" + +# The timeout duration before re-requesting a chunk, possibly from a different +# peer (default: 1 minute). +chunk_request_timeout = "10s" + +# The number of concurrent chunk fetchers to run (default: 1). +chunk_fetchers = "4" + +####################################################### +### Block Sync Configuration Options ### +####################################################### +[blocksync] + +# Block Sync version to use: +# +# In v0.37, v1 and v2 of the block sync protocols were deprecated. +# Please use v0 instead. +# +# 1) "v0" - the default block sync implementation +version = "v0" + +####################################################### +### Consensus Configuration Options ### +####################################################### +[consensus] + +wal_file = "data/cs.wal/wal" + +# How long we wait for a proposal block before prevoting nil +timeout_propose = "1m0s" +# How much timeout_propose increases with each round +timeout_propose_delta = "5s" +# How long we wait after receiving +2/3 prevotes for β€œanything” (ie. not a single block or nil) +timeout_prevote = "10s" +# How much the timeout_prevote increases with each round +timeout_prevote_delta = "5s" +# How long we wait after receiving +2/3 precommits for β€œanything” (ie. not a single block or nil) +timeout_precommit = "10s" +# How much the timeout_precommit increases with each round +timeout_precommit_delta = "5s" +# How long we wait after committing a block, before starting on the new +# height (this gives us a chance to receive some more precommits, even +# though we already have +2/3). +timeout_commit = "1m0s" + +# How many blocks to look back to check existence of the node's consensus votes before joining consensus +# When non-zero, the node will panic upon restart +# if the same consensus key was used to sign {double_sign_check_height} last blocks. +# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. +double_sign_check_height = 0 + +# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) +skip_timeout_commit = false + +# EmptyBlocks mode and possible interval between empty blocks +create_empty_blocks = true +create_empty_blocks_interval = "0s" + +# Reactor sleep duration parameters +peer_gossip_sleep_duration = "100ms" +peer_query_maj23_sleep_duration = "2s" + +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + +####################################################### +### Transaction Indexer Configuration Options ### +####################################################### +[tx_index] + +# What indexer to use for transactions +# +# The application will set which txs to index. In some cases a node operator will be able +# to decide which txs to index based on configuration set in the application. +# +# Options: +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. +indexer = "kv" + +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + +####################################################### +### Instrumentation Configuration Options ### +####################################################### +[instrumentation] + +# When true, Prometheus metrics are served under /metrics on +# PrometheusListenAddr. +# Check out the documentation for the list of available metrics. +prometheus = true + +# Address to listen for Prometheus collector(s) connections +prometheus_listen_addr = ":26660" + +# Maximum number of simultaneous connections. +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +max_open_connections = 3 + +# Instrumentation namespace +namespace = "cometbft" From 2db06ee6275ad6044438b36b0c60a31ecec3e21b Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 12:38:20 -0800 Subject: [PATCH 05/25] Removed configs that sholdn't have been commited --- .gitignore | 5 +- config/app.toml | 259 ------------------ config/client.toml | 17 -- config/config.toml | 498 ----------------------------------- pkg/appgateserver/cmd/cmd.go | 3 +- pkg/relayer/cmd/cmd.go | 3 +- relayminer_config.toml | 23 -- 7 files changed, 6 insertions(+), 802 deletions(-) delete mode 100644 config/app.toml delete mode 100644 config/client.toml delete mode 100644 config/config.toml delete mode 100644 relayminer_config.toml diff --git a/.gitignore b/.gitignore index f444c077b..d9db511f7 100644 --- a/.gitignore +++ b/.gitignore @@ -100,4 +100,7 @@ cmd/poktrolld/*debug_bin* job.yaml # tmp directory for locally produced artifacts -tmp/* \ No newline at end of file +tmp/* + +# Common testing configurations +relayminer_config.toml diff --git a/config/app.toml b/config/app.toml deleted file mode 100644 index ad5cb1837..000000000 --- a/config/app.toml +++ /dev/null @@ -1,259 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Base Configuration ### -############################################################################### - -# The minimum gas prices a validator is willing to accept for processing a -# transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1,0.0001token2). -minimum-gas-prices = "0.000000001upokt" - -# The maximum gas a query coming over rest/grpc may consume. -# If this is set to zero, the query can consume an unbounded amount of gas. -query-gas-limit = "0" - -# default: the last 362880 states are kept, pruning at 10 block intervals -# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) -# everything: 2 latest states will be kept; pruning at 10 block intervals. -# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' -pruning = "nothing" - -# These are applied if and only if the pruning strategy is custom. -pruning-keep-recent = "0" -pruning-interval = "0" - -# HaltHeight contains a non-zero block height at which a node will gracefully -# halt and shutdown that can be used to assist upgrades and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-height = 0 - -# HaltTime contains a non-zero minimum block time (in Unix seconds) at which -# a node will gracefully halt and shutdown that can be used to assist upgrades -# and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-time = 0 - -# MinRetainBlocks defines the minimum block height offset from the current -# block being committed, such that all blocks past this offset are pruned -# from CometBFT. It is used as part of the process of determining the -# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates -# that no blocks should be pruned. -# -# This configuration value is only responsible for pruning CometBFT blocks. -# It has no bearing on application state pruning which is determined by the -# "pruning-*" configurations. -# -# Note: CometBFT block pruning is dependant on this parameter in conjunction -# with the unbonding (safety threshold) period, state pruning and state sync -# snapshot parameters to determine the correct minimum value of -# ResponseCommit.RetainHeight. -min-retain-blocks = 0 - -# InterBlockCache enables inter-block caching. -inter-block-cache = true - -# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs CometBFT what to index. If empty, all events will be indexed. -# -# Example: -# ["message.sender", "message.recipient"] -index-events = [] - -# IavlCacheSize set the size of the iavl tree cache (in number of nodes). -iavl-cache-size = 781250 - -# IAVLDisableFastNode enables or disables the fast node feature of IAVL. -# Default is false. -iavl-disable-fastnode = false - -# AppDBBackend defines the database backend type to use for the application and snapshots DBs. -# An empty string indicates that a fallback will be used. -# The fallback is the db_backend value set in CometBFT's config.toml. -app-db-backend = "" - -############################################################################### -### Telemetry Configuration ### -############################################################################### - -[telemetry] - -# Prefixed with keys to separate services. -service-name = "" - -# Enabled enables the application telemetry functionality. When enabled, -# an in-memory sink is also enabled by default. Operators may also enabled -# other sinks such as Prometheus. -enabled = true - -# Enable prefixing gauge values with hostname. -enable-hostname = false - -# Enable adding hostname to labels. -enable-hostname-label = false - -# Enable adding service to labels. -enable-service-label = false - -# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. -prometheus-retention-time = 86400 - -# GlobalLabels defines a global set of name/value label tuples applied to all -# metrics emitted using the wrapper functions defined in telemetry package. -# -# Example: -# [["chain_id", "cosmoshub-1"]] -global-labels = [ -] - -# MetricsSink defines the type of metrics sink to use. -metrics-sink = "mem" - -# StatsdAddr defines the address of a statsd server to send metrics to. -# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". -statsd-addr = "" - -# DatadogHostname defines the hostname to use when emitting metrics to -# Datadog. Only utilized if MetricsSink is set to "dogstatsd". -datadog-hostname = "" - -############################################################################### -### API Configuration ### -############################################################################### - -[api] - -# Enable defines if the API server should be enabled. -enable = true - -# Swagger defines if swagger documentation should automatically be registered. -swagger = false - -# Address defines the API server to listen on. -address = "tcp://localhost:1317" - -# MaxOpenConnections defines the number of maximum open connections. -max-open-connections = 1000 - -# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). -rpc-read-timeout = 10 - -# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). -rpc-write-timeout = 0 - -# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). -rpc-max-body-bytes = 1000000 - -# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). -enabled-unsafe-cors = false - -############################################################################### -### gRPC Configuration ### -############################################################################### - -[grpc] - -# Enable defines if the gRPC server should be enabled. -enable = true - -# Address defines the gRPC server address to bind to. -address = "localhost:9090" - -# MaxRecvMsgSize defines the max message size in bytes the server can receive. -# The default value is 10MB. -max-recv-msg-size = "10485760" - -# MaxSendMsgSize defines the max message size in bytes the server can send. -# The default value is math.MaxInt32. -max-send-msg-size = "2147483647" - -############################################################################### -### gRPC Web Configuration ### -############################################################################### - -[grpc-web] - -# GRPCWebEnable defines if the gRPC-web should be enabled. -# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. -# NOTE: gRPC-Web uses the same address as the API server. -enable = true - -############################################################################### -### State Sync Configuration ### -############################################################################### - -# State sync snapshots allow other nodes to rapidly join the network without replaying historical -# blocks, instead downloading and applying a snapshot of the application state at a given height. -[state-sync] - -# snapshot-interval specifies the block interval at which local state sync snapshots are -# taken (0 to disable). -snapshot-interval = 0 - -# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). -snapshot-keep-recent = 2 - -############################################################################### -### State Streaming ### -############################################################################### - -# Streaming allows nodes to stream state to external systems. -[streaming] - -# streaming.abci specifies the configuration for the ABCI Listener streaming service. -[streaming.abci] - -# List of kv store keys to stream out via gRPC. -# The store key names MUST match the module's StoreKey name. -# -# Example: -# ["acc", "bank", "gov", "staking", "mint"[,...]] -# ["*"] to expose all keys. -keys = [] - -# The plugin name used for streaming via gRPC. -# Streaming is only enabled if this is set. -# Supported plugins: abci -plugin = "" - -# stop-node-on-err specifies whether to stop the node on message delivery error. -stop-node-on-err = true - -############################################################################### -### Mempool ### -############################################################################### - -[mempool] -# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). -# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. -# -# Note, this configuration only applies to SDK built-in app-side mempool -# implementations. -max-txs = 10000 - - ############################################################################### - ### Poktroll ### - ############################################################################### - - # Poktroll-specific app configuration for Full Nodes and Validators. - [poktroll] - - # Telemetry configuration in addition to the [telemetry] settings. - [poktroll.telemetry] - - # Cardinality level for telemetry metrics collection - # This controls the level of detail (number of unique labels) in metrics. - # Options: - # - "low": Collects basic metrics with low cardinality. - # Suitable for production environments with tight performance constraints. - # - "medium": Collects a moderate number of labels, balancing detail and performance. - # Suitable for moderate workloads or staging environments. - # - "high": WARNING: WILL CAUSE STRESS TO YOUR MONITORING ENVIRONMENT! Collects detailed metrics with high - # cardinality, including labels with many unique values (e.g., application_id, session_id). - # Recommended for debugging or testing environments. - cardinality-level = "medium" - \ No newline at end of file diff --git a/config/client.toml b/config/client.toml deleted file mode 100644 index 99d761c8f..000000000 --- a/config/client.toml +++ /dev/null @@ -1,17 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Client Configuration ### -############################################################################### - -# The network chain ID -chain-id = "poktroll" -# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) -keyring-backend = "os" -# CLI output format (text|json) -output = "text" -# : to CometBFT RPC interface for this chain -node = "tcp://localhost:26657" -# Transaction broadcasting mode (sync|async) -broadcast-mode = "sync" diff --git a/config/config.toml b/config/config.toml deleted file mode 100644 index 2a83acf8a..000000000 --- a/config/config.toml +++ /dev/null @@ -1,498 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or -# relative to the home directory (e.g. "data"). The home directory is -# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable -# or --home cmd flag. - -# The version of the CometBFT binary that created or -# last modified the config file. Do not modify this. -version = "0.38.10" - -####################################################################### -### Main Base Config Options ### -####################################################################### - -# TCP or UNIX socket address of the ABCI application, -# or the name of an ABCI application compiled in with the CometBFT binary -proxy_app = "tcp://127.0.0.1:26658" - -# A custom human readable name for this node -moniker = "olshansky-mbp.local" - -# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) -# - pure go -# - stable -# * cleveldb (uses levigo wrapper) -# - fast -# - requires gcc -# - use cleveldb build tag (go build -tags cleveldb) -# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) -# - EXPERIMENTAL -# - may be faster is some use-cases (random reads - indexer) -# - use boltdb build tag (go build -tags boltdb) -# * rocksdb (uses github.com/tecbot/gorocksdb) -# - EXPERIMENTAL -# - requires gcc -# - use rocksdb build tag (go build -tags rocksdb) -# * badgerdb (uses github.com/dgraph-io/badger) -# - EXPERIMENTAL -# - use badgerdb build tag (go build -tags badgerdb) -db_backend = "goleveldb" - -# Database directory -db_dir = "data" - -# Output level for logging, including package level options -log_level = "info" - -# Output format: 'plain' (colored text) or 'json' -log_format = "plain" - -##### additional base config options ##### - -# Path to the JSON file containing the initial validator set and other meta data -genesis_file = "config/genesis.json" - -# Path to the JSON file containing the private key to use as a validator in the consensus protocol -priv_validator_key_file = "config/priv_validator_key.json" - -# Path to the JSON file containing the last sign state of a validator -priv_validator_state_file = "data/priv_validator_state.json" - -# TCP or UNIX socket address for CometBFT to listen on for -# connections from an external PrivValidator process -priv_validator_laddr = "" - -# Path to the JSON file containing the private key to use for node authentication in the p2p protocol -node_key_file = "config/node_key.json" - -# Mechanism to connect to the ABCI application: socket | grpc -abci = "socket" - -# If true, query the ABCI app on connecting to a new peer -# so the app can decide if we should keep the connection or not -filter_peers = false - - -####################################################################### -### Advanced Configuration Options ### -####################################################################### - -####################################################### -### RPC Server Configuration Options ### -####################################################### -[rpc] - -# TCP or UNIX socket address for the RPC server to listen on -laddr = "tcp://127.0.0.1:26657" - -# A list of origins a cross-domain request can be executed from -# Default value '[]' disables cors support -# Use '["*"]' to allow any origin -cors_allowed_origins = [] - -# A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = ["HEAD", "GET", "POST", ] - -# A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] - -# TCP or UNIX socket address for the gRPC server to listen on -# NOTE: This server only supports /broadcast_tx_commit -grpc_laddr = "" - -# Maximum number of simultaneous connections. -# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -grpc_max_open_connections = 900 - -# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool -unsafe = false - -# Maximum number of simultaneous connections (including WebSocket). -# Does not include gRPC connections. See grpc_max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -max_open_connections = 900 - -# Maximum number of unique clientIDs that can /subscribe -# If you're using /broadcast_tx_commit, set to the estimated maximum number -# of broadcast_tx_commit calls per block. -max_subscription_clients = 100 - -# Maximum number of unique queries a given client can /subscribe to -# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to -# the estimated # maximum number of broadcast_tx_commit calls per block. -max_subscriptions_per_client = 5 - -# Experimental parameter to specify the maximum number of events a node will -# buffer, per subscription, before returning an error and closing the -# subscription. Must be set to at least 100, but higher values will accommodate -# higher event throughput rates (and will use more memory). -experimental_subscription_buffer_size = 200 - -# Experimental parameter to specify the maximum number of RPC responses that -# can be buffered per WebSocket client. If clients cannot read from the -# WebSocket endpoint fast enough, they will be disconnected, so increasing this -# parameter may reduce the chances of them being disconnected (but will cause -# the node to use more memory). -# -# Must be at least the same as "experimental_subscription_buffer_size", -# otherwise connections could be dropped unnecessarily. This value should -# ideally be somewhat higher than "experimental_subscription_buffer_size" to -# accommodate non-subscription-related RPC responses. -experimental_websocket_write_buffer_size = 200 - -# If a WebSocket client cannot read fast enough, at present we may -# silently drop events instead of generating an error or disconnecting the -# client. -# -# Enabling this experimental parameter will cause the WebSocket connection to -# be closed instead if it cannot read fast enough, allowing for greater -# predictability in subscription behavior. -experimental_close_on_slow_client = false - -# How long to wait for a tx to be committed during /broadcast_tx_commit. -# WARNING: Using a value larger than 10s will result in increasing the -# global HTTP write timeout, which applies to all connections and endpoints. -# See https://github.com/tendermint/tendermint/issues/3435 -timeout_broadcast_tx_commit = "10s" - -# Maximum number of requests that can be sent in a batch -# If the value is set to '0' (zero-value), then no maximum batch size will be -# enforced for a JSON-RPC batch request. -max_request_batch_size = 10 - -# Maximum size of request body, in bytes -max_body_bytes = 1000000 - -# Maximum size of request header, in bytes -max_header_bytes = 1048576 - -# The path to a file containing certificate that is used to create the HTTPS server. -# Might be either absolute path or path related to CometBFT's config directory. -# If the certificate is signed by a certificate authority, -# the certFile should be the concatenation of the server's certificate, any intermediates, -# and the CA's certificate. -# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. -# Otherwise, HTTP server is run. -tls_cert_file = "" - -# The path to a file containing matching private key that is used to create the HTTPS server. -# Might be either absolute path or path related to CometBFT's config directory. -# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. -# Otherwise, HTTP server is run. -tls_key_file = "" - -# pprof listen address (https://golang.org/pkg/net/http/pprof) -pprof_laddr = "localhost:6060" - -####################################################### -### P2P Configuration Options ### -####################################################### -[p2p] - -# Address to listen for incoming connections -laddr = "tcp://0.0.0.0:26656" - -# Address to advertise to peers for them to dial. If empty, will use the same -# port as the laddr, and will introspect on the listener to figure out the -# address. IP and port are required. Example: 159.89.10.97:26656 -external_address = "" - -# Comma separated list of seed nodes to connect to -seeds = "" - -# Comma separated list of nodes to keep persistent connections to -persistent_peers = "" - -# Path to address book -addr_book_file = "config/addrbook.json" - -# Set true for strict address routability rules -# Set false for private or local networks -addr_book_strict = true - -# Maximum number of inbound peers -max_num_inbound_peers = 40 - -# Maximum number of outbound peers to connect to, excluding persistent peers -max_num_outbound_peers = 10 - -# List of node IDs, to which a connection will be (re)established ignoring any existing limits -unconditional_peer_ids = "" - -# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) -persistent_peers_max_dial_period = "0s" - -# Time to wait before flushing messages out on the connection -flush_throttle_timeout = "100ms" - -# Maximum size of a message packet payload, in bytes -max_packet_msg_payload_size = 1024 - -# Rate at which packets can be sent, in bytes/second -send_rate = 5120000 - -# Rate at which packets can be received, in bytes/second -recv_rate = 5120000 - -# Set true to enable the peer-exchange reactor -pex = true - -# Seed mode, in which node constantly crawls the network and looks for -# peers. If another node asks it for addresses, it responds and disconnects. -# -# Does not work if the peer-exchange reactor is disabled. -seed_mode = false - -# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) -private_peer_ids = "" - -# Toggle to disable guard against peers connecting from the same ip. -allow_duplicate_ip = false - -# Peer connection configuration. -handshake_timeout = "20s" -dial_timeout = "3s" - -####################################################### -### Mempool Configuration Option ### -####################################################### -[mempool] - -# The type of mempool for this node to use. -# -# Possible types: -# - "flood" : concurrent linked list mempool with flooding gossip protocol -# (default) -# - "nop" : nop-mempool (short for no operation; the ABCI app is responsible -# for storing, disseminating and proposing txs). "create_empty_blocks=false" is -# not supported. -type = "flood" - -# Recheck (default: true) defines whether CometBFT should recheck the -# validity for all remaining transaction in the mempool after a block. -# Since a block affects the application state, some transactions in the -# mempool may become invalid. If this does not apply to your application, -# you can disable rechecking. -recheck = true - -# recheck_timeout is the time the application has during the rechecking process -# to return CheckTx responses, once all requests have been sent. Responses that -# arrive after the timeout expires are discarded. It only applies to -# non-local ABCI clients and when recheck is enabled. -# -# The ideal value will strongly depend on the application. It could roughly be estimated as the -# average size of the mempool multiplied by the average time it takes the application to validate one -# transaction. We consider that the ABCI application runs in the same location as the CometBFT binary -# so that the recheck duration is not affected by network delays when making requests and receiving responses. -recheck_timeout = "1s" - -# Broadcast (default: true) defines whether the mempool should relay -# transactions to other peers. Setting this to false will stop the mempool -# from relaying transactions to other peers until they are included in a -# block. In other words, if Broadcast is disabled, only the peer you send -# the tx to will see it until it is included in a block. -broadcast = true - -# WalPath (default: "") configures the location of the Write Ahead Log -# (WAL) for the mempool. The WAL is disabled by default. To enable, set -# WalPath to where you want the WAL to be written (e.g. -# "data/mempool.wal"). -wal_dir = "" - -# Maximum number of transactions in the mempool -size = 5000 - -# Limit the total size of all txs in the mempool. -# This only accounts for raw transactions (e.g. given 1MB transactions and -# max_txs_bytes=5MB, mempool will only accept 5 transactions). -max_txs_bytes = 1073741824 - -# Size of the cache (used to filter transactions we saw earlier) in transactions -cache_size = 10000 - -# Do not remove invalid transactions from the cache (default: false) -# Set to true if it's not possible for any invalid transaction to become valid -# again in the future. -keep-invalid-txs-in-cache = false - -# Maximum size of a single transaction. -# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. -max_tx_bytes = 1048576 - -# Maximum size of a batch of transactions to send to a peer -# Including space needed by encoding (one varint per transaction). -# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 -max_batch_bytes = 0 - -# Experimental parameters to limit gossiping txs to up to the specified number of peers. -# We use two independent upper values for persistent and non-persistent peers. -# Unconditional peers are not affected by this feature. -# If we are connected to more than the specified number of persistent peers, only send txs to -# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those -# persistent peers disconnects, activate another persistent peer. -# Similarly for non-persistent peers, with an upper limit of -# ExperimentalMaxGossipConnectionsToNonPersistentPeers. -# If set to 0, the feature is disabled for the corresponding group of peers, that is, the -# number of active connections to that group of peers is not bounded. -# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental -# performance results using the default P2P configuration. -experimental_max_gossip_connections_to_persistent_peers = 0 -experimental_max_gossip_connections_to_non_persistent_peers = 0 - -####################################################### -### State Sync Configuration Options ### -####################################################### -[statesync] -# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine -# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in -# the network to take and serve state machine snapshots. State sync is not attempted if the node -# has any local state (LastBlockHeight > 0). The node will have a truncated block history, -# starting from the height of the snapshot. -enable = false - -# RPC servers (comma-separated) for light client verification of the synced state machine and -# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding -# header hash obtained from a trusted source, and a period during which validators can be trusted. -# -# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 -# weeks) during which they can be financially punished (slashed) for misbehavior. -rpc_servers = "" -trust_height = 0 -trust_hash = "" -trust_period = "168h0m0s" - -# Time to spend discovering snapshots before initiating a restore. -discovery_time = "15s" - -# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). -# Will create a new, randomly named directory within, and remove it when done. -temp_dir = "" - -# The timeout duration before re-requesting a chunk, possibly from a different -# peer (default: 1 minute). -chunk_request_timeout = "10s" - -# The number of concurrent chunk fetchers to run (default: 1). -chunk_fetchers = "4" - -####################################################### -### Block Sync Configuration Options ### -####################################################### -[blocksync] - -# Block Sync version to use: -# -# In v0.37, v1 and v2 of the block sync protocols were deprecated. -# Please use v0 instead. -# -# 1) "v0" - the default block sync implementation -version = "v0" - -####################################################### -### Consensus Configuration Options ### -####################################################### -[consensus] - -wal_file = "data/cs.wal/wal" - -# How long we wait for a proposal block before prevoting nil -timeout_propose = "1m0s" -# How much timeout_propose increases with each round -timeout_propose_delta = "5s" -# How long we wait after receiving +2/3 prevotes for β€œanything” (ie. not a single block or nil) -timeout_prevote = "10s" -# How much the timeout_prevote increases with each round -timeout_prevote_delta = "5s" -# How long we wait after receiving +2/3 precommits for β€œanything” (ie. not a single block or nil) -timeout_precommit = "10s" -# How much the timeout_precommit increases with each round -timeout_precommit_delta = "5s" -# How long we wait after committing a block, before starting on the new -# height (this gives us a chance to receive some more precommits, even -# though we already have +2/3). -timeout_commit = "1m0s" - -# How many blocks to look back to check existence of the node's consensus votes before joining consensus -# When non-zero, the node will panic upon restart -# if the same consensus key was used to sign {double_sign_check_height} last blocks. -# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. -double_sign_check_height = 0 - -# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) -skip_timeout_commit = false - -# EmptyBlocks mode and possible interval between empty blocks -create_empty_blocks = true -create_empty_blocks_interval = "0s" - -# Reactor sleep duration parameters -peer_gossip_sleep_duration = "100ms" -peer_query_maj23_sleep_duration = "2s" - -####################################################### -### Storage Configuration Options ### -####################################################### -[storage] - -# Set to true to discard ABCI responses from the state store, which can save a -# considerable amount of disk space. Set to false to ensure ABCI responses are -# persisted. ABCI responses are required for /block_results RPC queries, and to -# reindex events in the command-line tool. -discard_abci_responses = false - -####################################################### -### Transaction Indexer Configuration Options ### -####################################################### -[tx_index] - -# What indexer to use for transactions -# -# The application will set which txs to index. In some cases a node operator will be able -# to decide which txs to index based on configuration set in the application. -# -# Options: -# 1) "null" -# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). -# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. -# 3) "psql" - the indexer services backed by PostgreSQL. -# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. -indexer = "kv" - -# The PostgreSQL connection configuration, the connection format: -# postgresql://:@:/? -psql-conn = "" - -####################################################### -### Instrumentation Configuration Options ### -####################################################### -[instrumentation] - -# When true, Prometheus metrics are served under /metrics on -# PrometheusListenAddr. -# Check out the documentation for the list of available metrics. -prometheus = true - -# Address to listen for Prometheus collector(s) connections -prometheus_listen_addr = ":26660" - -# Maximum number of simultaneous connections. -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -max_open_connections = 3 - -# Instrumentation namespace -namespace = "cometbft" diff --git a/pkg/appgateserver/cmd/cmd.go b/pkg/appgateserver/cmd/cmd.go index 9bcba415d..124d8ceb5 100644 --- a/pkg/appgateserver/cmd/cmd.go +++ b/pkg/appgateserver/cmd/cmd.go @@ -75,8 +75,7 @@ provided that: cmd.Flags().String(cosmosflags.FlagKeyringBackend, "", "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().StringVar(&flagNodeRPCURL, cosmosflags.FlagNode, omittedDefaultFlagValue, "Register the default Cosmos node flag, which is needed to initialize the Cosmos query context correctly. It can be used to override the `QueryNodeUrl` field in the config file if specified.") cmd.Flags().StringVar(&flagNodeGRPCURL, cosmosflags.FlagGRPC, omittedDefaultFlagValue, "Register the default Cosmos node grpc flag, which is needed to initialize the Cosmos query context with grpc correctly. It can be used to override the `QueryNodeGRPCUrl` field in the config file if specified.") - // cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") - cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, false, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") cmd.Flags().StringVar(&flagLogLevel, cosmosflags.FlagLogLevel, "debug", "The logging level (debug|info|warn|error)") return cmd diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index aeeed52c2..18cd07d42 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -72,8 +72,7 @@ for such operations.`, cmd.Flags().String(cosmosflags.FlagKeyringBackend, "", "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().StringVar(&flagNodeRPCURL, cosmosflags.FlagNode, omittedDefaultFlagValue, "Register the default Cosmos node flag, which is needed to initialize the Cosmos query and tx contexts correctly. It can be used to override the `QueryNodeRPCURL` and `TxNodeRPCURL` fields in the config file if specified.") cmd.Flags().StringVar(&flagNodeGRPCURL, cosmosflags.FlagGRPC, omittedDefaultFlagValue, "Register the default Cosmos node grpc flag, which is needed to initialize the Cosmos query context with grpc correctly. It can be used to override the `QueryNodeGRPCURL` field in the config file if specified.") - // cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") - cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, false, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") + cmd.Flags().Bool(cosmosflags.FlagGRPCInsecure, true, "Used to initialize the Cosmos query context with grpc security options. It can be used to override the `QueryNodeGRPCInsecure` field in the config file if specified.") cmd.Flags().String(cosmosflags.FlagChainID, "poktroll", "The network chain ID") cmd.Flags().StringVar(&flagLogLevel, cosmosflags.FlagLogLevel, "debug", "The logging level (debug|info|warn|error)") diff --git a/relayminer_config.toml b/relayminer_config.toml deleted file mode 100644 index 3d8151266..000000000 --- a/relayminer_config.toml +++ /dev/null @@ -1,23 +0,0 @@ - -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 From 9ce8b2f148d4740a6e5c906fb91030e5b0c8511a Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:34:59 -0800 Subject: [PATCH 06/25] Finishing the service cheatsheet --- .../docker_compose_debian_cheatsheet.md | 14 ++- .../operate/quickstart/service_cheatsheet.md | 90 ++++++++++++++++++- .../operate/quickstart/supplier_cheatsheet.md | 34 +++++-- .../operate/user_guide/create-new-wallet.md | 20 ++++- docusaurus/docs/operate/user_guide/install.md | 23 +++-- 5 files changed, 159 insertions(+), 22 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index d7f6619ad..2907f57c7 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -10,7 +10,7 @@ import ReactPlayer from "react-player"; - [Results](#results) - [Deploy your server](#deploy-your-server) - [Install Dependencies](#install-dependencies) - - [Create a new user](#create-a-new-user) + - [\[Optional\] Create a new user](#optional-create-a-new-user) - [Retrieve the source code](#retrieve-the-source-code) - [Update your environment](#update-your-environment) - [Start up the full node](#start-up-the-full-node) @@ -86,16 +86,22 @@ And then install docker: sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -### Create a new user +### [Optional] Create a new user + +:::note Make sure to replace `olshansky` with your username. +::: + ```bash # Create a new user and give sudo permissions export USERNAME=olshansky -sudo adduser olshansky -sudo usermod -aG sudo olshansky +sudo adduser $USERNAME +sudo usermod -aG sudo $USERNAME +``` +``` # Optionally avoid needing to provide a password sudo /etc/sudoers diff --git a/docusaurus/docs/operate/quickstart/service_cheatsheet.md b/docusaurus/docs/operate/quickstart/service_cheatsheet.md index e7a99290c..b195ef5a5 100644 --- a/docusaurus/docs/operate/quickstart/service_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/service_cheatsheet.md @@ -5,4 +5,92 @@ title: Service Cheat Sheet ## Service Cheat Sheet -TODO_BETA(@olshansk): Document how to add a service onchain. +- [Pre-Requisites](#pre-requisites) +- [How do I query for all existing onchain Services?](#how-do-i-query-for-all-existing-onchain-services) +- [How do I create a new service?](#how-do-i-create-a-new-service) +- [How do I learn more about interacting with Services?](#how-do-i-learn-more-about-interacting-with-services) + - [Service Transactions](#service-transactions) + - [Service Queries](#service-queries) + +### 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). + +### How do I query for all existing onchain Services? + +Then, you can query for all services like so: + +```bash +poktrolld query service all-services --node https://shannon-testnet-grove-rpc.beta.poktroll.com --output json | jq +``` + +Here is an example of the output on Beta TestNet as of writing this document: + +```json +{ + "service": [ + { + "id": "svc_8ymf38", + "name": "name for svc_8ymf38", + "compute_units_per_relay": "7", + "owner_address": "pokt1aqsr8ejvwwnjwx3ppp234l586kl06cvas7ag6w" + }, + { + "id": "svc_drce83", + "name": "name for svc_drce83", + "compute_units_per_relay": "7", + "owner_address": "pokt1mgtf9k4k3pze57gwp3qsne88jmvqkc37t7vd9g" + }, + { + "id": "svc_jk07qh", + "name": "name for svc_jk07qh", + "compute_units_per_relay": "7", + "owner_address": "pokt1mwynfsnzesc38f98zrk08pttjn48tu7crc2p09" + } + ], + "pagination": { + "total": "3" + } +} +``` + +### How do I create a new service? + +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} +``` + +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 Services? + +#### Service Transactions + +```bash +poktrolld tx service -h +``` + +#### Service Queries + +```bash +poktrolld query service -h +``` diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 278b9f467..efa8e0282 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -5,21 +5,41 @@ title: Supplier (RelayMiner) Cheat Sheet ## Supplier Cheat Sheet -You can follow the simple copy-pasta guide below to quickly deploy a RelayMiner -and become a Supplier on the Pocket Network. - -- [0. Deploy your Server \& Install Dependencies](#0-deploy-your-server--install-dependencies) +- [Context](#context) +- [Pre-Requisites](#pre-requisites) +- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) - [1. Retrieve the source code](#1-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. + :::tip -See the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md) for an in-depth guide on setting up a Supplier. +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) ::: -TODO_BETA(@olshansk): Finish this page. +### Pre-Requisites + +You will need the following: + +1. A funded onchain wallet/account/address +2. A known service + +- How do I stake a service? +- How do I view existing services? +- How do I -### 0. Deploy your Server & Install Dependencies +### 1. Deploy your Server & Install Dependencies You can deploy a RelayMiner on any server. diff --git a/docusaurus/docs/operate/user_guide/create-new-wallet.md b/docusaurus/docs/operate/user_guide/create-new-wallet.md index 6a2af0e61..16cb58778 100644 --- a/docusaurus/docs/operate/user_guide/create-new-wallet.md +++ b/docusaurus/docs/operate/user_guide/create-new-wallet.md @@ -5,11 +5,15 @@ sidebar_position: 1 # Create a New Wallet -:::warning Security Notice +:::warning -**ALWAYS back up your key and/or mnemonic**. Store it in a secure -location accessible only to you, such as a password manager, or written down -in a safe place. Under your πŸ›οΈ does not count! +tl;dr IFF you know what you're doing. + +```bash +poktrolld keys add $USER +``` + +Retrieve the `address` and go to the [Beta TestNet Faucet](https://faucet.beta.testnet.pokt.network/) to fund your account. ::: @@ -20,6 +24,14 @@ This guide will walk you through creating a new wallet on the Pocket Network. - [Step 2: Creating the Wallet](#step-2-creating-the-wallet) - [Step 3: Backing Up Your Wallet](#step-3-backing-up-your-wallet) +:::warning Security Notice + +**ALWAYS back up your key and/or mnemonic**. Store it in a secure +location accessible only to you, such as a password manager, or written down +in a safe place. Under your πŸ›οΈ does not count! + +::: + ## What is a keyring backend? Before proceeding, it's critical to understand the implications of keyring backends diff --git a/docusaurus/docs/operate/user_guide/install.md b/docusaurus/docs/operate/user_guide/install.md index b19473f01..4c20f0824 100644 --- a/docusaurus/docs/operate/user_guide/install.md +++ b/docusaurus/docs/operate/user_guide/install.md @@ -3,6 +3,17 @@ title: CLI Installation sidebar_position: 0 --- +:::warning + +tl;dr IFF you know what you're doing. + +```bash +brew tap pokt-network/poktroll +brew install poktrolld +``` + +::: + - [MacOS \& Linux Users](#macos--linux-users) - [Using Homebrew](#using-homebrew) - [From Source](#from-source) @@ -13,12 +24,6 @@ sidebar_position: 0 ### Using Homebrew -:::tip -See the [homebrew-poktroll](https://github.com/pokt-network/homebrew-poktroll/) -repository for details on how to install homebrew or other details to install -or debug the CLI. -::: - Ensure you have [Homebrew](https://brew.sh/) installed. Then run the following commands: @@ -35,6 +40,12 @@ poktrolld version poktrolld --help ``` +:::tip +See the [homebrew-poktroll](https://github.com/pokt-network/homebrew-poktroll/) +repository for details on how to install homebrew or other details to install +or debug the CLI. +::: + ### From Source Ensure you have the following installed: From 9fa746137426c9817656f308d7028d7846ec49fa Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:44:29 -0800 Subject: [PATCH 07/25] self review --- .gitignore | 4 +- .../docker_compose_debian_cheatsheet.md | 22 +- .../quickstart/docker_compose_walkthrough.md | 39 +- ~/.poktroll/config/app.toml | 259 --------- ~/.poktroll/config/client.toml | 17 - ~/.poktroll/config/config.toml | 498 ------------------ 6 files changed, 46 insertions(+), 793 deletions(-) delete mode 100644 ~/.poktroll/config/app.toml delete mode 100644 ~/.poktroll/config/client.toml delete mode 100644 ~/.poktroll/config/config.toml diff --git a/.gitignore b/.gitignore index d9db511f7..862f41be0 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,6 @@ job.yaml tmp/* # Common testing configurations -relayminer_config.toml +relayminer_config.yaml +gateway_config.yaml +path_config.yaml diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index 2907f57c7..17d3127e3 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -88,30 +88,14 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin ### [Optional] Create a new user -:::note - -Make sure to replace `olshansky` with your username. - -::: +You can optionally create a new user and give it sudo permissions instead of using `root`. ```bash -# Create a new user and give sudo permissions export USERNAME=olshansky sudo adduser $USERNAME sudo usermod -aG sudo $USERNAME ``` -``` -# Optionally avoid needing to provide a password -sudo /etc/sudoers - -# Add the following line to the end of the file -olshansky ALL=(ALL) NOPASSWD:ALL - -# Switch to the new user -su - olshansky -``` - ## Retrieve the source code Then pull the github repo @@ -349,3 +333,7 @@ docker logs -f --tail 100 appgate ``` ### Re-stake the gateway + +``` + +``` diff --git a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md index ca58321bc..5652beb6c 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md @@ -11,6 +11,7 @@ import ReactPlayer from "react-player"; - [Key Terms in Morse and Shannon](#key-terms-in-morse-and-shannon) - [Understanding Actors in the Shannon upgrade](#understanding-actors-in-the-shannon-upgrade) - [Prerequisites](#prerequisites) + - [\[Optional\] Create a new user](#optional-create-a-new-user) - [A. Deploying a Full Node](#a-deploying-a-full-node) - [B. Creating a Supplier and Deploying a RelayMiner](#b-creating-a-supplier-and-deploying-a-relayminer) - [C. Creating an Application and Deploying an AppGate Server](#c-creating-an-application-and-deploying-an-appgate-server) @@ -115,7 +116,7 @@ flowchart TB _Note: the system must be capable of exposing ports to the internet for peer-to-peer communication._ -### 0. Software & Tooling +### Software & Tooling Ensure the following software is installed on your system: @@ -152,6 +153,42 @@ 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 + +:::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 /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 diff --git a/~/.poktroll/config/app.toml b/~/.poktroll/config/app.toml deleted file mode 100644 index ad5cb1837..000000000 --- a/~/.poktroll/config/app.toml +++ /dev/null @@ -1,259 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Base Configuration ### -############################################################################### - -# The minimum gas prices a validator is willing to accept for processing a -# transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1,0.0001token2). -minimum-gas-prices = "0.000000001upokt" - -# The maximum gas a query coming over rest/grpc may consume. -# If this is set to zero, the query can consume an unbounded amount of gas. -query-gas-limit = "0" - -# default: the last 362880 states are kept, pruning at 10 block intervals -# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) -# everything: 2 latest states will be kept; pruning at 10 block intervals. -# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' -pruning = "nothing" - -# These are applied if and only if the pruning strategy is custom. -pruning-keep-recent = "0" -pruning-interval = "0" - -# HaltHeight contains a non-zero block height at which a node will gracefully -# halt and shutdown that can be used to assist upgrades and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-height = 0 - -# HaltTime contains a non-zero minimum block time (in Unix seconds) at which -# a node will gracefully halt and shutdown that can be used to assist upgrades -# and testing. -# -# Note: Commitment of state will be attempted on the corresponding block. -halt-time = 0 - -# MinRetainBlocks defines the minimum block height offset from the current -# block being committed, such that all blocks past this offset are pruned -# from CometBFT. It is used as part of the process of determining the -# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates -# that no blocks should be pruned. -# -# This configuration value is only responsible for pruning CometBFT blocks. -# It has no bearing on application state pruning which is determined by the -# "pruning-*" configurations. -# -# Note: CometBFT block pruning is dependant on this parameter in conjunction -# with the unbonding (safety threshold) period, state pruning and state sync -# snapshot parameters to determine the correct minimum value of -# ResponseCommit.RetainHeight. -min-retain-blocks = 0 - -# InterBlockCache enables inter-block caching. -inter-block-cache = true - -# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs CometBFT what to index. If empty, all events will be indexed. -# -# Example: -# ["message.sender", "message.recipient"] -index-events = [] - -# IavlCacheSize set the size of the iavl tree cache (in number of nodes). -iavl-cache-size = 781250 - -# IAVLDisableFastNode enables or disables the fast node feature of IAVL. -# Default is false. -iavl-disable-fastnode = false - -# AppDBBackend defines the database backend type to use for the application and snapshots DBs. -# An empty string indicates that a fallback will be used. -# The fallback is the db_backend value set in CometBFT's config.toml. -app-db-backend = "" - -############################################################################### -### Telemetry Configuration ### -############################################################################### - -[telemetry] - -# Prefixed with keys to separate services. -service-name = "" - -# Enabled enables the application telemetry functionality. When enabled, -# an in-memory sink is also enabled by default. Operators may also enabled -# other sinks such as Prometheus. -enabled = true - -# Enable prefixing gauge values with hostname. -enable-hostname = false - -# Enable adding hostname to labels. -enable-hostname-label = false - -# Enable adding service to labels. -enable-service-label = false - -# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. -prometheus-retention-time = 86400 - -# GlobalLabels defines a global set of name/value label tuples applied to all -# metrics emitted using the wrapper functions defined in telemetry package. -# -# Example: -# [["chain_id", "cosmoshub-1"]] -global-labels = [ -] - -# MetricsSink defines the type of metrics sink to use. -metrics-sink = "mem" - -# StatsdAddr defines the address of a statsd server to send metrics to. -# Only utilized if MetricsSink is set to "statsd" or "dogstatsd". -statsd-addr = "" - -# DatadogHostname defines the hostname to use when emitting metrics to -# Datadog. Only utilized if MetricsSink is set to "dogstatsd". -datadog-hostname = "" - -############################################################################### -### API Configuration ### -############################################################################### - -[api] - -# Enable defines if the API server should be enabled. -enable = true - -# Swagger defines if swagger documentation should automatically be registered. -swagger = false - -# Address defines the API server to listen on. -address = "tcp://localhost:1317" - -# MaxOpenConnections defines the number of maximum open connections. -max-open-connections = 1000 - -# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). -rpc-read-timeout = 10 - -# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). -rpc-write-timeout = 0 - -# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). -rpc-max-body-bytes = 1000000 - -# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). -enabled-unsafe-cors = false - -############################################################################### -### gRPC Configuration ### -############################################################################### - -[grpc] - -# Enable defines if the gRPC server should be enabled. -enable = true - -# Address defines the gRPC server address to bind to. -address = "localhost:9090" - -# MaxRecvMsgSize defines the max message size in bytes the server can receive. -# The default value is 10MB. -max-recv-msg-size = "10485760" - -# MaxSendMsgSize defines the max message size in bytes the server can send. -# The default value is math.MaxInt32. -max-send-msg-size = "2147483647" - -############################################################################### -### gRPC Web Configuration ### -############################################################################### - -[grpc-web] - -# GRPCWebEnable defines if the gRPC-web should be enabled. -# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. -# NOTE: gRPC-Web uses the same address as the API server. -enable = true - -############################################################################### -### State Sync Configuration ### -############################################################################### - -# State sync snapshots allow other nodes to rapidly join the network without replaying historical -# blocks, instead downloading and applying a snapshot of the application state at a given height. -[state-sync] - -# snapshot-interval specifies the block interval at which local state sync snapshots are -# taken (0 to disable). -snapshot-interval = 0 - -# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). -snapshot-keep-recent = 2 - -############################################################################### -### State Streaming ### -############################################################################### - -# Streaming allows nodes to stream state to external systems. -[streaming] - -# streaming.abci specifies the configuration for the ABCI Listener streaming service. -[streaming.abci] - -# List of kv store keys to stream out via gRPC. -# The store key names MUST match the module's StoreKey name. -# -# Example: -# ["acc", "bank", "gov", "staking", "mint"[,...]] -# ["*"] to expose all keys. -keys = [] - -# The plugin name used for streaming via gRPC. -# Streaming is only enabled if this is set. -# Supported plugins: abci -plugin = "" - -# stop-node-on-err specifies whether to stop the node on message delivery error. -stop-node-on-err = true - -############################################################################### -### Mempool ### -############################################################################### - -[mempool] -# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). -# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. -# -# Note, this configuration only applies to SDK built-in app-side mempool -# implementations. -max-txs = 10000 - - ############################################################################### - ### Poktroll ### - ############################################################################### - - # Poktroll-specific app configuration for Full Nodes and Validators. - [poktroll] - - # Telemetry configuration in addition to the [telemetry] settings. - [poktroll.telemetry] - - # Cardinality level for telemetry metrics collection - # This controls the level of detail (number of unique labels) in metrics. - # Options: - # - "low": Collects basic metrics with low cardinality. - # Suitable for production environments with tight performance constraints. - # - "medium": Collects a moderate number of labels, balancing detail and performance. - # Suitable for moderate workloads or staging environments. - # - "high": WARNING: WILL CAUSE STRESS TO YOUR MONITORING ENVIRONMENT! Collects detailed metrics with high - # cardinality, including labels with many unique values (e.g., application_id, session_id). - # Recommended for debugging or testing environments. - cardinality-level = "medium" - \ No newline at end of file diff --git a/~/.poktroll/config/client.toml b/~/.poktroll/config/client.toml deleted file mode 100644 index 99d761c8f..000000000 --- a/~/.poktroll/config/client.toml +++ /dev/null @@ -1,17 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Client Configuration ### -############################################################################### - -# The network chain ID -chain-id = "poktroll" -# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) -keyring-backend = "os" -# CLI output format (text|json) -output = "text" -# : to CometBFT RPC interface for this chain -node = "tcp://localhost:26657" -# Transaction broadcasting mode (sync|async) -broadcast-mode = "sync" diff --git a/~/.poktroll/config/config.toml b/~/.poktroll/config/config.toml deleted file mode 100644 index 2a83acf8a..000000000 --- a/~/.poktroll/config/config.toml +++ /dev/null @@ -1,498 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or -# relative to the home directory (e.g. "data"). The home directory is -# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable -# or --home cmd flag. - -# The version of the CometBFT binary that created or -# last modified the config file. Do not modify this. -version = "0.38.10" - -####################################################################### -### Main Base Config Options ### -####################################################################### - -# TCP or UNIX socket address of the ABCI application, -# or the name of an ABCI application compiled in with the CometBFT binary -proxy_app = "tcp://127.0.0.1:26658" - -# A custom human readable name for this node -moniker = "olshansky-mbp.local" - -# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) -# - pure go -# - stable -# * cleveldb (uses levigo wrapper) -# - fast -# - requires gcc -# - use cleveldb build tag (go build -tags cleveldb) -# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) -# - EXPERIMENTAL -# - may be faster is some use-cases (random reads - indexer) -# - use boltdb build tag (go build -tags boltdb) -# * rocksdb (uses github.com/tecbot/gorocksdb) -# - EXPERIMENTAL -# - requires gcc -# - use rocksdb build tag (go build -tags rocksdb) -# * badgerdb (uses github.com/dgraph-io/badger) -# - EXPERIMENTAL -# - use badgerdb build tag (go build -tags badgerdb) -db_backend = "goleveldb" - -# Database directory -db_dir = "data" - -# Output level for logging, including package level options -log_level = "info" - -# Output format: 'plain' (colored text) or 'json' -log_format = "plain" - -##### additional base config options ##### - -# Path to the JSON file containing the initial validator set and other meta data -genesis_file = "config/genesis.json" - -# Path to the JSON file containing the private key to use as a validator in the consensus protocol -priv_validator_key_file = "config/priv_validator_key.json" - -# Path to the JSON file containing the last sign state of a validator -priv_validator_state_file = "data/priv_validator_state.json" - -# TCP or UNIX socket address for CometBFT to listen on for -# connections from an external PrivValidator process -priv_validator_laddr = "" - -# Path to the JSON file containing the private key to use for node authentication in the p2p protocol -node_key_file = "config/node_key.json" - -# Mechanism to connect to the ABCI application: socket | grpc -abci = "socket" - -# If true, query the ABCI app on connecting to a new peer -# so the app can decide if we should keep the connection or not -filter_peers = false - - -####################################################################### -### Advanced Configuration Options ### -####################################################################### - -####################################################### -### RPC Server Configuration Options ### -####################################################### -[rpc] - -# TCP or UNIX socket address for the RPC server to listen on -laddr = "tcp://127.0.0.1:26657" - -# A list of origins a cross-domain request can be executed from -# Default value '[]' disables cors support -# Use '["*"]' to allow any origin -cors_allowed_origins = [] - -# A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = ["HEAD", "GET", "POST", ] - -# A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] - -# TCP or UNIX socket address for the gRPC server to listen on -# NOTE: This server only supports /broadcast_tx_commit -grpc_laddr = "" - -# Maximum number of simultaneous connections. -# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -grpc_max_open_connections = 900 - -# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool -unsafe = false - -# Maximum number of simultaneous connections (including WebSocket). -# Does not include gRPC connections. See grpc_max_open_connections -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} -# 1024 - 40 - 10 - 50 = 924 = ~900 -max_open_connections = 900 - -# Maximum number of unique clientIDs that can /subscribe -# If you're using /broadcast_tx_commit, set to the estimated maximum number -# of broadcast_tx_commit calls per block. -max_subscription_clients = 100 - -# Maximum number of unique queries a given client can /subscribe to -# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to -# the estimated # maximum number of broadcast_tx_commit calls per block. -max_subscriptions_per_client = 5 - -# Experimental parameter to specify the maximum number of events a node will -# buffer, per subscription, before returning an error and closing the -# subscription. Must be set to at least 100, but higher values will accommodate -# higher event throughput rates (and will use more memory). -experimental_subscription_buffer_size = 200 - -# Experimental parameter to specify the maximum number of RPC responses that -# can be buffered per WebSocket client. If clients cannot read from the -# WebSocket endpoint fast enough, they will be disconnected, so increasing this -# parameter may reduce the chances of them being disconnected (but will cause -# the node to use more memory). -# -# Must be at least the same as "experimental_subscription_buffer_size", -# otherwise connections could be dropped unnecessarily. This value should -# ideally be somewhat higher than "experimental_subscription_buffer_size" to -# accommodate non-subscription-related RPC responses. -experimental_websocket_write_buffer_size = 200 - -# If a WebSocket client cannot read fast enough, at present we may -# silently drop events instead of generating an error or disconnecting the -# client. -# -# Enabling this experimental parameter will cause the WebSocket connection to -# be closed instead if it cannot read fast enough, allowing for greater -# predictability in subscription behavior. -experimental_close_on_slow_client = false - -# How long to wait for a tx to be committed during /broadcast_tx_commit. -# WARNING: Using a value larger than 10s will result in increasing the -# global HTTP write timeout, which applies to all connections and endpoints. -# See https://github.com/tendermint/tendermint/issues/3435 -timeout_broadcast_tx_commit = "10s" - -# Maximum number of requests that can be sent in a batch -# If the value is set to '0' (zero-value), then no maximum batch size will be -# enforced for a JSON-RPC batch request. -max_request_batch_size = 10 - -# Maximum size of request body, in bytes -max_body_bytes = 1000000 - -# Maximum size of request header, in bytes -max_header_bytes = 1048576 - -# The path to a file containing certificate that is used to create the HTTPS server. -# Might be either absolute path or path related to CometBFT's config directory. -# If the certificate is signed by a certificate authority, -# the certFile should be the concatenation of the server's certificate, any intermediates, -# and the CA's certificate. -# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. -# Otherwise, HTTP server is run. -tls_cert_file = "" - -# The path to a file containing matching private key that is used to create the HTTPS server. -# Might be either absolute path or path related to CometBFT's config directory. -# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. -# Otherwise, HTTP server is run. -tls_key_file = "" - -# pprof listen address (https://golang.org/pkg/net/http/pprof) -pprof_laddr = "localhost:6060" - -####################################################### -### P2P Configuration Options ### -####################################################### -[p2p] - -# Address to listen for incoming connections -laddr = "tcp://0.0.0.0:26656" - -# Address to advertise to peers for them to dial. If empty, will use the same -# port as the laddr, and will introspect on the listener to figure out the -# address. IP and port are required. Example: 159.89.10.97:26656 -external_address = "" - -# Comma separated list of seed nodes to connect to -seeds = "" - -# Comma separated list of nodes to keep persistent connections to -persistent_peers = "" - -# Path to address book -addr_book_file = "config/addrbook.json" - -# Set true for strict address routability rules -# Set false for private or local networks -addr_book_strict = true - -# Maximum number of inbound peers -max_num_inbound_peers = 40 - -# Maximum number of outbound peers to connect to, excluding persistent peers -max_num_outbound_peers = 10 - -# List of node IDs, to which a connection will be (re)established ignoring any existing limits -unconditional_peer_ids = "" - -# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) -persistent_peers_max_dial_period = "0s" - -# Time to wait before flushing messages out on the connection -flush_throttle_timeout = "100ms" - -# Maximum size of a message packet payload, in bytes -max_packet_msg_payload_size = 1024 - -# Rate at which packets can be sent, in bytes/second -send_rate = 5120000 - -# Rate at which packets can be received, in bytes/second -recv_rate = 5120000 - -# Set true to enable the peer-exchange reactor -pex = true - -# Seed mode, in which node constantly crawls the network and looks for -# peers. If another node asks it for addresses, it responds and disconnects. -# -# Does not work if the peer-exchange reactor is disabled. -seed_mode = false - -# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) -private_peer_ids = "" - -# Toggle to disable guard against peers connecting from the same ip. -allow_duplicate_ip = false - -# Peer connection configuration. -handshake_timeout = "20s" -dial_timeout = "3s" - -####################################################### -### Mempool Configuration Option ### -####################################################### -[mempool] - -# The type of mempool for this node to use. -# -# Possible types: -# - "flood" : concurrent linked list mempool with flooding gossip protocol -# (default) -# - "nop" : nop-mempool (short for no operation; the ABCI app is responsible -# for storing, disseminating and proposing txs). "create_empty_blocks=false" is -# not supported. -type = "flood" - -# Recheck (default: true) defines whether CometBFT should recheck the -# validity for all remaining transaction in the mempool after a block. -# Since a block affects the application state, some transactions in the -# mempool may become invalid. If this does not apply to your application, -# you can disable rechecking. -recheck = true - -# recheck_timeout is the time the application has during the rechecking process -# to return CheckTx responses, once all requests have been sent. Responses that -# arrive after the timeout expires are discarded. It only applies to -# non-local ABCI clients and when recheck is enabled. -# -# The ideal value will strongly depend on the application. It could roughly be estimated as the -# average size of the mempool multiplied by the average time it takes the application to validate one -# transaction. We consider that the ABCI application runs in the same location as the CometBFT binary -# so that the recheck duration is not affected by network delays when making requests and receiving responses. -recheck_timeout = "1s" - -# Broadcast (default: true) defines whether the mempool should relay -# transactions to other peers. Setting this to false will stop the mempool -# from relaying transactions to other peers until they are included in a -# block. In other words, if Broadcast is disabled, only the peer you send -# the tx to will see it until it is included in a block. -broadcast = true - -# WalPath (default: "") configures the location of the Write Ahead Log -# (WAL) for the mempool. The WAL is disabled by default. To enable, set -# WalPath to where you want the WAL to be written (e.g. -# "data/mempool.wal"). -wal_dir = "" - -# Maximum number of transactions in the mempool -size = 5000 - -# Limit the total size of all txs in the mempool. -# This only accounts for raw transactions (e.g. given 1MB transactions and -# max_txs_bytes=5MB, mempool will only accept 5 transactions). -max_txs_bytes = 1073741824 - -# Size of the cache (used to filter transactions we saw earlier) in transactions -cache_size = 10000 - -# Do not remove invalid transactions from the cache (default: false) -# Set to true if it's not possible for any invalid transaction to become valid -# again in the future. -keep-invalid-txs-in-cache = false - -# Maximum size of a single transaction. -# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. -max_tx_bytes = 1048576 - -# Maximum size of a batch of transactions to send to a peer -# Including space needed by encoding (one varint per transaction). -# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 -max_batch_bytes = 0 - -# Experimental parameters to limit gossiping txs to up to the specified number of peers. -# We use two independent upper values for persistent and non-persistent peers. -# Unconditional peers are not affected by this feature. -# If we are connected to more than the specified number of persistent peers, only send txs to -# ExperimentalMaxGossipConnectionsToPersistentPeers of them. If one of those -# persistent peers disconnects, activate another persistent peer. -# Similarly for non-persistent peers, with an upper limit of -# ExperimentalMaxGossipConnectionsToNonPersistentPeers. -# If set to 0, the feature is disabled for the corresponding group of peers, that is, the -# number of active connections to that group of peers is not bounded. -# For non-persistent peers, if enabled, a value of 10 is recommended based on experimental -# performance results using the default P2P configuration. -experimental_max_gossip_connections_to_persistent_peers = 0 -experimental_max_gossip_connections_to_non_persistent_peers = 0 - -####################################################### -### State Sync Configuration Options ### -####################################################### -[statesync] -# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine -# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in -# the network to take and serve state machine snapshots. State sync is not attempted if the node -# has any local state (LastBlockHeight > 0). The node will have a truncated block history, -# starting from the height of the snapshot. -enable = false - -# RPC servers (comma-separated) for light client verification of the synced state machine and -# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding -# header hash obtained from a trusted source, and a period during which validators can be trusted. -# -# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 -# weeks) during which they can be financially punished (slashed) for misbehavior. -rpc_servers = "" -trust_height = 0 -trust_hash = "" -trust_period = "168h0m0s" - -# Time to spend discovering snapshots before initiating a restore. -discovery_time = "15s" - -# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). -# Will create a new, randomly named directory within, and remove it when done. -temp_dir = "" - -# The timeout duration before re-requesting a chunk, possibly from a different -# peer (default: 1 minute). -chunk_request_timeout = "10s" - -# The number of concurrent chunk fetchers to run (default: 1). -chunk_fetchers = "4" - -####################################################### -### Block Sync Configuration Options ### -####################################################### -[blocksync] - -# Block Sync version to use: -# -# In v0.37, v1 and v2 of the block sync protocols were deprecated. -# Please use v0 instead. -# -# 1) "v0" - the default block sync implementation -version = "v0" - -####################################################### -### Consensus Configuration Options ### -####################################################### -[consensus] - -wal_file = "data/cs.wal/wal" - -# How long we wait for a proposal block before prevoting nil -timeout_propose = "1m0s" -# How much timeout_propose increases with each round -timeout_propose_delta = "5s" -# How long we wait after receiving +2/3 prevotes for β€œanything” (ie. not a single block or nil) -timeout_prevote = "10s" -# How much the timeout_prevote increases with each round -timeout_prevote_delta = "5s" -# How long we wait after receiving +2/3 precommits for β€œanything” (ie. not a single block or nil) -timeout_precommit = "10s" -# How much the timeout_precommit increases with each round -timeout_precommit_delta = "5s" -# How long we wait after committing a block, before starting on the new -# height (this gives us a chance to receive some more precommits, even -# though we already have +2/3). -timeout_commit = "1m0s" - -# How many blocks to look back to check existence of the node's consensus votes before joining consensus -# When non-zero, the node will panic upon restart -# if the same consensus key was used to sign {double_sign_check_height} last blocks. -# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. -double_sign_check_height = 0 - -# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) -skip_timeout_commit = false - -# EmptyBlocks mode and possible interval between empty blocks -create_empty_blocks = true -create_empty_blocks_interval = "0s" - -# Reactor sleep duration parameters -peer_gossip_sleep_duration = "100ms" -peer_query_maj23_sleep_duration = "2s" - -####################################################### -### Storage Configuration Options ### -####################################################### -[storage] - -# Set to true to discard ABCI responses from the state store, which can save a -# considerable amount of disk space. Set to false to ensure ABCI responses are -# persisted. ABCI responses are required for /block_results RPC queries, and to -# reindex events in the command-line tool. -discard_abci_responses = false - -####################################################### -### Transaction Indexer Configuration Options ### -####################################################### -[tx_index] - -# What indexer to use for transactions -# -# The application will set which txs to index. In some cases a node operator will be able -# to decide which txs to index based on configuration set in the application. -# -# Options: -# 1) "null" -# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). -# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. -# 3) "psql" - the indexer services backed by PostgreSQL. -# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. -indexer = "kv" - -# The PostgreSQL connection configuration, the connection format: -# postgresql://:@:/? -psql-conn = "" - -####################################################### -### Instrumentation Configuration Options ### -####################################################### -[instrumentation] - -# When true, Prometheus metrics are served under /metrics on -# PrometheusListenAddr. -# Check out the documentation for the list of available metrics. -prometheus = true - -# Address to listen for Prometheus collector(s) connections -prometheus_listen_addr = ":26660" - -# Maximum number of simultaneous connections. -# If you want to accept a larger number than the default, make sure -# you increase your OS limits. -# 0 - unlimited. -max_open_connections = 3 - -# Instrumentation namespace -namespace = "cometbft" From d952e5cbb8d7c022b9ff55eef46a3baeee223d92 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:47:37 -0800 Subject: [PATCH 08/25] self review --- .../docker_compose_debian_cheatsheet.md | 7 --- .../quickstart/docker_compose_walkthrough.md | 3 +- .../operate/quickstart/supplier_cheatsheet.md | 56 ------------------- 3 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index 17d3127e3..3d4c6290c 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -27,7 +27,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 @@ -331,9 +330,3 @@ docker compose up -d appgate # View docker logs -f --tail 100 appgate ``` - -### Re-stake the gateway - -``` - -``` diff --git a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md index 5652beb6c..f7cb389de 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md @@ -11,7 +11,6 @@ import ReactPlayer from "react-player"; - [Key Terms in Morse and Shannon](#key-terms-in-morse-and-shannon) - [Understanding Actors in the Shannon upgrade](#understanding-actors-in-the-shannon-upgrade) - [Prerequisites](#prerequisites) - - [\[Optional\] Create a new user](#optional-create-a-new-user) - [A. Deploying a Full Node](#a-deploying-a-full-node) - [B. Creating a Supplier and Deploying a RelayMiner](#b-creating-a-supplier-and-deploying-a-relayminer) - [C. Creating an Application and Deploying an AppGate Server](#c-creating-an-application-and-deploying-an-appgate-server) @@ -153,7 +152,7 @@ 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 +### [Optional] Create a new user :::note diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md deleted file mode 100644 index efa8e0282..000000000 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -sidebar_position: 4 -title: Supplier (RelayMiner) Cheat Sheet ---- - -## Supplier Cheat Sheet - -- [Context](#context) -- [Pre-Requisites](#pre-requisites) -- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) -- [1. Retrieve the source code](#1-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. - -:::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 - -You will need the following: - -1. A funded onchain wallet/account/address -2. A known service - -- How do I stake a service? -- How do I view existing services? -- How do I - -### 1. Deploy your Server & Install Dependencies - -You can deploy a RelayMiner on any server. - -If you are just getting started, you can follow along the team at Grove and follow -the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) -to deploy a Debian server on a Vultr instance. - -### 1. 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 -``` From 3b3c78e333285c36837838dad7756313b1c71a0e Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:48:06 -0800 Subject: [PATCH 09/25] Add back the supplier cheatsheet --- .../operate/quickstart/supplier_cheatsheet.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md new file mode 100644 index 000000000..efa8e0282 --- /dev/null +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 4 +title: Supplier (RelayMiner) Cheat Sheet +--- + +## Supplier Cheat Sheet + +- [Context](#context) +- [Pre-Requisites](#pre-requisites) +- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) +- [1. Retrieve the source code](#1-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. + +:::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 + +You will need the following: + +1. A funded onchain wallet/account/address +2. A known service + +- How do I stake a service? +- How do I view existing services? +- How do I + +### 1. Deploy your Server & Install Dependencies + +You can deploy a RelayMiner on any server. + +If you are just getting started, you can follow along the team at Grove and follow +the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) +to deploy a Debian server on a Vultr instance. + +### 1. 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 +``` From 0c0794b3e55094fc9814a5f967acbba52032b220 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:47:37 -0800 Subject: [PATCH 10/25] self review --- .../docker_compose_debian_cheatsheet.md | 10 +--- .../quickstart/docker_compose_walkthrough.md | 3 +- .../operate/quickstart/supplier_cheatsheet.md | 56 ------------------- 3 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index 17d3127e3..ad7d2b632 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -10,7 +10,6 @@ import ReactPlayer from "react-player"; - [Results](#results) - [Deploy your server](#deploy-your-server) - [Install Dependencies](#install-dependencies) - - [\[Optional\] Create a new user](#optional-create-a-new-user) - [Retrieve the source code](#retrieve-the-source-code) - [Update your environment](#update-your-environment) - [Start up the full node](#start-up-the-full-node) @@ -27,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 @@ -86,7 +84,7 @@ 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 +### [Optional] Create a new user You can optionally create a new user and give it sudo permissions instead of using `root`. @@ -331,9 +329,3 @@ docker compose up -d appgate # View docker logs -f --tail 100 appgate ``` - -### Re-stake the gateway - -``` - -``` diff --git a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md index 5652beb6c..f7cb389de 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md @@ -11,7 +11,6 @@ import ReactPlayer from "react-player"; - [Key Terms in Morse and Shannon](#key-terms-in-morse-and-shannon) - [Understanding Actors in the Shannon upgrade](#understanding-actors-in-the-shannon-upgrade) - [Prerequisites](#prerequisites) - - [\[Optional\] Create a new user](#optional-create-a-new-user) - [A. Deploying a Full Node](#a-deploying-a-full-node) - [B. Creating a Supplier and Deploying a RelayMiner](#b-creating-a-supplier-and-deploying-a-relayminer) - [C. Creating an Application and Deploying an AppGate Server](#c-creating-an-application-and-deploying-an-appgate-server) @@ -153,7 +152,7 @@ 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 +### [Optional] Create a new user :::note diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md deleted file mode 100644 index efa8e0282..000000000 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -sidebar_position: 4 -title: Supplier (RelayMiner) Cheat Sheet ---- - -## Supplier Cheat Sheet - -- [Context](#context) -- [Pre-Requisites](#pre-requisites) -- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) -- [1. Retrieve the source code](#1-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. - -:::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 - -You will need the following: - -1. A funded onchain wallet/account/address -2. A known service - -- How do I stake a service? -- How do I view existing services? -- How do I - -### 1. Deploy your Server & Install Dependencies - -You can deploy a RelayMiner on any server. - -If you are just getting started, you can follow along the team at Grove and follow -the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) -to deploy a Debian server on a Vultr instance. - -### 1. 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 -``` From fefd306f267c148d565469b915f8305b747706a0 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 13:55:33 -0800 Subject: [PATCH 11/25] Adding the supplier cheatsheet back --- .../operate/quickstart/supplier_cheatsheet.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md new file mode 100644 index 000000000..efa8e0282 --- /dev/null +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -0,0 +1,56 @@ +--- +sidebar_position: 4 +title: Supplier (RelayMiner) Cheat Sheet +--- + +## Supplier Cheat Sheet + +- [Context](#context) +- [Pre-Requisites](#pre-requisites) +- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) +- [1. Retrieve the source code](#1-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. + +:::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 + +You will need the following: + +1. A funded onchain wallet/account/address +2. A known service + +- How do I stake a service? +- How do I view existing services? +- How do I + +### 1. Deploy your Server & Install Dependencies + +You can deploy a RelayMiner on any server. + +If you are just getting started, you can follow along the team at Grove and follow +the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) +to deploy a Debian server on a Vultr instance. + +### 1. 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 +``` From 081f13f91a173b30a2e806f8cf828690c598040e Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 25 Nov 2024 17:59:16 -0800 Subject: [PATCH 12/25] Checkpoint --- .../operate/quickstart/service_cheatsheet.md | 7 +- .../operate/quickstart/supplier_cheatsheet.md | 135 ++++++++++++++++-- 2 files changed, 125 insertions(+), 17 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/service_cheatsheet.md b/docusaurus/docs/operate/quickstart/service_cheatsheet.md index b195ef5a5..cd2de1c08 100644 --- a/docusaurus/docs/operate/quickstart/service_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/service_cheatsheet.md @@ -60,13 +60,14 @@ 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 ``` @@ -74,7 +75,7 @@ poktrolld tx service add-service "svc-$USER" "service description for $USER" 69 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 \ diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index efa8e0282..7a3eb578d 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -7,8 +7,16 @@ title: Supplier (RelayMiner) Cheat Sheet - [Context](#context) - [Pre-Requisites](#pre-requisites) -- [1. Deploy your Server \& Install Dependencies](#1-deploy-your-server--install-dependencies) -- [1. Retrieve the source code](#1-retrieve-the-source-code) +- [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 @@ -30,24 +38,123 @@ please see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md) ### Pre-Requisites -You will need the following: +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. -1. A funded onchain wallet/account/address -2. A known service +### Suppliers -- How do I stake a service? -- How do I view existing services? -- How do I +#### How do I query for all existing onchain Suppliers? -### 1. Deploy your Server & Install Dependencies +Then, you can query for all services like so: -You can deploy a RelayMiner on any server. +```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 +``` -If you are just getting started, you can follow along the team at Grove and follow -the instructions in the [Docker Compose Cheat Sheet](./docker_compose_debian_cheatsheet#deploy-your-server) -to deploy a Debian server on a Vultr instance. +### RelayMiners -### 1. Retrieve the source code +#### Retrieve the source code ```bash mkdir ~/workspace && cd ~/workspace From c293e099eb13c74fd4d7b45dd0fcd265926878eb Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 3 Dec 2024 17:46:21 -0800 Subject: [PATCH 13/25] Checkpoint - reviewing full node configs --- .../docker_compose_debian_cheatsheet.md | 17 +- .../quickstart/docker_compose_walkthrough.md | 25 +- .../quickstart/full_node_cheatsheet.md | 30 ++- .../operate/quickstart/gateway_cheatsheet.md | 6 +- .../operate/quickstart/service_cheatsheet.md | 2 +- .../operate/quickstart/supplier_cheatsheet.md | 2 +- .../quickstart/validator_cheatsheet.md | 30 +++ .../run_a_node/full_node_walkthrough.md | 236 +++++++++--------- .../operate/run_a_node/gateway_walkthrough.md | 2 +- .../run_a_node/validator_walkthrough.md | 29 +++ 10 files changed, 221 insertions(+), 158 deletions(-) create mode 100644 docusaurus/docs/operate/quickstart/validator_cheatsheet.md create mode 100644 docusaurus/docs/operate/run_a_node/validator_walkthrough.md diff --git a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md index afc6b8a63..5eb6862f8 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_debian_cheatsheet.md @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md index 229a03f71..5a6cc8446 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md @@ -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 - -:::note - -Make sure to replace `olshansky` with your username. - -::: +### [Recommended] Create a new user 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 diff --git a/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md b/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md index d2986bb30..3f4bd18c2 100644 --- a/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md @@ -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) + +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) @@ -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). @@ -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/` @@ -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 ``` @@ -137,7 +161,7 @@ Your node is configured to handle chain upgrades automatically through Cosmoviso No manual intervention is required for standard upgrades. - + + + +This cheat sheet provides quick copy-pasta like instructions for installing and +running a Validator using an automated scripts. + +:::tip + +If you're interesting in understanding everything, or having full control of every +step, check out the [Validator Walkthrough](../run_a_node/validator_walkthrough.md). + +::: + +- [Introduction](#introduction) + - [Pre-Requisites](#pre-requisites) + +## Introduction + +This guide will help you install a Validator on Pocket Network, +**using helper that abstract out some of the underlying complexity.** + +### Pre-Requisites + +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 diff --git a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md index d0adb768c..240eea3b8 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md +++ b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md @@ -3,35 +3,59 @@ title: Full Node (systemd) sidebar_position: 2 --- -## Run a Validator +## Run a Full Node Using Systemd -This walkthrough provides step-by-step instructions to manually install and configure a Full Node from scratch. +This walkthrough provides a detailed step-by-step instructions to install and +configure a Pocket Network Full Node from scratch. + +:::tip + +If you're comfortable using an automated scripts, or simply want to _copy-pasta_ a +few commands to get started, check out the [Full Node Cheat Sheet](../quickstart/full_node_cheatsheet.md). + +::: - [Introduction](#introduction) - [Pre-Requisites](#pre-requisites) -- [Step 1: Create a New User](#step-1-create-a-new-user) -- [Step 2: Install Dependencies](#step-2-install-dependencies) -- [Step 3: Set Up Environment Variables](#step-3-set-up-environment-variables) -- [Step 4: Install Cosmovisor](#step-4-install-cosmovisor) -- [Step 5: Install `poktrolld`](#step-5-install-poktrolld) -- [Step 6: Configure `poktrolld`](#step-6-configure-poktrolld) -- [Step 7: Set Up `systemd` Service](#step-7-set-up-systemd-service) -- [Step 8: Open Firewall Ports](#step-8-open-firewall-ports) +- [1. Install Dependencies](#1-install-dependencies) +- [2. Create a New User](#2-create-a-new-user) +- [3. Set Up Environment Variables for Cosmovisor](#3-set-up-environment-variables-for-cosmovisor) +- [4. Install Cosmovisor](#4-install-cosmovisor) +- [5. Install `poktrolld`](#5-install-poktrolld) +- [6. Retrieve the latest genesis file](#6-retrieve-the-latest-genesis-file) +- [7. Network Configuration](#7-network-configuration) +- [8. Set Up `systemd` Service](#8-set-up-systemd-service) +- [9. Configure your Firewall](#9-configure-your-firewall) - [Next Steps](#next-steps) ### Introduction -This guide will help you install a Full Node for Pocket Network manually, giving you control over each step of the process. Running a Full Node is the first step toward becoming a Validator. +This guide will help you install a Full Node for Pocket Network, from scratch, manually, +**giving you control over each step of the process**. -**TL;DR**: If you're comfortable using an automated script, check out the [Full Node Cheat Sheet](../quickstart/full_node_cheatsheet.md) for quick setup instructions. +Running a Full Node is the first step toward becoming a Validator, Supplier, or Gateway. + +These instructions are **intended to be run on a Linux machine**. + +The instructions outlined here use [Cosmovisor](https://docs.cosmos.network/v0.45/run-node/cosmovisor.html) +to enable automatic binary upgrades. ### Pre-Requisites -- **Linux-based System**: Preferably Debian-based distributions. -- **Root or Sudo Access**: Administrative privileges are required. -- **Dedicated Server or Virtual Machine**: Any provider is acceptable. +1. **Linux-based System**: Preferably Debian-based distributions. +2. **Root or Sudo Access**: Administrative privileges are required. +3. **Dedicated Server or Virtual Machine**: Any provider is acceptable. -### Step 1: Create a New User +### 1. Install Dependencies + +Update your package list and install necessary dependencies: + +```bash +sudo apt-get update +sudo apt-get install -y curl tar wget jq +``` + +### 2. Create a New User Create a dedicated user to run `poktrolld`: @@ -45,127 +69,101 @@ Set a password when prompted, and add the user to the sudo group: sudo usermod -aG sudo poktroll ``` -### Step 2: Install Dependencies - -Update your package list and install necessary dependencies: +And switch to the `poktroll` user: ```bash -sudo apt-get update -sudo apt-get install -y curl tar wget jq +sudo su - poktroll ``` -### Step 3: Set Up Environment Variables +### 3. Set Up Environment Variables for Cosmovisor -Switch to the `poktroll` user and set environment variables required for Cosmovisor: +Create a `.poktrollrc` file and set environment variables: ```bash -sudo su - poktroll -``` +touch ~/.poktrollrc -Add the following to your `.profile`: +echo "export DAEMON_NAME=poktrolld" >> ~/.poktrollrc +echo "export DAEMON_HOME=\$HOME/.poktroll" >> ~/.poktrollrc +echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.poktrollrc +echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> ~/.poktrollrc +echo "export UNSAFE_SKIP_BACKUP=false" >> ~/.poktrollrc -```bash -echo "export DAEMON_NAME=poktrolld" >> ~/.profile -echo "export DAEMON_HOME=\$HOME/.poktroll" >> ~/.profile -echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.profile -echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> ~/.profile -echo "export UNSAFE_SKIP_BACKUP=false" >> ~/.profile +echo "source ~/.poktrollrc" >> ~/.profile source ~/.profile ``` -### Step 4: Install Cosmovisor - -Download and install Cosmovisor: +### 4. Install Cosmovisor :::info -Alternatively, you can follow the [official cosmovisor installation instructions](https://docs.cosmos.network/main/build/tooling/cosmovisor#installation). +Instead of following the instructions below, you can follow the [official cosmovisor installation instructions](https://docs.cosmos.network/main/build/tooling/cosmovisor#installation). ::: +Download and install Cosmovisor: + ```bash mkdir -p $HOME/.local/bin COSMOVISOR_VERSION="v1.6.0" ARCH=$(uname -m) -if [ "$ARCH" = "x86_64" ]; then +if [ "$ARCH" = "x86_64" ]; then ARCH="amd64" -elif [ "$ARCH" = "aarch64" ]; then +elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64" fi curl -L "https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2F${COSMOVISOR_VERSION}/cosmovisor-${COSMOVISOR_VERSION}-linux-${ARCH}.tar.gz" | tar -zxvf - -C $HOME/.local/bin + echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.profile source ~/.profile ``` +### 5. Install `poktrolld` -### Step 5: Install `poktrolld` +Follow the instructions in the [CLI Installation Guide](../user_guide/install.md) page to install `poktrolld`. -Download and install `poktrolld`: +### 6. Retrieve the latest genesis file -1. **Download Genesis and Extract Version**: +Follow the instructions below to download the latest genesis file. - ```bash - # Select network (testnet-alpha, testnet-beta, or mainnet) - NETWORK="testnet-beta" # Change this to your desired network - - # Create config directory if it doesn't exist - mkdir -p $HOME/.poktroll/config - - # Download genesis file - GENESIS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/shannon/${NETWORK}/genesis.json" - curl -s -o $HOME/.poktroll/config/genesis.json "$GENESIS_URL" - - # Extract version and set architecture - POKTROLLD_VERSION=$(jq -r '.app_version' < $HOME/.poktroll/config/genesis.json) - ARCH=$(uname -m) - if [ "$ARCH" = "x86_64" ]; then ARCH="amd64" - elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64" - fi - ``` - -2. **Download and Install the Binary**: +```bash +# Select network (testnet-alpha, testnet-beta, or mainnet) +NETWORK="testnet-beta" # Change this to your desired network - Create the cosmovisor genesis directory and download the binary. - ```bash - mkdir -p $HOME/.poktroll/cosmovisor/genesis/bin - curl -L "https://github.com/pokt-network/poktroll/releases/download/v${POKTROLLD_VERSION}/poktroll_linux_${ARCH}.tar.gz" | tar -zxvf - -C $HOME/.poktroll/cosmovisor/genesis/bin - chmod +x $HOME/.poktroll/cosmovisor/genesis/bin/poktrolld - ln -sf $HOME/.poktroll/cosmovisor/genesis/bin/poktrolld $HOME/.local/bin/poktrolld - ``` +# Create config directory if it doesn't exist +mkdir -p $HOME/.poktroll/config -### Step 6: Configure `poktrolld` +# Download genesis file +GENESIS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/shannon/${NETWORK}/genesis.json" +curl -s -o $HOME/.poktroll/config/genesis.json "$GENESIS_URL" +``` -Initialize configuration files and set up the node: +### 7. Network Configuration -1. **Extract Chain ID and Initialize Node**: +:::note +You may see a message saying `genesis.json file already exists`. - ```bash - # Extract chain-id from existing genesis - CHAIN_ID=$(jq -r '.chain_id' < $HOME/.poktroll/config/genesis.json) - - # Initialize the node - poktrolld init "YourNodeMoniker" --chain-id="$CHAIN_ID" --home=$HOME/.poktroll - ``` +This is expected since we downloaded the genesis file in Step 5. The initialization will still complete successfully and set up the required configuration files. +::: - :::note - You may see a message saying `genesis.json file already exists`. This is expected since we downloaded the genesis file in Step 5. The initialization will still complete successfully and set up the required configuration files. - ::: +Run the following commands to configure your network environment appropriately: -2. **Set Seeds**: +```bash +# Extract chain-id from existing genesis +CHAIN_ID=$(jq -r '.chain_id' < $HOME/.poktroll/config/genesis.json) - ```bash - SEEDS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/shannon/${NETWORK}/seeds" - SEEDS=$(curl -s "$SEEDS_URL") - sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.poktroll/config/config.toml - ``` +# Initialize the node +poktrolld init "YourNodeMoniker_REPLACE_ME" --chain-id="$CHAIN_ID" --home=$HOME/.poktroll -3. **Set External Address**: +# Set the seeds +SEEDS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/shannon/${NETWORK}/seeds" +SEEDS=$(curl -s "$SEEDS_URL") +sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" $HOME/.poktroll/config/config.toml - ```bash - EXTERNAL_IP=$(curl -s https://api.ipify.org) - sed -i -e "s|^external_address *=.*|external_address = \"${EXTERNAL_IP}:26656\"|" $HOME/.poktroll/config/config.toml - ``` +# Set External Address +EXTERNAL_IP=$(curl -s https://api.ipify.org) +sed -i -e "s|^external_address *=.*|external_address = \"${EXTERNAL_IP}:26656\"|" $HOME/.poktroll/config/config.toml +``` -### Step 7: Set Up `systemd` Service +### 8. Set Up `systemd` Service Create a `systemd` service file to manage the node: @@ -201,52 +199,44 @@ sudo systemctl enable cosmovisor.service sudo systemctl start cosmovisor.service ``` -### Step 8: Open Firewall Ports +### 9. Configure your Firewall -To ensure your node can properly participate in the P2P network, you need to make port `26656` accessible from the internet. This may involve: +To ensure your node can properly participate in the P2P network, you need to make port `26656` accessible from the internet. + +This may involve one or more of the following: + +1. **Configuring your firewall for UFW**: -1. **Configuring your firewall**: - - For UFW: ```bash sudo ufw allow 26656/tcp ``` - For iptables: +2. **Configuring your firewall for iptables**: + ```bash sudo iptables -A INPUT -p tcp --dport 26656 -j ACCEPT ``` -2. **Cloud Provider Settings**: - - If running on a cloud provider (AWS, GCP, Azure, etc.), ensure you configure the security groups or firewall rules to allow inbound traffic on port 26656. - -3. **Router Configuration**: - - If running behind a router, configure port forwarding for port 26656 to your node's internal IP address. +3. **Cloud Provider Settings**: If running on a cloud provider (AWS, GCP, Azure, etc.), ensure you configure the security groups or firewall rules to allow inbound traffic on port 26656. +4. **Router Configuration**: If running behind a router, configure port forwarding for port 26656 to your node's internal IP address. +5. **Verify your port** is accessible using a tool like netcat or telnet from another machine: -You can verify your port is accessible using a tool like netcat or telnet from another machine: -```bash -nc -vz your_server_ip 26656 -``` + ```bash + nc -vz your_server_ip 26656 + ``` ### Next Steps Your Full Node is now up and running. You can check its status and logs using the commands: -- **Check Status**: +**Check Status**: - ```bash - sudo systemctl status cosmovisor.service - ``` - -- **View Logs**: - - ```bash - sudo journalctl -u cosmovisor.service -f - ``` - - +```bash +sudo journalctl -u cosmovisor.service -f +``` diff --git a/docusaurus/docs/operate/run_a_node/gateway_walkthrough.md b/docusaurus/docs/operate/run_a_node/gateway_walkthrough.md index 7dcc399b0..8dc7a31f4 100644 --- a/docusaurus/docs/operate/run_a_node/gateway_walkthrough.md +++ b/docusaurus/docs/operate/run_a_node/gateway_walkthrough.md @@ -1,6 +1,6 @@ --- title: Gateway Walkthrough -sidebar_position: 4 +sidebar_position: 6 --- # Run a Gateway diff --git a/docusaurus/docs/operate/run_a_node/validator_walkthrough.md b/docusaurus/docs/operate/run_a_node/validator_walkthrough.md new file mode 100644 index 000000000..6c8842f52 --- /dev/null +++ b/docusaurus/docs/operate/run_a_node/validator_walkthrough.md @@ -0,0 +1,29 @@ +--- +title: Validator Walkthrough +sidebar_position: 4 +--- + +## Validator Walkthrough + + + +This walkthrough provides a detailed step-by-step instructions to run a validator node for Pocket Network. + +:::tip + +If you're comfortable using an automated scripts, or simply want to _copy-pasta_ a +few commands to get started, check out the [Validator Cheat Sheet](../quickstart/validator_cheatsheet.md). + +::: + +- [Introduction](#introduction) +- [Pre-Requisites](#pre-requisites) + +## Introduction + +This guide will help you install a Validator on Pocket Network, from scratch, manually, +**giving you control over each step of the process**. + +## Pre-Requisites + +1. **Run a Full Node**: Make sure you have followed the [Full Node Walkthrough](../run_a_node/full_node_walkthrough.md) to install and run a Full Node first From b0c00cf696cd5f56b972e206f14fd5c6b8ff7a83 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 3 Dec 2024 18:01:22 -0800 Subject: [PATCH 14/25] Finish reviewing the full node walkthrough --- .../run_a_node/full_node_walkthrough.md | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md index 240eea3b8..94ccb7420 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md +++ b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md @@ -1,9 +1,9 @@ --- -title: Full Node (systemd) +title: Full Node (systemd & cosmovisor) sidebar_position: 2 --- -## Run a Full Node Using Systemd +## Run a Full Node Using Systemd & Cosmovisor This walkthrough provides a detailed step-by-step instructions to install and configure a Pocket Network Full Node from scratch. @@ -26,7 +26,12 @@ few commands to get started, check out the [Full Node Cheat Sheet](../quickstart - [7. Network Configuration](#7-network-configuration) - [8. Set Up `systemd` Service](#8-set-up-systemd-service) - [9. Configure your Firewall](#9-configure-your-firewall) -- [Next Steps](#next-steps) +- [FAQ \& Troubleshooting](#faq--troubleshooting) + - [How do I check the node is accessible from another machine?](#how-do-i-check-the-node-is-accessible-from-another-machine) + - [How do I view the node status?](#how-do-i-view-the-node-status) + - [How do I view the node logs?](#how-do-i-view-the-node-logs) + - [How do I restart my node?](#how-do-i-restart-my-node) + - [How do I query the latest block (i.e. check the node height)?](#how-do-i-query-the-latest-block-ie-check-the-node-height) ### Introduction @@ -120,6 +125,13 @@ source ~/.profile Follow the instructions in the [CLI Installation Guide](../user_guide/install.md) page to install `poktrolld`. +Create a symlink of the binary so Comosvisor knows where to find it: + +```bash +mkdir -p $HOME/.poktroll/cosmovisor/genesis/bin +ln -sf $(which poktrolld) $HOME/.poktroll/cosmovisor/genesis/bin/poktrolld +``` + ### 6. Retrieve the latest genesis file Follow the instructions below to download the latest genesis file. @@ -225,18 +237,43 @@ This may involve one or more of the following: nc -vz your_server_ip 26656 ``` -### Next Steps +### FAQ & Troubleshooting -Your Full Node is now up and running. You can check its status and logs using the commands: +#### How do I check the node is accessible from another machine? -**Check Status**: +```bash +nc -vz your_server_ip 26656 +``` + +#### How do I view the node status? ```bash sudo systemctl status cosmovisor.service ``` -**View Logs**: +#### How do I view the node logs? ```bash sudo journalctl -u cosmovisor.service -f ``` + +#### How do I restart my node? + +```bash +sudo systemctl stop cosmovisor.service +sudo systemctl start cosmovisor.service +``` + +#### How do I query the latest block (i.e. check the node height)? + +Using poktrolld: + +```bash +poktrolld query block --type=height --node http://localhost:26657 +``` + +Or, using curl: + +```bash +curl -X GET http://localhost:26657/block | jq +``` From 10c659823e1a1cc4b4fbc1f2da5f9b2c89cfd048 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 3 Dec 2024 19:03:55 -0800 Subject: [PATCH 15/25] Update the cheatsheet --- .../quickstart/full_node_cheatsheet.md | 129 +++++------------- .../run_a_node/full_node_walkthrough.md | 45 +++++- tools/installer/full-node.sh | 63 +++++---- 3 files changed, 111 insertions(+), 126 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md b/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md index 3f4bd18c2..f3711ddcb 100644 --- a/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/full_node_cheatsheet.md @@ -3,7 +3,7 @@ title: Full Node Cheat Sheet sidebar_position: 3 --- -## Full Node Walkthrough (Using Systemd) +## Full Node Cheat Sheet Using Systemd & Cosmovisor This cheat sheet provides quick copy-pasta like instructions for installing and running a Full Node using an automated scripts. @@ -17,16 +17,10 @@ step, check out the [Full Node Walkthrough](../run_a_node/full_node_walkthrough. - [Introduction](#introduction) - [Pre-Requisites](#pre-requisites) -- [Install a Full Node using Cosmovisor](#install-a-full-node-using-cosmovisor) -- [What Gets Installed](#what-gets-installed) -- [Useful Commands](#useful-commands) - - [Check the status of your node](#check-the-status-of-your-node) - - [View the logs](#view-the-logs) - - [Stop the node](#stop-the-node) - - [Start the node](#start-the-node) - - [Restart the node](#restart-the-node) - - [Advanced Operations](#advanced-operations) -- [Automatic Upgrades](#automatic-upgrades) +- [Install and Run a Full Node using Cosmovisor](#install-and-run-a-full-node-using-cosmovisor) + - [Automatic Upgrades Out of the Box](#automatic-upgrades-out-of-the-box) +- [FAQ \& Troubleshooting](#faq--troubleshooting) +- [\[OPTIONAL\] Do you care to know what just happened?](#optional-do-you-care-to-know-what-just-happened) ### Introduction @@ -41,9 +35,14 @@ Running a Full Node is the first step toward becoming a Validator, Supplier, or 2. **Root or Sudo Access**: You need administrative privileges to run the installation script. 3. **Dedicated Server or Virtual Machine**: Any provider should work (Vultr and Hetzner have been tested). -### Install a Full Node using Cosmovisor +### Install and Run a Full Node using Cosmovisor -To install and set up a Full Node, follow these steps: +:::info +This section script will handle the installation of dependencies, user creation, +environment variable setup, and configuration of Cosmovisor and `poktrolld`. +::: + +Follow the instructions below to **quickly** install and set up a Full Node: 1. **Download the Installation Script**: @@ -61,15 +60,33 @@ To install and set up a Full Node, follow these steps: - **Choose the Network**: Select `testnet-alpha`, `testnet-beta`, or `mainnet`. - **Set Username**: Input the desired username to run `poktrolld` (default: `poktroll`). - - **Set Node Moniker**: Input the node moniker (default: your hostname). + - **Set Node Moniker**: Input the node moniker (default: your `hostname`). - **Confirm Seeds and Genesis File**: The script fetches seeds and the genesis file automatically. - **External IP Address**: The script detects your external IP address. Confirm or input manually if incorrect. -The script will handle the installation of dependencies, user creation, environment variable setup, and configuration of Cosmovisor and `poktrolld`. +#### Automatic Upgrades Out of the Box + +Your node is configured to handle chain upgrades automatically through Cosmovisor. No manual intervention is required for standard upgrades. + +When a chain upgrade is proposed and approved: + +1. Cosmovisor will download the new binary +2. The node will stop at the designated upgrade height +3. Cosmovisor will switch to the new binary +4. The node will restart automatically + +### FAQ & Troubleshooting + +See the [FAQ & Troubleshooting section in the Full Node Walkthrough](../run_a_node/full_node_walkthrough.md#faq--troubleshooting) +for examples of useful commands, common debugging instructions and other advanced usage. -### What Gets Installed +### [OPTIONAL] Do you care to know what just happened? -When you run the installation script, the following components are set up: +:::info +This section is optional and for informational purposes only. +::: + +If you're interest in understand what just got installed, keep reading... 1. **System User**: A dedicated user (default: `poktroll`) is created to run the node securely. @@ -89,81 +106,3 @@ When you run the installation script, the following components are set up: - Name: `cosmovisor.service` - Status: Enabled and started automatically - Configured for automatic restarts and upgrades - -### Useful Commands - -After installation, you can manage your node using the following commands: - -#### Check the status of your node - -```bash -sudo systemctl status cosmovisor.service -``` - -#### View the logs - -```bash -sudo journalctl -u cosmovisor.service -f -``` - -#### Stop the node - -```bash -sudo systemctl stop cosmovisor.service -``` - -#### Start the node - -```bash -sudo systemctl start cosmovisor.service -``` - -#### Restart the node - -```bash -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 -``` - -### Automatic Upgrades - -Your node is configured to handle chain upgrades automatically through Cosmovisor. When a chain upgrade is proposed and approved: - -1. Cosmovisor will download the new binary -2. The node will stop at the designated upgrade height -3. Cosmovisor will switch to the new binary -4. The node will restart automatically - -No manual intervention is required for standard upgrades. - - diff --git a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md index 94ccb7420..196dddc50 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md +++ b/docusaurus/docs/operate/run_a_node/full_node_walkthrough.md @@ -1,5 +1,5 @@ --- -title: Full Node (systemd & cosmovisor) +title: Full Node Walkthrough sidebar_position: 2 --- @@ -30,8 +30,14 @@ few commands to get started, check out the [Full Node Cheat Sheet](../quickstart - [How do I check the node is accessible from another machine?](#how-do-i-check-the-node-is-accessible-from-another-machine) - [How do I view the node status?](#how-do-i-view-the-node-status) - [How do I view the node logs?](#how-do-i-view-the-node-logs) + - [How do I stop my node?](#how-do-i-stop-my-node) + - [How do I start my node?](#how-do-i-start-my-node) - [How do I restart my node?](#how-do-i-restart-my-node) - [How do I query the latest block (i.e. check the node height)?](#how-do-i-query-the-latest-block-ie-check-the-node-height) + - [How do I check the node version?](#how-do-i-check-the-node-version) + - [How do I check the Cosmosvisor directory structure?](#how-do-i-check-the-cosmosvisor-directory-structure) + - [How do I check if an upgrade is available?](#how-do-i-check-if-an-upgrade-is-available) + - [How do I view node configuration?](#how-do-i-view-node-configuration) ### Introduction @@ -257,13 +263,24 @@ sudo systemctl status cosmovisor.service sudo journalctl -u cosmovisor.service -f ``` -#### How do I restart my node? +#### How do I stop my node? ```bash sudo systemctl stop cosmovisor.service +``` + +#### How do I start my node? + +```bash sudo systemctl start cosmovisor.service ``` +#### How do I restart my node? + +```bash +sudo systemctl restart cosmovisor.service +``` + #### How do I query the latest block (i.e. check the node height)? Using poktrolld: @@ -277,3 +294,27 @@ Or, using curl: ```bash curl -X GET http://localhost:26657/block | jq ``` + +#### How do I check the node version? + +```bash +sudo -u poktroll poktrolld version +``` + +#### How do I check the Cosmosvisor directory structure? + +```bash +ls -la /home/poktroll/.poktroll/cosmovisor/ +``` + +#### How do I check if an upgrade is available? + +```bash +ls -la /home/poktroll/.poktroll/cosmovisor/upgrades/ +``` + +#### How do I view node configuration? + +```bash +cat /home/poktroll/.poktroll/config/config.toml +``` diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index 1274933de..12f0cd7e2 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -28,7 +28,7 @@ check_root() { # Function to install jq if not installed install_jq() { - if ! command -v jq &> /dev/null; then + if ! command -v jq &>/dev/null; then print_color $YELLOW "Installing jq..." if [ -f /etc/debian_version ]; then apt-get update @@ -50,16 +50,19 @@ install_jq() { get_user_input() { # Ask user which network to install echo "Which network would you like to install?" - echo "1) testnet-alpha" - echo "2) testnet-beta" - echo "3) mainnet" + echo "1) testnet-alpha (unstable)" + echo "2) testnet-beta (recommended)" + echo "3) mainnet (not launched yet)" read -p "Enter your choice (1-3): " network_choice case $network_choice in - 1) NETWORK="testnet-alpha" ;; - 2) NETWORK="testnet-beta" ;; - 3) NETWORK="mainnet" ;; - *) print_color $RED "Invalid network choice. Exiting."; exit 1 ;; + 1) NETWORK="testnet-alpha" ;; + 2) NETWORK="testnet-beta" ;; + 3) NETWORK="mainnet" ;; + *) + print_color $RED "Invalid network choice. Exiting." + exit 1 + ;; esac print_color $GREEN "Installing the $NETWORK network." @@ -84,7 +87,7 @@ get_user_input() { fi # Extract chain_id from genesis.json - CHAIN_ID=$(jq -r '.chain_id' < "$GENESIS_FILE") + CHAIN_ID=$(jq -r '.chain_id' <"$GENESIS_FILE") if [ -z "$CHAIN_ID" ]; then print_color $RED "Failed to extract chain_id from genesis file." exit 1 @@ -145,7 +148,7 @@ install_dependencies() { # Function to set up environment variables setup_env_vars() { print_color $YELLOW "Setting up environment variables..." - sudo -u "$POKTROLL_USER" bash << EOF + sudo -u "$POKTROLL_USER" bash <> \$HOME/.profile echo "export DAEMON_HOME=\$HOME/.poktroll" >> \$HOME/.profile echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> \$HOME/.profile @@ -160,9 +163,9 @@ EOF setup_cosmovisor() { print_color $YELLOW "Setting up Cosmovisor..." ARCH=$(uname -m) - if [ "$ARCH" = "x86_64" ]; then + if [ "$ARCH" = "x86_64" ]; then ARCH="amd64" - elif [ "$ARCH" = "aarch64" ]; then + elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64" else print_color $RED "Unsupported architecture: $ARCH" @@ -172,7 +175,7 @@ setup_cosmovisor() { COSMOVISOR_VERSION="v1.6.0" COSMOVISOR_URL="https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2F${COSMOVISOR_VERSION}/cosmovisor-${COSMOVISOR_VERSION}-linux-${ARCH}.tar.gz" - sudo -u "$POKTROLL_USER" bash << EOF + sudo -u "$POKTROLL_USER" bash <> \$HOME/.profile @@ -181,14 +184,13 @@ EOF print_color $GREEN "Cosmovisor set up successfully." } - # Function to download and set up Poktrolld setup_poktrolld() { print_color $YELLOW "Setting up Poktrolld..." ARCH=$(uname -m) - if [ "$ARCH" = "x86_64" ]; then + if [ "$ARCH" = "x86_64" ]; then ARCH="amd64" - elif [ "$ARCH" = "aarch64" ]; then + elif [ "$ARCH" = "aarch64" ]; then ARCH="arm64" else print_color $RED "Unsupported architecture: $ARCH" @@ -196,7 +198,7 @@ setup_poktrolld() { fi # Extract the version from genesis.json using jq - POKTROLLD_VERSION=$(jq -r '.app_version' < "$GENESIS_FILE") + POKTROLLD_VERSION=$(jq -r '.app_version' <"$GENESIS_FILE") print_color $YELLOW "Detected version from genesis: $POKTROLLD_VERSION" if [ -z "$POKTROLLD_VERSION" ]; then @@ -204,12 +206,15 @@ setup_poktrolld() { exit 1 fi + # TODO_TECHDEBT(@okdas): Conslidate this business logic with what we have + # in `user_guide/install.md` to avoid duplication and have consistency. + # Construct the release URL with proper version format RELEASE_URL="https://github.com/pokt-network/poktroll/releases/download/v${POKTROLLD_VERSION}/poktroll_linux_${ARCH}.tar.gz" print_color $YELLOW "Attempting to download from: $RELEASE_URL" # Download and extract directly as the POKTROLL_USER - sudo -u "$POKTROLL_USER" bash << EOF + sudo -u "$POKTROLL_USER" bash < /etc/systemd/system/cosmovisor.service << EOF + cat >/etc/systemd/system/cosmovisor.service < /dev/null; then + if command -v ufw &>/dev/null; then print_color $YELLOW "ufw is installed." - + # Check if rule already exists if ufw status | grep -q "26656"; then print_color $YELLOW "Port 26656 is already allowed in ufw rules." return fi - + read -p "Do you want to open port 26656 for p2p communication? (Y/n): " open_port if [[ $open_port =~ ^[Yy] ]]; then ufw allow 26656 @@ -347,4 +352,4 @@ main() { print_color $YELLOW "View logs with: sudo journalctl -u cosmovisor.service -f" } -main \ No newline at end of file +main From c2a22ac86844d5cc96ac20b6b4831adfb8281bcb Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 3 Dec 2024 19:25:09 -0800 Subject: [PATCH 16/25] rm supplier docs --- .../operate/quickstart/supplier_cheatsheet.md | 163 ------------------ 1 file changed, 163 deletions(-) delete mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md deleted file mode 100644 index d04903da7..000000000 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -sidebar_position: 6 -title: Supplier (RelayMiner) Cheat Sheet ---- - -## Supplier Cheat Sheet - -- [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. - -:::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 -``` From f2ac3fc1f0320dd1111f073f10df4e8566fa3588 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 3 Dec 2024 19:25:34 -0800 Subject: [PATCH 17/25] add supplier docs --- .../operate/quickstart/supplier_cheatsheet.md | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 docusaurus/docs/operate/quickstart/supplier_cheatsheet.md diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md new file mode 100644 index 000000000..d04903da7 --- /dev/null +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -0,0 +1,163 @@ +--- +sidebar_position: 6 +title: Supplier (RelayMiner) Cheat Sheet +--- + +## Supplier Cheat Sheet + +- [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. + +:::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 +``` From 46fea4d37374d78d6f7f4c7ffdd2ea6a9390fb4b Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 12 Dec 2024 16:06:12 -0800 Subject: [PATCH 18/25] Updated the supplier cheatsheet --- .../operate/quickstart/gateway_cheatsheet.md | 8 +- .../operate/quickstart/supplier_cheatsheet.md | 254 ++++++++++++------ 2 files changed, 185 insertions(+), 77 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md index 9ab3601fe..d6ca99d46 100644 --- a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md @@ -33,7 +33,9 @@ TODO_TECHDEBT(@olshansky): Adapt the instructions to be macOS friendly. - [Check the `PATH Gateway` is serving relays](#check-the-path-gateway-is-serving-relays) :::note + For detailed instructions, troubleshooting, and observability setup, see the [Gateway Walkthrough](./../run_a_node/gateway_walkthrough.md). + ::: ## Pre-Requisites @@ -66,7 +68,9 @@ poktrolld keys add gateway :::tip You can set the `--keyring-backend` flag to `test` to avoid entering the password -each time. Learn more about [cosmos keyring backends here](https://docs.cosmos.network/v0.46/run-node/keyring.html). +each time. + +Learn more about [cosmos keyring backends here](https://docs.cosmos.network/v0.46/run-node/keyring.html). ::: @@ -116,7 +120,9 @@ poktrolld query bank balances $APP_ADDR $NODE_FLAGS ``` :::tip + You can find all the explorers, faucets and tools at the [tools page](../../explore/tools.md). + ::: ### Stake the `Gateway` diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index d04903da7..c404ae302 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -5,18 +5,46 @@ title: Supplier (RelayMiner) Cheat Sheet ## Supplier Cheat Sheet -- [Context](#context) +This guide provides quick reference commands for setting up a **Supplier** and +running a **RelayMiner** on Pocket Network. + +:::warning + +These instructions are intended to run on a Linux machine. + +TODO_TECHDEBT(@olshansky): Adapt the instructions to be macOS friendly. + +::: + - [Pre-Requisites](#pre-requisites) -- [Suppliers](#suppliers) + - [Context](#context) +- [Account Setup](#account-setup) + - [Create and fund the `Supplier` account](#create-and-fund-the-supplier-account) + - [Prepare your environment](#prepare-your-environment) +- [Supplier Configuration](#supplier-configuration) + - [Fund the Supplier account](#fund-the-supplier-account) + - [Stake the Supplier](#stake-the-supplier) +- [RelayMiner Configuration](#relayminer-configuration) + - [Configure the RelayMiner](#configure-the-relayminer) + - [Start the RelayMiner](#start-the-relayminer) + - [Secure vs Non-Secure `query_node_grpc_url`](#secure-vs-non-secure-query_node_grpc_url) +- [Supplier FAQ](#supplier-faq) + - [What Supplier transactions are available?](#what-supplier-transactions-are-available) + - [What Supplier queries are available?](#what-supplier-queries-are-available) - [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) + +:::note + +For detailed instructions, troubleshooting, and observability setup, 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 one](./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. ### Context @@ -27,137 +55,211 @@ This document is a cheat sheet to get you quickly started with two things: By the end of it, you should be able to serve Relays onchain. +## Account Setup + +### Create and fund the `Supplier` account + +Create a new key pair for the `Supplier` + +```bash +poktrolld keys add supplier + +# Optionally, to avoid entering the password each time: +# poktrolld keys add supplier --keyring-backend test +``` + :::tip -It is intended to be a < 10 minute quick copy-pasta. +You can set the `--keyring-backend` flag to `test` to avoid entering the password +each time. -If you're interested in spending hours reading and understanding how things work, -please see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md) +Learn more about [cosmos keyring backends here](https://docs.cosmos.network/v0.46/run-node/keyring.html). ::: -### Pre-Requisites +### Prepare your environment -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. +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: -### Suppliers +```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 SUPPLIER_ADDR=$(poktrolld keys show supplier -a) -#### How do I query for all existing onchain Suppliers? +# Optionally, to avoid entering the password each time: +# export SUPPLIER_ADDR=$(poktrolld keys show supplier -a --keyring-backend test +``` -Then, you can query for all services like so: +:::tip + +You can put the above in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to +your `~/.profile` file for a cleaner organization. + +::: + +## Supplier Configuration + +### Fund the Supplier account + +Run the following command to get the `Supplier`: ```bash -poktrolld query supplier list-supplier --node https://shannon-testnet-grove-rpc.beta.poktroll.com --output json | jq +echo "Supplier address: $SUPPLIER_ADDR" ``` -#### How do I stake an onchain Supplier? +Then use the [Shannon Beta TestNet faucet](https://faucet.beta.testnet.pokt.network/) to fund the account. + +Afterwards, you can query the balance using the following command: + +```bash +poktrolld query bank balances $SUPPLIER_ADDR $NODE_FLAGS +``` :::tip -For an in-depth look at how to stake a supplier, see the [Supplier configuration docs](./../configs/supplier_staking_config.md). +You can find all the explorers, faucets and tools at the [tools page](../../explore/tools.md). ::: -The following is a very quick and simple way to get you started by staking for +### Stake the Supplier + +:::info + +For an in-depth look at how to stake a supplier, see the [Supplier configuration docs](./../configs/supplier_staking_config.md). + +The example below 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 +::: + +Retrieve your external IP address: + +```bash +EXTERNAL_IP=$(curl -4 ifconfig.me/ip) +``` + +Choose a port that'll be publicly accessible from the internet (e.g. `8545`) + +```bash +sudo ufw allow 8545/tcp +``` + +Create a Supplier stake configuration file: + +```bash +cat < /tmp/stake_supplier_config.yaml +owner_address: $SUPPLIER_ADDR +operator_address: $SUPPLIER_ADDR stake_amount: 1000069upokt default_rev_share_percent: - pokt1v6ap5mmaaldw35vrhtmwm6uxr9dn3jz8zj9cmk: 100 + $SUPPLIER_ADDR: 100 services: - service_id: "morse" endpoints: - - publicly_exposed_url: https://pocket-rpc.liquify.com + - publicly_exposed_url: http://$EXTERNAL_IP:8545 rpc_type: JSON_RPC +EOF ``` +And run the following command to stake the `Supplier`: + +```bash +poktrolld tx supplier stake-supplier --config /tmp/stake_supplier_config.yaml --from=$SUPPLIER_ADDR $TX_PARAM_FLAGS $NODE_FLAGS + +# Optionally, to avoid entering the password each time: +# poktrolld tx supplier stake-supplier --config /tmp/stake_supplier_config.yaml --from=$SUPPLIER_ADDR $TX_PARAM_FLAGS $NODE_FLAGS --keyring-backend test ``` -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 + +After about a minute, you can check the `Supplier`'s status like so: + +```bash +poktrolld query supplier show-supplier $SUPPLIER_ADDR $NODE_FLAGS ``` -Here is an example of the output on Beta TestNet as of writing this document: +## RelayMiner Configuration -```json -default_signing_key_names: [user_key_ste8bz] -smt_store_path: /tmp/poktroll/smt -metrics: - enabled: true - addr: :9091 +### Configure the RelayMiner + +```bash +cat < /tmp/relayminer_config.yaml +default_signing_key_names: + - supplier +smt_store_path: /home/pocket/.poktroll/smt 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 + query_node_grpc_url: https://shannon-testnet-grove-grpc.beta.poktroll.com:443 tx_node_rpc_url: https://shannon-testnet-grove-rpc.beta.poktroll.com suppliers: - - service_id: svc_8ymf38 - listen_url: http://localhost:8500 + - service_id: "morse" service_config: - backend_url: http://localhost:8547 + backend_url: "https://pocket-rpc.liquify.com" publicly_exposed_endpoints: - - localhost -pprof: + - $EXTERNAL_IP + listen_url: http://0.0.0.0:8545 +metrics: enabled: false - addr: localhost:6060 -ping: + addr: :9090 +pprof: enabled: false - addr: localhost:8082 + addr: :6060 +EOF ``` -#### 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: +### Start the RelayMiner ```bash -poktrolld tx service add-service ${SERVICE_ID} "${SERVICE_NAME_OR_DESCRIPTION}" ${COMPUTE_UNITS_PER_RELAY} --from ${SERVICE_OWNER} +poktrolld \ + relayminer \ + --grpc-insecure=false \ + --log_level=debug \ + --config=/tmp/relayminer_config.yaml \ + # --keyring-backend=test ``` -Here is a concrete copy-pasta assuming you have created and funded a new account called `$USER`: +### Secure vs Non-Secure `query_node_grpc_url` -```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 -``` +In `/tmp/relayminer_config.yaml`, you'll see that we specify an endpoint with TLS +for `query_node_grpc_url`. -Optionally, you can add some more flags to be ultra-verbose about your local environment: +If `grpc-insecure=true` then it **MUST** be an HTTP port, no TLS. -```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 -``` +The Grove team exposed one such endpoint on one of our validators for Beta Testnet at `http://149.28.34.68:9090`. +It can be validated with `grpcurl -plaintext 149.28.34.68:9090`; note that the `-plaintext` flag meaning no TLS encryption. + +If `grpc-insecure=false`, then it **MUST** be an HTTPS port, with TLS. + +The Grove team exposed one such endpoint on one of our validators for Beta Testnet at `https://shannon-testnet-grove-grpc.beta.poktroll.com:443`. +It can be validated with `grpcurl https://shannon-testnet-grove-grpc.beta.poktroll.com:443`; note no `-plaintext` flag meaning no TLS encryption. + +:::tip -### How do I learn more about interacting with Suppliers? +You can replace both `http` and `https` with `tcp` and it should work the same. -#### Supplier Transactions +::: + +## Supplier FAQ + +### What Supplier transactions are available? ```bash poktrolld tx supplier -h ``` -#### Supplier Queries +### What Supplier queries are available? ```bash poktrolld query supplier -h ``` -### RelayMiners +### How do I query for all existing onchain Suppliers? -#### Retrieve the source code +Then, you can query for all services like so: ```bash -mkdir ~/workspace && cd ~/workspace -git clone https://github.com/pokt-network/poktroll-docker-compose-example.git -cd poktroll-docker-compose-example +poktrolld query supplier list-supplier --node https://shannon-testnet-grove-rpc.beta.poktroll.com --output json | jq ``` From dcafa024f6918677d196ec8e17eb6741cea187f0 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 15:59:59 -0800 Subject: [PATCH 19/25] Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md Co-authored-by: Dima K. --- docusaurus/docs/operate/quickstart/supplier_cheatsheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index c404ae302..978370949 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -234,7 +234,7 @@ It can be validated with `grpcurl -plaintext 149.28.34.68:9090`; note that the ` If `grpc-insecure=false`, then it **MUST** be an HTTPS port, with TLS. The Grove team exposed one such endpoint on one of our validators for Beta Testnet at `https://shannon-testnet-grove-grpc.beta.poktroll.com:443`. -It can be validated with `grpcurl https://shannon-testnet-grove-grpc.beta.poktroll.com:443`; note no `-plaintext` flag meaning no TLS encryption. +It can be validated with `grpcurl shannon-testnet-grove-grpc.beta.poktroll.com:443 list`; note no `-plaintext` flag meaning no TLS encryption. :::tip From c9e0ff3d287dbbd2a42699a62f1a3e7ae3a421e3 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:03:25 -0800 Subject: [PATCH 20/25] Apply some suggestions from code review Co-authored-by: Bryan White Co-authored-by: Dima K. --- .../operate/quickstart/supplier_cheatsheet.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 978370949..155d08cdf 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -96,8 +96,8 @@ export SUPPLIER_ADDR=$(poktrolld keys show supplier -a) :::tip -You can put the above in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to -your `~/.profile` file for a cleaner organization. +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. ::: @@ -111,7 +111,8 @@ Run the following command to get the `Supplier`: echo "Supplier address: $SUPPLIER_ADDR" ``` -Then use the [Shannon Beta TestNet faucet](https://faucet.beta.testnet.pokt.network/) to fund the account. +Then use the [Shannon Beta TestNet faucet](https://faucet.beta.testnet.pokt.network/) to fund the (supplier owner address) account. +See [Non-Custodial Staking](https://dev.poktroll.com/operate/configs/supplier_staking_config#non-custodial-staking) for more information about supplier owner vs operator and non-custodial staking. Afterwards, you can query the balance using the following command: @@ -152,7 +153,7 @@ sudo ufw allow 8545/tcp Create a Supplier stake configuration file: ```bash -cat < /tmp/stake_supplier_config.yaml +cat <<πŸš€ > /tmp/stake_supplier_config.yaml owner_address: $SUPPLIER_ADDR operator_address: $SUPPLIER_ADDR stake_amount: 1000069upokt @@ -163,7 +164,7 @@ services: endpoints: - publicly_exposed_url: http://$EXTERNAL_IP:8545 rpc_type: JSON_RPC -EOF +πŸš€ ``` And run the following command to stake the `Supplier`: @@ -229,7 +230,7 @@ for `query_node_grpc_url`. If `grpc-insecure=true` then it **MUST** be an HTTP port, no TLS. The Grove team exposed one such endpoint on one of our validators for Beta Testnet at `http://149.28.34.68:9090`. -It can be validated with `grpcurl -plaintext 149.28.34.68:9090`; note that the `-plaintext` flag meaning no TLS encryption. +It can be validated with `grpcurl -plaintext 149.28.34.68:9090 list`; note that the `-plaintext` flag meaning no TLS encryption. If `grpc-insecure=false`, then it **MUST** be an HTTPS port, with TLS. @@ -244,7 +245,7 @@ You can replace both `http` and `https` with `tcp` and it should work the same. ## Supplier FAQ -### What Supplier transactions are available? +### What Supplier operations are available? ```bash poktrolld tx supplier -h From 2090fad92556403b2563126651083e4f19f2e1c4 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:03:43 -0800 Subject: [PATCH 21/25] Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md Co-authored-by: Bryan White --- docusaurus/docs/operate/quickstart/supplier_cheatsheet.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 155d08cdf..b3d378d3d 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -224,8 +224,8 @@ poktrolld \ ### Secure vs Non-Secure `query_node_grpc_url` -In `/tmp/relayminer_config.yaml`, you'll see that we specify an endpoint with TLS -for `query_node_grpc_url`. +In `/tmp/relayminer_config.yaml`, you'll see that we specify an endpoint for +`query_node_grpc_url` which is TLS terminated. If `grpc-insecure=true` then it **MUST** be an HTTP port, no TLS. From 3c6148de5d5210db1d818485dace8ef0445f16a1 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:04:20 -0800 Subject: [PATCH 22/25] Apply suggestions from code review Co-authored-by: Bryan White --- docusaurus/docs/operate/quickstart/supplier_cheatsheet.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index b3d378d3d..44f15f5ae 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -187,7 +187,7 @@ poktrolld query supplier show-supplier $SUPPLIER_ADDR $NODE_FLAGS ### Configure the RelayMiner ```bash -cat < /tmp/relayminer_config.yaml +cat <<πŸš€ > /tmp/relayminer_config.yaml default_signing_key_names: - supplier smt_store_path: /home/pocket/.poktroll/smt @@ -208,7 +208,7 @@ metrics: pprof: enabled: false addr: :6060 -EOF +πŸš€ ``` ### Start the RelayMiner From d0a49255e82bee53a562c989ecfa499595acc4e3 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:04:54 -0800 Subject: [PATCH 23/25] Update docusaurus/docs/operate/quickstart/supplier_cheatsheet.md Co-authored-by: Bryan White --- docusaurus/docs/operate/quickstart/supplier_cheatsheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 44f15f5ae..09b3accdc 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -53,7 +53,7 @@ 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. +By the end of it, you should be able to serve Relays off-chain, and claim on-chain rewards. ## Account Setup From a88ed62e059bc5566b3c99bd00cb89e330b19da1 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:38:58 -0800 Subject: [PATCH 24/25] Followed up on some comments --- .../operate/quickstart/gateway_cheatsheet.md | 7 +- .../operate/quickstart/supplier_cheatsheet.md | 64 ++++++++++++++----- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md index d6ca99d46..cb476e660 100644 --- a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md @@ -12,7 +12,8 @@ on Pocket Network. These instructions are intended to run on a Linux machine. -TODO_TECHDEBT(@olshansky): Adapt the instructions to be macOS friendly. +TODO_TECHDEBT(@olshansky): Adapt instructions to be macOS friendly in order to +streamline development and reduce friction for any new potential contributor. ::: @@ -82,8 +83,8 @@ 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 POCKET_NODE="https://shannon-testnet-grove-rpc.beta.poktroll.com" +export NODE_FLAGS="--node=$POCKET_NODE" export TX_PARAM_FLAGS="--gas=auto --gas-prices=1upokt --gas-adjustment=1.5 --chain-id=pocket-beta --yes" export GATEWAY_ADDR=$(poktrolld keys show gateway -a) export APP_ADDR=$(poktrolld keys show application -a) diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index 09b3accdc..a8684c049 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -8,11 +8,14 @@ title: Supplier (RelayMiner) Cheat Sheet This guide provides quick reference commands for setting up a **Supplier** and running a **RelayMiner** on Pocket Network. -:::warning +For detailed instructions, troubleshooting, and observability setup, see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md). + +:::note These instructions are intended to run on a Linux machine. -TODO_TECHDEBT(@olshansky): Adapt the instructions to be macOS friendly. +TODO_TECHDEBT(@olshansky): Adapt instructions to be macOS friendly in order to +streamline development and reduce friction for any new potential contributor. ::: @@ -29,16 +32,10 @@ TODO_TECHDEBT(@olshansky): Adapt the instructions to be macOS friendly. - [Start the RelayMiner](#start-the-relayminer) - [Secure vs Non-Secure `query_node_grpc_url`](#secure-vs-non-secure-query_node_grpc_url) - [Supplier FAQ](#supplier-faq) - - [What Supplier transactions are available?](#what-supplier-transactions-are-available) + - [What Supplier operations are available?](#what-supplier-operations-are-available) - [What Supplier queries are available?](#what-supplier-queries-are-available) - [How do I query for all existing onchain Suppliers?](#how-do-i-query-for-all-existing-onchain-suppliers) -:::note - -For detailed instructions, troubleshooting, and observability setup, see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md). - -::: - ## Pre-Requisites 1. Make sure to [install the `poktrolld` CLI](../user_guide/install.md). @@ -46,6 +43,17 @@ For detailed instructions, troubleshooting, and observability setup, see the [Su 3. You have either [staked a new `service` or found an existing one](./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. +:::warning + +You can append `--keyring-backend test` to all the `poktrolld` commands throughout +this guide to avoid entering the password each time. + +This is not recommended but provided for convenience for NON PRODUCTION USE ONLY. + +Use at your own risk. + +::: + ### Context This document is a cheat sheet to get you quickly started with two things: @@ -224,22 +232,44 @@ poktrolld \ ### Secure vs Non-Secure `query_node_grpc_url` -In `/tmp/relayminer_config.yaml`, you'll see that we specify an endpoint for -`query_node_grpc_url` which is TLS terminated. +In `/tmp/relayminer_config.yaml`, you'll see that we specify an endpoint +for `query_node_grpc_url` which is TLS terminated. + +If `grpc-insecure=true` then it **MUST** be an HTTP port, no TLS. Once you have +an endpoint exposed, it can be validated like so: + +```bash +grpcurl -plaintext : list +``` + + If `grpc-insecure=false`, then it **MUST** be an HTTPS port, with TLS. -The Grove team exposed one such endpoint on one of our validators for Beta Testnet at `https://shannon-testnet-grove-grpc.beta.poktroll.com:443`. -It can be validated with `grpcurl shannon-testnet-grove-grpc.beta.poktroll.com:443 list`; note no `-plaintext` flag meaning no TLS encryption. +The Grove team exposed one such endpoint on one of our validators for Beta Testnet +at `https://shannon-testnet-grove-grpc.beta.poktroll.com:443`. + +It can be validated with: + +```bash +grpcurl shannon-testnet-grove-grpc.beta.poktroll.com:443 list +``` + +Note that no `-plaintext` flag is required when an endpoint is TLS terminated and +must be omitted if it is not. :::tip -You can replace both `http` and `https` with `tcp` and it should work the same. +You can replace both `http` and `https` with `tcp` and it should work the same way. ::: From 19e6f9b6a45567e1b6de6b4abb71e9bdeeba4c57 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 16 Dec 2024 16:56:33 -0800 Subject: [PATCH 25/25] Follow up on all comments --- .../operate/quickstart/gateway_cheatsheet.md | 71 +++++++------------ .../operate/quickstart/supplier_cheatsheet.md | 37 +++------- 2 files changed, 35 insertions(+), 73 deletions(-) diff --git a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md index cb476e660..741966d13 100644 --- a/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/gateway_cheatsheet.md @@ -3,12 +3,15 @@ sidebar_position: 7 title: Gateway Cheat Sheet --- -# Gateway Cheat Sheet +## Gateway Cheat Sheet -This guide provides quick reference commands for setting up and running a Gateway +This guide provides quick reference commands for setting up and running a **Gateway** on Pocket Network. -:::warning +For detailed instructions, troubleshooting, and observability setup, see the +[Gateway Walkthrough](./../run_a_node/gateway_walkthrough.md). + +:::note These instructions are intended to run on a Linux machine. @@ -33,17 +36,22 @@ streamline development and reduce friction for any new potential contributor. - [\[TODO\] Run the `PATH` Gateway using Docker](#todo-run-the-path-gateway-using-docker) - [Check the `PATH Gateway` is serving relays](#check-the-path-gateway-is-serving-relays) -:::note - -For detailed instructions, troubleshooting, and observability setup, see the [Gateway Walkthrough](./../run_a_node/gateway_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). +:::warning + +You can append `--keyring-backend test` to all the `poktrolld` commands throughout +this guide to avoid entering the password each time. + +This is not recommended but provided for convenience for NON PRODUCTION USE ONLY. + +⚠️ Use at your own risk. ⚠️ + +::: + ## Account Setup ### Create and fund the `Gateway` and `Application` accounts @@ -52,29 +60,14 @@ Create a new key pair for the delegating `Application`: ```bash poktrolld keys add application - -# Optionally, to avoid entering the password each time: -# poktrolld keys add application --keyring-backend test ``` Create a new key pair for the `Gateway`: ```bash poktrolld keys add gateway - -# Optionally, to avoid entering the password each time: -# poktrolld keys add gateway --keyring-backend test ``` -:::tip - -You can set the `--keyring-backend` flag to `test` to avoid entering the password -each time. - -Learn more about [cosmos keyring backends here](https://docs.cosmos.network/v0.46/run-node/keyring.html). - -::: - ### Prepare your environment For convenience, we're setting several environment variables to streamline @@ -88,16 +81,13 @@ export NODE_FLAGS="--node=$POCKET_NODE" export TX_PARAM_FLAGS="--gas=auto --gas-prices=1upokt --gas-adjustment=1.5 --chain-id=pocket-beta --yes" export GATEWAY_ADDR=$(poktrolld keys show gateway -a) export APP_ADDR=$(poktrolld keys show application -a) - -# Optionally, to avoid entering the password each time: -# export GATEWAY_ADDR=$(poktrolld keys show gateway -a --keyring-backend test) -# export APP_ADDR=$(poktrolld keys show application -a --keyring-backend test) ``` :::tip -You can put the above in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to -your `~/.profile` file for a cleaner organization. +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. ::: @@ -131,18 +121,15 @@ You can find all the explorers, faucets and tools at the [tools page](../../expl Create a Gateway stake configuration file: ```bash -cat < /tmp/stake_gateway_config.yaml +cat <<πŸš€ > /tmp/stake_gateway_config.yaml stake_amount: 1000000upokt -EOF +πŸš€ ``` And run the following command to stake the `Gateway`: ```bash poktrolld tx gateway stake-gateway --config=/tmp/stake_gateway_config.yaml --from=$GATEWAY_ADDR $TX_PARAM_FLAGS $NODE_FLAGS - -# Optionally, to avoid entering the password each time: -# poktrolld tx gateway stake-gateway --config=/tmp/stake_gateway_config.yaml --from=$GATEWAY_ADDR $TX_PARAM_FLAGS $NODE_FLAGS --keyring-backend test ``` After about a minute, you can check the `Gateway`'s status like so: @@ -156,20 +143,17 @@ poktrolld query gateway show-gateway $GATEWAY_ADDR $NODE_FLAGS Create an Application stake configuration file: ```bash -cat < /tmp/stake_app_config.yaml +cat <<πŸš€ > /tmp/stake_app_config.yaml stake_amount: 100000000upokt service_ids: - "F00C" -EOF +πŸš€ ``` And run the following command to stake the `Application`: ```bash poktrolld tx application stake-application --config=/tmp/stake_app_config.yaml --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS - -# Optionally, to avoid entering the password each time: -# poktrolld tx application stake-application --config=/tmp/stake_app_config.yaml --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS --keyring-backend test ``` After about a minute, you can check the `Application`'s status like so: @@ -182,9 +166,6 @@ poktrolld query application show-application $APP_ADDR $NODE_FLAGS ```bash poktrolld tx application delegate-to-gateway $GATEWAY_ADDR --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS - -# Optionally, to avoid entering the password each time: -# poktrolld tx application delegate-to-gateway $GATEWAY_ADDR --from=$APP_ADDR $TX_PARAM_FLAGS $NODE_FLAGS --keyring-backend test ``` After about a minute, you can check the `Application`'s status like so: @@ -240,10 +221,6 @@ sed -i "s|host_port: ".*"|host_port: shannon-testnet-grove-grpc.beta.poktroll.co sed -i "s|gateway_address: .*|gateway_address: $GATEWAY_ADDR|" config/.config.yaml sed -i "s|gateway_private_key_hex: .*|gateway_private_key_hex: $(export_priv_key_hex gateway)|" config/.config.yaml sed -i '/owned_apps_private_keys_hex:/!b;n;c\ - '"$(export_priv_key_hex application)" config/.config.yaml - -# If you're using the test keyring-backend: -# sed -i "s|gateway_private_key_hex: .*|gateway_private_key_hex: $(export_priv_key_hex gateway)|" config/.config.yaml -# sed -i '/owned_apps_private_keys_hex:/!b;n;c\ - '"$(export_priv_key_hex application)" config/.config.yaml ``` When you're done, run `cat config/.config.yaml` to view the updated config file. diff --git a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md index a8684c049..0b5f7115b 100644 --- a/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md +++ b/docusaurus/docs/operate/quickstart/supplier_cheatsheet.md @@ -8,7 +8,8 @@ title: Supplier (RelayMiner) Cheat Sheet This guide provides quick reference commands for setting up a **Supplier** and running a **RelayMiner** on Pocket Network. -For detailed instructions, troubleshooting, and observability setup, see the [Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md). +For detailed instructions, troubleshooting, and observability setup, see the +[Supplier Walkthrough](./../run_a_node/supplier_walkthrough.md). :::note @@ -50,7 +51,7 @@ this guide to avoid entering the password each time. This is not recommended but provided for convenience for NON PRODUCTION USE ONLY. -Use at your own risk. +⚠️ Use at your own risk. ⚠️ ::: @@ -71,20 +72,8 @@ Create a new key pair for the `Supplier` ```bash poktrolld keys add supplier - -# Optionally, to avoid entering the password each time: -# poktrolld keys add supplier --keyring-backend test ``` -:::tip - -You can set the `--keyring-backend` flag to `test` to avoid entering the password -each time. - -Learn more about [cosmos keyring backends here](https://docs.cosmos.network/v0.46/run-node/keyring.html). - -::: - ### Prepare your environment For convenience, we're setting several environment variables to streamline @@ -97,14 +86,12 @@ 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 SUPPLIER_ADDR=$(poktrolld keys show supplier -a) - -# Optionally, to avoid entering the password each time: -# export SUPPLIER_ADDR=$(poktrolld keys show supplier -a --keyring-backend test ``` :::tip -As an alternative to appending directly to `~/.bashrc`, you can put the above in a special `~/.poktrollrc` and add `source ~/.poktrollrc` to +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. ::: @@ -140,9 +127,8 @@ You can find all the explorers, faucets and tools at the [tools page](../../expl For an in-depth look at how to stake a supplier, see the [Supplier configuration docs](./../configs/supplier_staking_config.md). -The example below 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/). +These instructions help you stake a supplier for a specific service (POKT Morse) +using a pre-configured RPC endpoint ([Liquify](https://liquify.com/) public RPC endpoint). ::: @@ -153,6 +139,9 @@ EXTERNAL_IP=$(curl -4 ifconfig.me/ip) ``` Choose a port that'll be publicly accessible from the internet (e.g. `8545`) +and expose it. + +You can use the following command for OSs that use `ufw` (learn more [here](https://wiki.archlinux.org/title/Uncomplicated_Firewall)): ```bash sudo ufw allow 8545/tcp @@ -179,9 +168,6 @@ And run the following command to stake the `Supplier`: ```bash poktrolld tx supplier stake-supplier --config /tmp/stake_supplier_config.yaml --from=$SUPPLIER_ADDR $TX_PARAM_FLAGS $NODE_FLAGS - -# Optionally, to avoid entering the password each time: -# poktrolld tx supplier stake-supplier --config /tmp/stake_supplier_config.yaml --from=$SUPPLIER_ADDR $TX_PARAM_FLAGS $NODE_FLAGS --keyring-backend test ``` After about a minute, you can check the `Supplier`'s status like so: @@ -226,8 +212,7 @@ poktrolld \ relayminer \ --grpc-insecure=false \ --log_level=debug \ - --config=/tmp/relayminer_config.yaml \ - # --keyring-backend=test + --config=/tmp/relayminer_config.yaml ``` ### Secure vs Non-Secure `query_node_grpc_url`