From 907833b31209819ca7d4703e2ae1f40f9a5fe68e Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Wed, 28 Aug 2024 14:49:43 -0700 Subject: [PATCH 01/18] Cosmovisor docs --- .../quickstart/docker_compose_walkthrough.md | 4 +- .../docs/operate/run_a_node/appgate_server.md | 5 ++ .../run_a_node/full_node_cosmovisor.md | 87 +++++++++++++++++++ .../operate/run_a_node/full_node_docker.md | 6 ++ .../run_a_node/hardware_requirements.md | 68 +++++++++++++++ .../docs/operate/run_a_node/relay_miner.md | 5 ++ 6 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 docusaurus/docs/operate/run_a_node/hardware_requirements.md diff --git a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md index 31c596f3b..9040b01f9 100644 --- a/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md +++ b/docusaurus/docs/operate/quickstart/docker_compose_walkthrough.md @@ -510,7 +510,7 @@ The endpoint you want to send request to is: `http://your_node:appgate_server_po represented by `0021`: ```bash -curl http://$NODE_HOSTNAME:85/00\ +curl http://$NODE_HOSTNAME:85/0021 \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' @@ -658,7 +658,7 @@ To ensure you get a response, you may need to run the request a few times: ```bash for i in {1..10}; do - curl http://$NODE_HOSTNAME:85/00\ + curl http://$NODE_HOSTNAME:85/0021 \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' \ diff --git a/docusaurus/docs/operate/run_a_node/appgate_server.md b/docusaurus/docs/operate/run_a_node/appgate_server.md index 58f19336a..84a92d9df 100644 --- a/docusaurus/docs/operate/run_a_node/appgate_server.md +++ b/docusaurus/docs/operate/run_a_node/appgate_server.md @@ -7,6 +7,7 @@ sidebar_position: 3 - [What is AppGate Server?](#what-is-appgate-server) - [AppGate Server Operation Requirements](#appgate-server-operation-requirements) +- [Hardware requirements](#hardware-requirements) - [Docker Compose Example](#docker-compose-example) - [Kubernetes Example](#kubernetes-example) @@ -29,6 +30,10 @@ It is crucial to deploy a [Full Node](full_node_docker.md) prior to setting up a This ensures the necessary infrastructure for blockchain communication is in place. ::: +## Hardware requirements + +Please see the [Hardware Requirements](./hardware_requirements.md#appgate-server--gateway) page. + ## Docker Compose Example Please refer to the `Deploying an AppGate Server` section in [poktroll-docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example#deploying-an-appgate-server) diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index b74dbd40b..b1e8f6202 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -7,6 +7,7 @@ sidebar_position: 1 - [What is a Full Node](#what-is-a-full-node) - [What is Cosmovisor](#what-is-cosmovisor) +- [Download and set up Cosmovisor](#download-and-set-up-cosmovisor) - [Setting up Cosmovisor](#setting-up-cosmovisor) - [Upgrading with Cosmovisor](#upgrading-with-cosmovisor) @@ -32,6 +33,92 @@ reduce maintenance overhead. TODO(@okdas): finish this tutorial as a part of [#526](https://github.com/pokt-network/poktroll/issues/526). ::: +## Download and set up Cosmovisor + +0. Prerequisites + +If you're logged in as `root` user, let's create a separate user: + +```bash +# ONLY NEEDED IF YOU LOGGED IN UNDER ROOT + +# Add user +useradd -m -s /bin/bash poktroll-cosmovisor + +# Set +passwd poktroll-cosmovisor + +# Add the new user to the sudo group +usermod -aG sudo poktroll-cosmovisor + +# Switch to the new user +su - poktroll-cosmovisor +``` + +1. Download Cosmovisor: + +```bash +# Determine architecture and download the appropriate Cosmovisor binary +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then + ARCH="amd64" +elif [ "$ARCH" = "aarch64" ]; then + ARCH="arm64" +fi +curl -LO "https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.6.0/cosmovisor-v1.6.0-linux-${ARCH}.tar.gz" + +# Create $HOME/bin if it doesn't exist and extract the binary +mkdir -p $HOME/bin +tar -zxvf cosmovisor-v1.6.0-linux-${ARCH}.tar.gz -C $HOME/bin cosmovisor + +# Ensure $HOME/bin is in the PATH +if ! grep -q 'export PATH=$HOME/bin:$PATH' $HOME/.profile; then + echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.profile +fi + +# Source the updated .profile to apply changes to the current session +source $HOME/.profile + +# Clean up +rm cosmovisor-v1.6.0-linux-${ARCH}.tar.gz +``` + +2. Set up Cosmovisor: + +```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=true" >> ~/.profile +source ~/.profile +``` + +3. Set up systemd unit + + +```bash +echo "[Unit] +Description=Cosmovisor daemon for poktrolld +After=network-online.target + +[Service] +Environment=\"DAEMON_NAME=${DAEMON_NAME}\" +Environment=\"DAEMON_HOME=${DAEMON_HOME}\" +Environment=\"DAEMON_RESTART_AFTER_UPGRADE=${DAEMON_RESTART_AFTER_UPGRADE}\" +Environment=\"DAEMON_ALLOW_DOWNLOAD_BINARIES=${DAEMON_ALLOW_DOWNLOAD_BINARIES}\" +Environment=\"UNSAFE_SKIP_BACKUP=${UNSAFE_SKIP_BACKUP}\" +ExecStart=${HOME}/go/bin/cosmovisor start --home=${DAEMON_HOME} +Restart=always +RestartSec=3 +LimitNOFILE=infinity +LimitNPROC=infinity + +[Install] +WantedBy=default.target +" +``` + ## Setting up Cosmovisor [Content to be added] diff --git a/docusaurus/docs/operate/run_a_node/full_node_docker.md b/docusaurus/docs/operate/run_a_node/full_node_docker.md index 218ec4c83..0a009c494 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_docker.md +++ b/docusaurus/docs/operate/run_a_node/full_node_docker.md @@ -9,6 +9,7 @@ sidebar_position: 2 - [Roles \& Responsibilities](#roles--responsibilities) - [Types of Full Nodes](#types-of-full-nodes) - [Pocket Network Full Nodes](#pocket-network-full-nodes) +- [Hardware requirements](#hardware-requirements) - [Docker Compose Example](#docker-compose-example) - [Kubernetes Example](#kubernetes-example) @@ -19,6 +20,7 @@ In blockchain networks, a Full Node retains a complete copy of the ledger. You can visit the [Cosmos SDK documentation](https://docs.cosmos.network/main/user/run-node/run-node) for more information on Full Nodes. + ## Roles & Responsibilities It is usually responsible for: @@ -49,6 +51,10 @@ blockchain for full functionality. This guide outlines how to configure, deploy nad maintain Full Nodes. +## Hardware requirements + +Please see the [Hardware Requirements](./hardware_requirements.md#validator--full-node) page. + ## Docker Compose Example Please refer to the `Deploying a Full Node` section in [poktroll-docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example#deploying-a-full-node) diff --git a/docusaurus/docs/operate/run_a_node/hardware_requirements.md b/docusaurus/docs/operate/run_a_node/hardware_requirements.md new file mode 100644 index 000000000..0845ffb98 --- /dev/null +++ b/docusaurus/docs/operate/run_a_node/hardware_requirements.md @@ -0,0 +1,68 @@ +--- +title: Hardware Requirements +sidebar_position: 0 +--- + +# Hardware Requirements + +:::warning +We are continuously evaluating the hardware requirements as we work on the next version of Pocket Network. Recommendations may change as we approach the Shannon Mainnet release. +::: + +- [Validator / Full Node](#validator--full-node) +- [RelayMiner](#relayminer) +- [AppGate Server / Gateway](#appgate-server--gateway) +- [Additional Considerations](#additional-considerations) + + +## Validator / Full Node + +| Component | Minimum | Recommended | +| ----------- | ------- | ----------- | +| CPU Cores | 2 | 4 | +| RAM | 8GB | 16GB | +| SSD Storage | 50GB | 50GB | + +:::info +If the Full Node will serve as the RPC endpoint for Gateway and RelayMiners under high load, consider: +- Providing more resources +- Deploying multiple Full Nodes for continuous service +::: + + +## RelayMiner + +See the [RelayMiner](../../protocol/actors/appgate_server.md) documentation for more +information on what a RelayMiner is. + +| Component | Minimum | Recommended | +| ----------- | ------- | ----------- | +| CPU Cores | 1 | 4 | +| RAM | 1GB | 16GB | +| SSD Storage | 5GB | 5GB | + +:::info +Resource requirements for RelayMiner scale linearly with load: +- More suppliers and traffic = Higher resource consumption +- We strongly recommend continuous monitoring to ensure optimal performance +::: + + +## AppGate Server / Gateway + +See the [AppGate Server](../../protocol/actors/appgate_server.md) documentation for more +information on what an AppGate Server is. + +| Component | Minimum | Recommended | +| ----------- | ------- | ----------- | +| CPU Cores | 1 | 4 | +| RAM | 1GB | 16GB | +| SSD Storage | N/A | N/A | + +**Note**: This service is stateless and does not require SSD storage. + +## Additional Considerations + +1. **Scalability**: As your infrastructure grows, you may need to adjust resources accordingly. +2. **Monitoring**: Implement a robust monitoring system to track resource usage and performance. +3. **Redundancy**: For critical operations, consider setting up redundant systems to ensure high availability. diff --git a/docusaurus/docs/operate/run_a_node/relay_miner.md b/docusaurus/docs/operate/run_a_node/relay_miner.md index 1e80a7c38..fb7da85ae 100644 --- a/docusaurus/docs/operate/run_a_node/relay_miner.md +++ b/docusaurus/docs/operate/run_a_node/relay_miner.md @@ -7,6 +7,7 @@ sidebar_position: 4 - [What is a RelayMiner](#what-is-a-relayminer) - [RelayMiner Operation Requirements](#relayminer-operation-requirements) +- [Hardware requirements](#hardware-requirements) - [Docker Compose Example](#docker-compose-example) - [Kubernetes Example](#kubernetes-example) @@ -28,6 +29,10 @@ It is crucial to deploy a [Full Node](full_node_docker.md) prior to setting up a This ensures the necessary infrastructure for blockchain communication is in place. ::: +## Hardware requirements + +Please see the [Hardware Requirements](./hardware_requirements.md#relayminer) page. + ## Docker Compose Example Please refer to the `Deploying a RelayMiner` section in [poktroll-docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example#deploying-a-relay-miner) From a1d6c4d4fa1e08723d4fd131e69b8ee7c9cb21eb Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Thu, 29 Aug 2024 17:55:20 -0700 Subject: [PATCH 02/18] more docs updates & configs --- cmd/poktrolld/cmd/commands.go | 5 +- cmd/poktrolld/cmd/config.go | 25 +++ cmd/poktrolld/cmd/root.go | 6 +- .../run_a_node/full_node_cosmovisor.md | 139 +++++------- tools/installer/full-node.sh | 207 ++++++++++++++++++ x/tokenomics/types/tx.pb.go | 1 - 6 files changed, 292 insertions(+), 91 deletions(-) create mode 100644 tools/installer/full-node.sh diff --git a/cmd/poktrolld/cmd/commands.go b/cmd/poktrolld/cmd/commands.go index 1fe0422d3..f9a7ab3fe 100644 --- a/cmd/poktrolld/cmd/commands.go +++ b/cmd/poktrolld/cmd/commands.go @@ -88,7 +88,8 @@ func queryCommand() *cobra.Command { authcmd.QueryTxCmd(), server.QueryBlockResultsCmd(), ) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + // TODO_MAINNET: adjust chain ID for the mainnet (assuming it's going to change) + cmd.PersistentFlags().String(flags.FlagChainID, DefaultChainID, "The network chain ID") return cmd } @@ -114,7 +115,7 @@ func txCommand() *cobra.Command { authcmd.GetDecodeCommand(), authcmd.GetSimulateCmd(), ) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + cmd.PersistentFlags().String(flags.FlagChainID, DefaultChainID, "The network chain ID") return cmd } diff --git a/cmd/poktrolld/cmd/config.go b/cmd/poktrolld/cmd/config.go index 0041179d1..b3da73b69 100644 --- a/cmd/poktrolld/cmd/config.go +++ b/cmd/poktrolld/cmd/config.go @@ -2,6 +2,7 @@ package cmd import ( "sync" + "time" cmtcfg "github.com/cometbft/cometbft/config" serverconfig "github.com/cosmos/cosmos-sdk/server/config" @@ -43,6 +44,18 @@ func initCometBFTConfig() *cmtcfg.Config { // cfg.P2P.MaxNumInboundPeers = 100 // cfg.P2P.MaxNumOutboundPeers = 40 + // Set default values so `poktrolld init` creates configs with "blessed" values: + // TODO_MAINNET: discuss block times + cfg.Consensus.TimeoutPropose = 60 * time.Second + cfg.Consensus.TimeoutProposeDelta = 5 * time.Second + cfg.Consensus.TimeoutPrevote = 10 * time.Second + cfg.Consensus.TimeoutPrevoteDelta = 5 * time.Second + cfg.Consensus.TimeoutPrecommit = 10 * time.Second + cfg.Consensus.TimeoutPrecommitDelta = 5 * time.Second + cfg.Consensus.TimeoutCommit = 60 * time.Second + cfg.Instrumentation.Prometheus = true + cfg.LogLevel = "info" + return cfg } @@ -72,6 +85,18 @@ func initAppConfig() (string, interface{}) { // srvCfg.MinGasPrices = "0stake" // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default + // TODO_MAINNET: reconsider values, especially MinGasPrices and MaxTxs + // Set default values so `poktrolld init` creates configs with "blessed" values: + srvCfg.MinGasPrices = "0.000000001upokt" + srvCfg.Mempool.MaxTxs = 10000 + srvCfg.Telemetry.Enabled = true + srvCfg.Telemetry.PrometheusRetentionTime = 60 // in seconds + srvCfg.Telemetry.MetricsSink = "mem" + srvCfg.Pruning = "nothing" // archiving node by default + srvCfg.API.Enable = true + srvCfg.GRPC.Enable = true + srvCfg.GRPCWeb.Enable = true + customAppConfig := CustomAppConfig{ Config: *srvCfg, } diff --git a/cmd/poktrolld/cmd/root.go b/cmd/poktrolld/cmd/root.go index d335eecd1..a0cb39688 100644 --- a/cmd/poktrolld/cmd/root.go +++ b/cmd/poktrolld/cmd/root.go @@ -4,7 +4,6 @@ import ( "errors" "log" "os" - "strings" "cosmossdk.io/client/v2/autocli" clientv2keyring "cosmossdk.io/client/v2/autocli/keyring" @@ -31,6 +30,9 @@ import ( relayercmd "github.com/pokt-network/poktroll/pkg/relayer/cmd" ) +// TODO_MAINNET: adjust chain ID for the mainnet if it's going to change +const DefaultChainID = "poktroll" + // NewRootCmd creates a new root command for poktrolld. It is called once in the main function. func NewRootCmd() *cobra.Command { InitSDKConfig() @@ -118,7 +120,7 @@ func NewRootCmd() *cobra.Command { initRootCmd(rootCmd, clientCtx.TxConfig, clientCtx.InterfaceRegistry, clientCtx.Codec, moduleBasicManager) if err := overwriteFlagDefaults(rootCmd, map[string]string{ - flags.FlagChainID: strings.ReplaceAll(app.Name, "-", ""), + flags.FlagChainID: DefaultChainID, flags.FlagKeyringBackend: "test", }); err != nil { log.Fatal(err) diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index b1e8f6202..a4eedcb7f 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -3,126 +3,93 @@ title: Full Node - Cosmovisor sidebar_position: 1 --- -# Full Node - Cosmovisor - +## Table of Contents - [What is a Full Node](#what-is-a-full-node) - [What is Cosmovisor](#what-is-cosmovisor) -- [Download and set up Cosmovisor](#download-and-set-up-cosmovisor) -- [Setting up Cosmovisor](#setting-up-cosmovisor) -- [Upgrading with Cosmovisor](#upgrading-with-cosmovisor) +- [Installation](#installation) + - [Prerequisites](#prerequisites) + - [Installation Steps](#installation-steps) +- [Post-Installation](#post-installation) ## What is a Full Node -In blockchain networks, a full node retains continuous synchs and updates the latest copy of the -ledger. It may either be pruned full node (the latest data only) or an archival full node (including -complete and historical data). +In blockchain networks, a full node retains continuous synchs and updates the latest copy of the ledger. It may either be a pruned full node (the latest data only) or an archival full node (including complete and historical data). -You can visit the [Cosmos SDK documentation](https://docs.cosmos.network/main/user/run-node/run-node) -for more information on Full Nodes. +You can visit the [Cosmos SDK documentation](https://docs.cosmos.network/main/user/run-node/run-node) for more information on Full Nodes. ## What is Cosmovisor -As an alternative to our [Full Node - Docker](./full_node_docker.md) guide, we also provide documentation on how to deploy -a Full Node using Cosmovisor. +[Cosmovisor](https://docs.cosmos.network/main/build/tooling/cosmovisor) is a tool that automates the version management for our blockchain. It allows operators to automatically upgrade their full nodes and validators without downtime and reduce maintenance overhead. + +## Installation -[Cosmovisor](https://docs.cosmos.network/main/build/tooling/cosmovisor) is a tool that automates the version management -for our blockchain. It allows operators to automatically upgrade their full nodes and validators without downtime and -reduce maintenance overhead. +To install and set up a Poktroll Full Node using Cosmovisor, we provide a comprehensive installation script. This script will handle all the necessary steps, including user creation, dependency installation, Cosmovisor and Poktrolld setup, and system configuration. -:::info -TODO(@okdas): finish this tutorial as a part of [#526](https://github.com/pokt-network/poktroll/issues/526). -::: +### Prerequisites -## Download and set up Cosmovisor +- A Linux-based system (Debian-based distributions are fully supported, others may work as well) +- Root or sudo access -0. Prerequisites +### Installation Steps -If you're logged in as `root` user, let's create a separate user: +1. Download the installation script: ```bash -# ONLY NEEDED IF YOU LOGGED IN UNDER ROOT +curl -O https://raw.githubusercontent.com/pokt-network/poktroll/main/scripts/install_poktroll_node.sh +``` -# Add user -useradd -m -s /bin/bash poktroll-cosmovisor +2. Make the script executable: -# Set -passwd poktroll-cosmovisor +```bash +chmod +x install_poktroll_node.sh +``` -# Add the new user to the sudo group -usermod -aG sudo poktroll-cosmovisor +3. Run the script with sudo privileges: -# Switch to the new user -su - poktroll-cosmovisor +```bash +sudo ./install_poktroll_node.sh ``` -1. Download Cosmovisor: +4. Follow the prompts to provide the necessary information: + - Desired username to run poktrolld (default: poktroll) + - Node moniker (default: hostname) + - Seeds (default: 838625e3cfc7a2e347a1afc769957157441f649b@35.184.192.176:26656) + - Chain ID (default: poktroll-testnet) + +The script will then proceed with the installation and setup process. + +## Post-Installation + +After the installation is complete, your Poktroll Full Node should be up and running. Here are some useful commands for managing your node: + +1. Check the status of your node: ```bash -# Determine architecture and download the appropriate Cosmovisor binary -ARCH=$(uname -m) -if [ "$ARCH" = "x86_64" ]; then - ARCH="amd64" -elif [ "$ARCH" = "aarch64" ]; then - ARCH="arm64" -fi -curl -LO "https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.6.0/cosmovisor-v1.6.0-linux-${ARCH}.tar.gz" - -# Create $HOME/bin if it doesn't exist and extract the binary -mkdir -p $HOME/bin -tar -zxvf cosmovisor-v1.6.0-linux-${ARCH}.tar.gz -C $HOME/bin cosmovisor - -# Ensure $HOME/bin is in the PATH -if ! grep -q 'export PATH=$HOME/bin:$PATH' $HOME/.profile; then - echo 'export PATH=$HOME/bin:$PATH' >> $HOME/.profile -fi - -# Source the updated .profile to apply changes to the current session -source $HOME/.profile - -# Clean up -rm cosmovisor-v1.6.0-linux-${ARCH}.tar.gz +sudo systemctl status cosmovisor.service ``` -2. Set up Cosmovisor: +2. View the logs: ```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=true" >> ~/.profile -source ~/.profile +sudo journalctl -u cosmovisor.service -f ``` -3. Set up systemd unit +3. Stop the node: - ```bash -echo "[Unit] -Description=Cosmovisor daemon for poktrolld -After=network-online.target - -[Service] -Environment=\"DAEMON_NAME=${DAEMON_NAME}\" -Environment=\"DAEMON_HOME=${DAEMON_HOME}\" -Environment=\"DAEMON_RESTART_AFTER_UPGRADE=${DAEMON_RESTART_AFTER_UPGRADE}\" -Environment=\"DAEMON_ALLOW_DOWNLOAD_BINARIES=${DAEMON_ALLOW_DOWNLOAD_BINARIES}\" -Environment=\"UNSAFE_SKIP_BACKUP=${UNSAFE_SKIP_BACKUP}\" -ExecStart=${HOME}/go/bin/cosmovisor start --home=${DAEMON_HOME} -Restart=always -RestartSec=3 -LimitNOFILE=infinity -LimitNPROC=infinity - -[Install] -WantedBy=default.target -" +sudo systemctl stop cosmovisor.service ``` -## Setting up Cosmovisor +4. Start the node: -[Content to be added] +```bash +sudo systemctl start cosmovisor.service +``` -## Upgrading with Cosmovisor +5. Restart the node: + +```bash +sudo systemctl restart cosmovisor.service +``` -[Content to be added] \ No newline at end of file +Remember to keep your system updated and monitor your node regularly to ensure its proper functioning and security. \ No newline at end of file diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh new file mode 100644 index 000000000..379ce3c54 --- /dev/null +++ b/tools/installer/full-node.sh @@ -0,0 +1,207 @@ +#!/bin/bash + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Function to print colored output +print_color() { + COLOR=$1 + MESSAGE=$2 + echo -e "${COLOR}${MESSAGE}${NC}" +} + +# Function to check if running as root +check_root() { + if [[ $EUID -ne 0 ]]; then + print_color $RED "This script must be run as root or with sudo privileges." + exit 1 + fi +} + +# Function to get user input +get_user_input() { + read -p "Enter the desired username to run poktrolld (default: poktroll): " POKTROLL_USER + POKTROLL_USER=${POKTROLL_USER:-poktroll} + + read -p "Enter the node moniker (default: $(hostname)): " NODE_MONIKER + NODE_MONIKER=${NODE_MONIKER:-$(hostname)} + + read -p "Enter the chain-id (default: poktroll-testnet): " CHAIN_ID + CHAIN_ID=${CHAIN_ID:-"poktroll-testnet"} + + # Fetch seeds from the provided URL + SEEDS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.seeds" + SEEDS=$(curl -s "$SEEDS_URL") + if [ -z "$SEEDS" ]; then + print_color $RED "Failed to fetch seeds from $SEEDS_URL. Please check your internet connection and try again." + exit 1 + fi + print_color $GREEN "Successfully fetched seeds: $SEEDS" + + # Ask user for confirmation + read -p "Do you want to use these seeds? (Y/n): " confirm + if [[ $confirm =~ ^[Nn] ]]; then + read -p "Enter custom seeds: " custom_seeds + SEEDS=${custom_seeds:-$SEEDS} + fi +} + + +# Function to create user +create_user() { + if id "$POKTROLL_USER" &>/dev/null; then + print_color $YELLOW "User $POKTROLL_USER already exists. Skipping user creation." + else + useradd -m -s /bin/bash "$POKTROLL_USER" + echo "$POKTROLL_USER:$POKTROLL_USER" | chpasswd + usermod -aG sudo "$POKTROLL_USER" + print_color $GREEN "User $POKTROLL_USER created successfully." + fi +} + +# Function to install dependencies +install_dependencies() { + print_color $YELLOW "Installing dependencies..." + if [ -f /etc/debian_version ]; then + apt-get update + apt-get install -y curl tar wget + elif [ -f /etc/redhat-release ]; then + yum update -y + yum install -y curl tar wget + else + print_color $RED "Unsupported distribution. Please install curl, tar, and wget manually." + exit 1 + fi + print_color $GREEN "Dependencies installed successfully." +} + +# Function to download and set up Cosmovisor +setup_cosmovisor() { + print_color $YELLOW "Setting up Cosmovisor..." + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + ARCH="amd64" + elif [ "$ARCH" = "aarch64" ]; then + ARCH="arm64" + else + print_color $RED "Unsupported architecture: $ARCH" + exit 1 + fi + + 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 + mkdir -p \$HOME/bin + curl -L "$COSMOVISOR_URL" | tar -zxvf - -C \$HOME/bin + echo 'export PATH=\$HOME/bin:\$PATH' >> \$HOME/.profile + source \$HOME/.profile +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 + ARCH="amd64" + elif [ "$ARCH" = "aarch64" ]; then + ARCH="arm64" + else + print_color $RED "Unsupported architecture: $ARCH" + exit 1 + fi + + POKTROLLD_VERSION="v0.0.6" + POKTROLLD_URL="https://github.com/pokt-network/poktroll/releases/download/${POKTROLLD_VERSION}/poktroll_linux_${ARCH}.tar.gz" + + sudo -u "$POKTROLL_USER" bash << EOF + curl -L "$POKTROLLD_URL" | tar -zxvf - -C \$HOME/bin + chmod +x \$HOME/bin/poktrolld + mkdir -p \$HOME/.poktroll/cosmovisor/genesis/bin + cp \$HOME/bin/poktrolld \$HOME/.poktroll/cosmovisor/genesis/bin/ + ln -sf \$HOME/.poktroll/cosmovisor/genesis/bin/poktrolld \$HOME/bin/poktrolld +EOF + print_color $GREEN "Poktrolld set up successfully." +} + +# Function to configure Poktrolld +configure_poktrolld() { + print_color $YELLOW "Configuring Poktrolld..." + sudo -u "$POKTROLL_USER" bash << EOF + poktrolld init "$NODE_MONIKER" --chain-id="$CHAIN_ID" --home=\$HOME/.poktroll + curl -o \$HOME/.poktroll/config/genesis.json https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.json + sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" \$HOME/.poktroll/config/config.toml +EOF + print_color $GREEN "Poktrolld configured successfully." +} + +# Function to set up environment variables +setup_env_vars() { + print_color $YELLOW "Setting up environment variables..." + sudo -u "$POKTROLL_USER" bash << EOF + echo "export DAEMON_NAME=poktrolld" >> \$HOME/.profile + echo "export DAEMON_HOME=\$HOME/.poktroll" >> \$HOME/.profile + echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> \$HOME/.profile + echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> \$HOME/.profile + echo "export UNSAFE_SKIP_BACKUP=true" >> \$HOME/.profile + source \$HOME/.profile +EOF + print_color $GREEN "Environment variables set up successfully." +} + +# Function to set up systemd service +setup_systemd() { + print_color $YELLOW "Setting up systemd service..." + cat > /etc/systemd/system/cosmovisor.service << EOF +[Unit] +Description=Cosmovisor daemon for poktrolld +After=network-online.target + +[Service] +User=$POKTROLL_USER +ExecStart=/home/$POKTROLL_USER/bin/cosmovisor run start --home=/home/$POKTROLL_USER/.poktroll +Restart=always +RestartSec=3 +LimitNOFILE=infinity +LimitNPROC=infinity +Environment="DAEMON_NAME=poktrolld" +Environment="DAEMON_HOME=/home/$POKTROLL_USER/.poktroll" +Environment="DAEMON_RESTART_AFTER_UPGRADE=true" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" +Environment="UNSAFE_SKIP_BACKUP=true" + +[Install] +WantedBy=multi-user.target +EOF + + systemctl daemon-reload + systemctl enable cosmovisor.service + systemctl start cosmovisor.service + print_color $GREEN "Systemd service set up and started successfully." +} + +# Main function +main() { + print_color $GREEN "Welcome to the Poktroll Full Node Install Script!" + check_root + get_user_input + create_user + install_dependencies + setup_cosmovisor + setup_poktrolld + configure_poktrolld + setup_env_vars + setup_systemd + print_color $GREEN "Poktroll Full Node installation completed successfully!" + print_color $YELLOW "You can check the status of your node with: sudo systemctl status cosmovisor.service" + print_color $YELLOW "View logs with: sudo journalctl -u cosmovisor.service -f" +} + +main \ No newline at end of file diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index 91f06eeff..5bc7d33e4 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -133,7 +133,6 @@ type MsgUpdateParam struct { // specified in the `Params` message in `proof/params.proto.` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: - // // *MsgUpdateParam_AsString // *MsgUpdateParam_AsInt64 // *MsgUpdateParam_AsBytes From 70495bba96e87dd0d8c719fa61bf2751fb27856e Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Thu, 29 Aug 2024 18:01:17 -0700 Subject: [PATCH 03/18] update links --- .../docs/operate/run_a_node/full_node_cosmovisor.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index a4eedcb7f..f736a8988 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -35,25 +35,25 @@ To install and set up a Poktroll Full Node using Cosmovisor, we provide a compre 1. Download the installation script: ```bash -curl -O https://raw.githubusercontent.com/pokt-network/poktroll/main/scripts/install_poktroll_node.sh +curl -O https://raw.githubusercontent.com/pokt-network/poktroll/main/tools/installer/full-node.sh ``` 2. Make the script executable: ```bash -chmod +x install_poktroll_node.sh +chmod +x full-node.sh ``` 3. Run the script with sudo privileges: ```bash -sudo ./install_poktroll_node.sh +sudo ./full-node.sh ``` 4. Follow the prompts to provide the necessary information: - Desired username to run poktrolld (default: poktroll) - Node moniker (default: hostname) - - Seeds (default: 838625e3cfc7a2e347a1afc769957157441f649b@35.184.192.176:26656) + - Seeds (default: fetched [from the official source](https://github.com/pokt-network/pocket-network-genesis/tree/master/poktrolld)) - Chain ID (default: poktroll-testnet) The script will then proceed with the installation and setup process. From ae5ca6f0a3de8fb004385030b4870fd45bfd2d82 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Thu, 29 Aug 2024 18:22:53 -0700 Subject: [PATCH 04/18] --wip-- [skip ci] --- tools/installer/full-node.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index 379ce3c54..18e8e3799 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -31,8 +31,8 @@ get_user_input() { read -p "Enter the node moniker (default: $(hostname)): " NODE_MONIKER NODE_MONIKER=${NODE_MONIKER:-$(hostname)} - read -p "Enter the chain-id (default: poktroll-testnet): " CHAIN_ID - CHAIN_ID=${CHAIN_ID:-"poktroll-testnet"} + read -p "Enter the chain-id (default: poktroll): " CHAIN_ID + CHAIN_ID=${CHAIN_ID:-"poktroll"} # Fetch seeds from the provided URL SEEDS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.seeds" @@ -51,16 +51,22 @@ get_user_input() { fi } - # Function to create user create_user() { if id "$POKTROLL_USER" &>/dev/null; then print_color $YELLOW "User $POKTROLL_USER already exists. Skipping user creation." else useradd -m -s /bin/bash "$POKTROLL_USER" - echo "$POKTROLL_USER:$POKTROLL_USER" | chpasswd + print_color $YELLOW "User $POKTROLL_USER created. Please set a password for this user." + while true; do + if passwd "$POKTROLL_USER"; then + break + else + print_color $RED "Password change failed. Please try again." + fi + done usermod -aG sudo "$POKTROLL_USER" - print_color $GREEN "User $POKTROLL_USER created successfully." + print_color $GREEN "User $POKTROLL_USER created successfully and added to sudo group." fi } From aded1f810ca6f12a3b28ba0b68a1078cbf212100 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 10:17:06 -0700 Subject: [PATCH 05/18] --wip-- [skip ci] --- tools/installer/full-node.sh | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index 18e8e3799..d8fd71092 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -86,6 +86,20 @@ install_dependencies() { print_color $GREEN "Dependencies installed successfully." } +# Function to set up environment variables +setup_env_vars() { + print_color $YELLOW "Setting up environment variables..." + sudo -u "$POKTROLL_USER" bash << EOF + echo "export DAEMON_NAME=poktrolld" >> \$HOME/.profile + echo "export DAEMON_HOME=\$HOME/.poktroll" >> \$HOME/.profile + echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> \$HOME/.profile + echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> \$HOME/.profile + echo "export UNSAFE_SKIP_BACKUP=true" >> \$HOME/.profile + source \$HOME/.profile +EOF + print_color $GREEN "Environment variables set up successfully." +} + # Function to download and set up Cosmovisor setup_cosmovisor() { print_color $YELLOW "Setting up Cosmovisor..." @@ -128,11 +142,11 @@ setup_poktrolld() { POKTROLLD_URL="https://github.com/pokt-network/poktroll/releases/download/${POKTROLLD_VERSION}/poktroll_linux_${ARCH}.tar.gz" sudo -u "$POKTROLL_USER" bash << EOF - curl -L "$POKTROLLD_URL" | tar -zxvf - -C \$HOME/bin - chmod +x \$HOME/bin/poktrolld mkdir -p \$HOME/.poktroll/cosmovisor/genesis/bin - cp \$HOME/bin/poktrolld \$HOME/.poktroll/cosmovisor/genesis/bin/ + curl -L "$POKTROLLD_URL" | 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/bin/poktrolld + source \$HOME/.profile EOF print_color $GREEN "Poktrolld set up successfully." } @@ -141,6 +155,7 @@ EOF configure_poktrolld() { print_color $YELLOW "Configuring Poktrolld..." sudo -u "$POKTROLL_USER" bash << EOF + source \$HOME/.profile poktrolld init "$NODE_MONIKER" --chain-id="$CHAIN_ID" --home=\$HOME/.poktroll curl -o \$HOME/.poktroll/config/genesis.json https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.json sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" \$HOME/.poktroll/config/config.toml @@ -148,20 +163,6 @@ EOF print_color $GREEN "Poktrolld configured successfully." } -# Function to set up environment variables -setup_env_vars() { - print_color $YELLOW "Setting up environment variables..." - sudo -u "$POKTROLL_USER" bash << EOF - echo "export DAEMON_NAME=poktrolld" >> \$HOME/.profile - echo "export DAEMON_HOME=\$HOME/.poktroll" >> \$HOME/.profile - echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> \$HOME/.profile - echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> \$HOME/.profile - echo "export UNSAFE_SKIP_BACKUP=true" >> \$HOME/.profile - source \$HOME/.profile -EOF - print_color $GREEN "Environment variables set up successfully." -} - # Function to set up systemd service setup_systemd() { print_color $YELLOW "Setting up systemd service..." @@ -200,10 +201,10 @@ main() { get_user_input create_user install_dependencies + setup_env_vars setup_cosmovisor setup_poktrolld configure_poktrolld - setup_env_vars setup_systemd print_color $GREEN "Poktroll Full Node installation completed successfully!" print_color $YELLOW "You can check the status of your node with: sudo systemctl status cosmovisor.service" From 14649776bfc8366438633bca6976c052642b868e Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 10:58:44 -0700 Subject: [PATCH 06/18] --wip-- [skip ci] --- tools/installer/full-node.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index d8fd71092..de4453b4c 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -154,13 +154,33 @@ EOF # Function to configure Poktrolld configure_poktrolld() { print_color $YELLOW "Configuring Poktrolld..." + + # Ask for confirmation to download the genesis file + GENESIS_URL="https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.json" + print_color $YELLOW "The script will download the genesis file from:" + print_color $YELLOW "$GENESIS_URL" + read -p "Are you OK with downloading and using this genesis file? (y/N): " confirm_genesis + if [[ ! $confirm_genesis =~ ^[Yy] ]]; then + print_color $RED "Genesis file download cancelled. Exiting." + exit 1 + fi + sudo -u "$POKTROLL_USER" bash << EOF source \$HOME/.profile poktrolld init "$NODE_MONIKER" --chain-id="$CHAIN_ID" --home=\$HOME/.poktroll - curl -o \$HOME/.poktroll/config/genesis.json https://raw.githubusercontent.com/pokt-network/pocket-network-genesis/master/poktrolld/testnet-validated.json + curl -o \$HOME/.poktroll/config/genesis.json $GENESIS_URL + if [ $? -ne 0 ]; then + echo "Failed to download genesis file. Please check your internet connection and try again." + exit 1 + fi sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|" \$HOME/.poktroll/config/config.toml EOF - print_color $GREEN "Poktrolld configured successfully." + if [ $? -eq 0 ]; then + print_color $GREEN "Poktrolld configured successfully." + else + print_color $RED "Failed to configure Poktrolld. Please check the error messages above." + exit 1 + fi } # Function to set up systemd service From 456bd97e1b882e6b34cb145afa1f93117e1dcd04 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 11:02:58 -0700 Subject: [PATCH 07/18] --wip-- [skip ci] --- tools/installer/full-node.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index de4453b4c..ee6d8eb9f 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -80,7 +80,7 @@ install_dependencies() { yum update -y yum install -y curl tar wget else - print_color $RED "Unsupported distribution. Please install curl, tar, and wget manually." + print_color $RED "Unsupported distribution. Please install curl, tar, wget, and jq manually." exit 1 fi print_color $GREEN "Dependencies installed successfully." @@ -138,12 +138,12 @@ setup_poktrolld() { exit 1 fi - POKTROLLD_VERSION="v0.0.6" - POKTROLLD_URL="https://github.com/pokt-network/poktroll/releases/download/${POKTROLLD_VERSION}/poktroll_linux_${ARCH}.tar.gz" + # Use the direct download link for the latest release + LATEST_RELEASE_URL="https://github.com/pokt-network/poktroll/releases/latest/download/poktroll_linux_${ARCH}.tar.gz" sudo -u "$POKTROLL_USER" bash << EOF mkdir -p \$HOME/.poktroll/cosmovisor/genesis/bin - curl -L "$POKTROLLD_URL" | tar -zxvf - -C \$HOME/.poktroll/cosmovisor/genesis/bin + curl -L "$LATEST_RELEASE_URL" | 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/bin/poktrolld source \$HOME/.profile @@ -167,9 +167,14 @@ configure_poktrolld() { sudo -u "$POKTROLL_USER" bash << EOF source \$HOME/.profile + + # Check poktrolld version + POKTROLLD_VERSION=\$(poktrolld version) + echo "Poktrolld version: \$POKTROLLD_VERSION" + poktrolld init "$NODE_MONIKER" --chain-id="$CHAIN_ID" --home=\$HOME/.poktroll curl -o \$HOME/.poktroll/config/genesis.json $GENESIS_URL - if [ $? -ne 0 ]; then + if [ \$? -ne 0 ]; then echo "Failed to download genesis file. Please check your internet connection and try again." exit 1 fi From 35feee161563b49b21d1afd4fba99465518a81be Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 11:03:11 -0700 Subject: [PATCH 08/18] --wip-- [skip ci] --- tools/installer/full-node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/installer/full-node.sh b/tools/installer/full-node.sh index ee6d8eb9f..6faca639b 100644 --- a/tools/installer/full-node.sh +++ b/tools/installer/full-node.sh @@ -80,7 +80,7 @@ install_dependencies() { yum update -y yum install -y curl tar wget else - print_color $RED "Unsupported distribution. Please install curl, tar, wget, and jq manually." + print_color $RED "Unsupported distribution. Please install curl, tar and wget manually." exit 1 fi print_color $GREEN "Dependencies installed successfully." From b321d27cf0bd69acfcc2861094dabc8f32b881f8 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 11:09:12 -0700 Subject: [PATCH 09/18] redundant comment --- cmd/poktrolld/cmd/commands.go | 1 - docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/poktrolld/cmd/commands.go b/cmd/poktrolld/cmd/commands.go index f9a7ab3fe..7792e07f7 100644 --- a/cmd/poktrolld/cmd/commands.go +++ b/cmd/poktrolld/cmd/commands.go @@ -88,7 +88,6 @@ func queryCommand() *cobra.Command { authcmd.QueryTxCmd(), server.QueryBlockResultsCmd(), ) - // TODO_MAINNET: adjust chain ID for the mainnet (assuming it's going to change) cmd.PersistentFlags().String(flags.FlagChainID, DefaultChainID, "The network chain ID") return cmd diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index f736a8988..584296159 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -29,6 +29,7 @@ To install and set up a Poktroll Full Node using Cosmovisor, we provide a compre - A Linux-based system (Debian-based distributions are fully supported, others may work as well) - Root or sudo access +- A dedicated server or a virtual machine (any provider should work, Vultr and Hetzner have been tested) ### Installation Steps From c86ff04940565a6220f42fd1786b7af1e83dd9c2 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 11:27:54 -0700 Subject: [PATCH 10/18] resolve conflicts --- .../docs/operate/run_a_node/full_node_cosmovisor.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index def8b2165..b70834cb1 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -3,12 +3,7 @@ title: Full Node - Cosmovisor sidebar_position: 1 --- -<<<<<<< HEAD ## Table of Contents -======= -# Run a Full Node using Cosmovisor - ->>>>>>> origin/main - [What is a Full Node](#what-is-a-full-node) - [What is Cosmovisor](#what-is-cosmovisor) - [Installation](#installation) @@ -38,7 +33,6 @@ To install and set up a Poktroll Full Node using Cosmovisor, we provide a compre ### Installation Steps -<<<<<<< HEAD 1. Download the installation script: ```bash @@ -100,6 +94,3 @@ sudo systemctl restart cosmovisor.service ``` Remember to keep your system updated and monitor your node regularly to ensure its proper functioning and security. -======= -[Content to be added] ->>>>>>> origin/main From 353fe44464d30b1d17a54eb4e6e675075791ef0b Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 30 Aug 2024 11:47:34 -0700 Subject: [PATCH 11/18] adjust the docs a little --- docusaurus/docs/operate/run_a_node/appgate_server.md | 2 +- .../docs/operate/run_a_node/full_node_cosmovisor.md | 5 +++-- docusaurus/docs/operate/run_a_node/full_node_docker.md | 10 ++++------ .../docs/operate/run_a_node/hardware_requirements.md | 2 +- docusaurus/docs/operate/run_a_node/relay_miner.md | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docusaurus/docs/operate/run_a_node/appgate_server.md b/docusaurus/docs/operate/run_a_node/appgate_server.md index d5fb6ae21..cf40e54cb 100644 --- a/docusaurus/docs/operate/run_a_node/appgate_server.md +++ b/docusaurus/docs/operate/run_a_node/appgate_server.md @@ -1,6 +1,6 @@ --- title: AppGate Server -sidebar_position: 3 +sidebar_position: 4 --- # Run an AppGate Server diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index b70834cb1..f48be5b06 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -1,9 +1,10 @@ --- title: Full Node - Cosmovisor -sidebar_position: 1 +sidebar_position: 2 --- -## Table of Contents +# Run a Full Node using Cosmovisor + - [What is a Full Node](#what-is-a-full-node) - [What is Cosmovisor](#what-is-cosmovisor) - [Installation](#installation) diff --git a/docusaurus/docs/operate/run_a_node/full_node_docker.md b/docusaurus/docs/operate/run_a_node/full_node_docker.md index 3818965bb..aee02e3a8 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_docker.md +++ b/docusaurus/docs/operate/run_a_node/full_node_docker.md @@ -1,6 +1,6 @@ --- title: Full Node - Docker -sidebar_position: 2 +sidebar_position: 3 --- # Run a Full Node using Docker @@ -49,7 +49,7 @@ nodes needed for off-chain entities like [RelayMiners](./relay_miner.md) and [AppGates](./appgate_server.md), which rely on interaction with the Pocket Network blockchain for full functionality. -This guide outlines how to configure, deploy nad maintain Full Nodes. +This guide outlines how to configure, deploy and maintain Full Nodes. ## Hardware requirements @@ -57,10 +57,8 @@ Please see the [Hardware Requirements](./hardware_requirements.md#validator--ful ## Docker Compose Example -Please refer to the `Deploying a Full Node` section in [poktroll-docker-compose-example](https://github.com/pokt-network/poktroll-docker-compose-example#deploying-a-full-node) -GitHub repository on how to deploy an AppGate Server using `docker-compose`. - -_TODO: Move over the relevant information from the `poktroll-docker-compose-example` repository into the docs_ +Please refer to the `Deploying a Full Node` section in [Docker Compose Walkthrough](../quickstart/docker_compose_walkthrough.md) +on how to deploy a Full Node using `docker-compose`. ## Kubernetes Example diff --git a/docusaurus/docs/operate/run_a_node/hardware_requirements.md b/docusaurus/docs/operate/run_a_node/hardware_requirements.md index 0845ffb98..505b43953 100644 --- a/docusaurus/docs/operate/run_a_node/hardware_requirements.md +++ b/docusaurus/docs/operate/run_a_node/hardware_requirements.md @@ -1,6 +1,6 @@ --- title: Hardware Requirements -sidebar_position: 0 +sidebar_position: 1 --- # Hardware Requirements diff --git a/docusaurus/docs/operate/run_a_node/relay_miner.md b/docusaurus/docs/operate/run_a_node/relay_miner.md index 20fdf5fcc..58e4b6014 100644 --- a/docusaurus/docs/operate/run_a_node/relay_miner.md +++ b/docusaurus/docs/operate/run_a_node/relay_miner.md @@ -1,6 +1,6 @@ --- title: RelayMiner -sidebar_position: 4 +sidebar_position: 5 --- # Run a RelayMiner From 60745e9342490e49a797cc012f7f8cc4ab5a624e Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Wed, 4 Sep 2024 12:26:23 -0700 Subject: [PATCH 12/18] new defaults --- localnet/poktrolld/config/app.toml | 6 +++--- localnet/poktrolld/config/config.toml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/localnet/poktrolld/config/app.toml b/localnet/poktrolld/config/app.toml index 5216e8c1e..c80f545ae 100644 --- a/localnet/poktrolld/config/app.toml +++ b/localnet/poktrolld/config/app.toml @@ -7,7 +7,7 @@ index-events = [] inter-block-cache = true min-retain-blocks = 0 minimum-gas-prices = "0upokt" -pruning = "default" +pruning = "nothing" pruning-interval = "0" pruning-keep-recent = "0" query-gas-limit = "0" @@ -32,7 +32,7 @@ query-gas-limit = "0" enable = true [mempool] - max-txs = -1 + max-txs = 10000 [rpc] cors_allowed_origins = ["*"] @@ -55,7 +55,7 @@ query-gas-limit = "0" enable-service-label = false enabled = true global-labels = [] - metrics-sink = "" + metrics-sink = "mem" prometheus-retention-time = "600" service-name = "" statsd-addr = "" diff --git a/localnet/poktrolld/config/config.toml b/localnet/poktrolld/config/config.toml index a5acb79c2..32b4ee7b6 100644 --- a/localnet/poktrolld/config/config.toml +++ b/localnet/poktrolld/config/config.toml @@ -395,15 +395,15 @@ wal_file = "data/cs.wal/wal" # How long we wait for a proposal block before prevoting nil timeout_propose = "2s" # How much timeout_propose increases with each round -timeout_propose_delta = "500ms" +timeout_propose_delta = "5s" # How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) -timeout_prevote = "1s" +timeout_prevote = "10s" # How much the timeout_prevote increases with each round -timeout_prevote_delta = "500ms" +timeout_prevote_delta = "5s" # How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) -timeout_precommit = "1s" +timeout_precommit = "10s" # How much the timeout_precommit increases with each round -timeout_precommit_delta = "500ms" +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). From 5955972160312fb504ab72362a325ff46131b141 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Wed, 4 Sep 2024 12:34:08 -0700 Subject: [PATCH 13/18] Set min has prices on localnet --- cmd/poktrolld/cmd/config.go | 2 +- config.yml | 4 ++++ localnet/poktrolld/config/app.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/poktrolld/cmd/config.go b/cmd/poktrolld/cmd/config.go index b3da73b69..921400b12 100644 --- a/cmd/poktrolld/cmd/config.go +++ b/cmd/poktrolld/cmd/config.go @@ -87,7 +87,7 @@ func initAppConfig() (string, interface{}) { // TODO_MAINNET: reconsider values, especially MinGasPrices and MaxTxs // Set default values so `poktrolld init` creates configs with "blessed" values: - srvCfg.MinGasPrices = "0.000000001upokt" + srvCfg.MinGasPrices = "0.000000001upokt" // Also adjust `config.yml`. srvCfg.Mempool.MaxTxs = 10000 srvCfg.Telemetry.Enabled = true srvCfg.Telemetry.PrometheusRetentionTime = 60 // in seconds diff --git a/config.yml b/config.yml index 188eef958..4ca97a3e2 100644 --- a/config.yml +++ b/config.yml @@ -77,7 +77,11 @@ client: validators: - name: validator1 bonded: 900000000upokt + # Config overrides for `validator1` only (primarily used on LocalNet). + # To change the default configs (that can be created using `poktrolld init` - adjust `cmd/poktrolld/cmd/config.go`) app: + # Ignite does not carry over all defaults, so we are going to match `minimum-gas-prices` with `cmd/config.go`. + minimum-gas-prices: 0.000000001upokt telemetry: enabled: true prometheus-retention-time: "600" # seconds diff --git a/localnet/poktrolld/config/app.toml b/localnet/poktrolld/config/app.toml index c80f545ae..2e42545ee 100644 --- a/localnet/poktrolld/config/app.toml +++ b/localnet/poktrolld/config/app.toml @@ -6,7 +6,7 @@ iavl-disable-fastnode = false index-events = [] inter-block-cache = true min-retain-blocks = 0 -minimum-gas-prices = "0upokt" +minimum-gas-prices = "0.000000001upokt" pruning = "nothing" pruning-interval = "0" pruning-keep-recent = "0" From e9182e7c95c7b9a52bda7933324290aa939a774e Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Thu, 5 Sep 2024 14:50:17 -0400 Subject: [PATCH 14/18] Review #768 --- .../run_a_node/full_node_cosmovisor.md | 73 +++++++++++-------- .../run_a_node/hardware_requirements.md | 38 ++++++---- .../docs/protocol/upgrades/upgrade_list.md | 2 +- 3 files changed, 65 insertions(+), 48 deletions(-) diff --git a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md index f48be5b06..e9a1c8704 100644 --- a/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md +++ b/docusaurus/docs/operate/run_a_node/full_node_cosmovisor.md @@ -3,95 +3,106 @@ title: Full Node - Cosmovisor sidebar_position: 2 --- -# Run a Full Node using Cosmovisor +## Run a Full Node using Cosmovisor + +This document provides instructions on using the official Cosmos SDK [Cosmosvisor](https://docs.cosmos.network/v0.45/run-node/cosmovisor.html) to run a full Pocket Network node. - [What is a Full Node](#what-is-a-full-node) - [What is Cosmovisor](#what-is-cosmovisor) -- [Installation](#installation) +- [Installation Instructions](#installation-instructions) - [Prerequisites](#prerequisites) - [Installation Steps](#installation-steps) -- [Post-Installation](#post-installation) +- [Useful Command Cheat Sheet](#useful-command-cheat-sheet) + - [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) -## What is a Full Node +### What is a Full Node In blockchain networks, a full node retains continuous synchs and updates the latest copy of the ledger. It may either be a pruned full node (the latest data only) or an archival full node (including complete and historical data). You can visit the [Cosmos SDK documentation](https://docs.cosmos.network/main/user/run-node/run-node) for more information on Full Nodes. -## What is Cosmovisor +### What is Cosmovisor [Cosmovisor](https://docs.cosmos.network/main/build/tooling/cosmovisor) is a tool that automates the version management for our blockchain. It allows operators to automatically upgrade their full nodes and validators without downtime and reduce maintenance overhead. -## Installation +### Installation Instructions To install and set up a Poktroll Full Node using Cosmovisor, we provide a comprehensive installation script. This script will handle all the necessary steps, including user creation, dependency installation, Cosmovisor and Poktrolld setup, and system configuration. -### Prerequisites +#### Prerequisites - A Linux-based system (Debian-based distributions are fully supported, others may work as well) - Root or sudo access - A dedicated server or a virtual machine (any provider should work, Vultr and Hetzner have been tested) -### Installation Steps +#### Installation Steps 1. Download the installation script: -```bash -curl -O https://raw.githubusercontent.com/pokt-network/poktroll/main/tools/installer/full-node.sh -``` + ```bash + curl -O https://raw.githubusercontent.com/pokt-network/poktroll/main/tools/installer/full-node.sh + ``` 2. Make the script executable: -```bash -chmod +x full-node.sh -``` + ```bash + chmod +x full-node.sh + ``` 3. Run the script with sudo privileges: -```bash -sudo ./full-node.sh -``` + ```bash + sudo ./full-node.sh + ``` 4. Follow the prompts to provide the necessary information: - - Desired username to run poktrolld (default: poktroll) - - Node moniker (default: hostname) - - Seeds (default: fetched [from the official source](https://github.com/pokt-network/pocket-network-genesis/tree/master/poktrolld)) - - Chain ID (default: poktroll-testnet) + - Desired username to run poktrolld (`default: poktroll`) + - Node moniker (`default: hostname`) + - Seeds (`default: fetched` [from the official source](https://github.com/pokt-network/pocket-network-genesis/tree/master/poktrolld)) + - Chain ID (`default: poktroll-testnet`) The script will then proceed with the installation and setup process. -## Post-Installation +### Useful Command Cheat Sheet + +After the installation is complete, your Poktroll Full Node should be up and running. + +:::tip +Remember to keep your system updated and monitor your node regularly to ensure its proper functioning and security. +::: -After the installation is complete, your Poktroll Full Node should be up and running. Here are some useful commands for managing your node: +Here are some useful commands for managing your node: -1. Check the status of your node: +#### Check the status of your node ```bash -sudo systemctl status cosmovisor.service + sudo systemctl status cosmovisor.service ``` -2. View the logs: +#### View the logs ```bash sudo journalctl -u cosmovisor.service -f ``` -3. Stop the node: +#### Stop the node ```bash sudo systemctl stop cosmovisor.service ``` -4. Start the node: +#### Start the node ```bash sudo systemctl start cosmovisor.service ``` -5. Restart the node: +#### Restart the node ```bash sudo systemctl restart cosmovisor.service ``` - -Remember to keep your system updated and monitor your node regularly to ensure its proper functioning and security. diff --git a/docusaurus/docs/operate/run_a_node/hardware_requirements.md b/docusaurus/docs/operate/run_a_node/hardware_requirements.md index 505b43953..707fd6682 100644 --- a/docusaurus/docs/operate/run_a_node/hardware_requirements.md +++ b/docusaurus/docs/operate/run_a_node/hardware_requirements.md @@ -3,19 +3,21 @@ title: Hardware Requirements sidebar_position: 1 --- -# Hardware Requirements +## Hardware Requirements :::warning -We are continuously evaluating the hardware requirements as we work on the next version of Pocket Network. Recommendations may change as we approach the Shannon Mainnet release. +We are continuously evaluating the hardware requirements as we work on the next version of Pocket Network. + +TODO_MAINNET: Update this document prior to MainNet release ::: - [Validator / Full Node](#validator--full-node) +- [RPC Node](#rpc-node) - [RelayMiner](#relayminer) - [AppGate Server / Gateway](#appgate-server--gateway) - [Additional Considerations](#additional-considerations) - -## Validator / Full Node +### Validator / Full Node | Component | Minimum | Recommended | | ----------- | ------- | ----------- | @@ -23,14 +25,14 @@ We are continuously evaluating the hardware requirements as we work on the next | RAM | 8GB | 16GB | | SSD Storage | 50GB | 50GB | -:::info -If the Full Node will serve as the RPC endpoint for Gateway and RelayMiners under high load, consider: +### RPC Node + +If the Full Node will serve as the RPC endpoint for Gateways and RelayMiners under high load, consider: + - Providing more resources - Deploying multiple Full Nodes for continuous service -::: - -## RelayMiner +### RelayMiner See the [RelayMiner](../../protocol/actors/appgate_server.md) documentation for more information on what a RelayMiner is. @@ -41,14 +43,18 @@ information on what a RelayMiner is. | RAM | 1GB | 16GB | | SSD Storage | 5GB | 5GB | -:::info -Resource requirements for RelayMiner scale linearly with load: -- More suppliers and traffic = Higher resource consumption -- We strongly recommend continuous monitoring to ensure optimal performance -::: +Note that resource requirements for RelayMiner scale linearly with load: + +- More suppliers --> Higher resource consumption +- More relays --> HIgher resource consumption + +:::note +TODO_POST_MAINNET(@okdas): Provide benchmarks for relayminers handling different traffic amounts. + +::: -## AppGate Server / Gateway +### AppGate Server / Gateway See the [AppGate Server](../../protocol/actors/appgate_server.md) documentation for more information on what an AppGate Server is. @@ -61,7 +67,7 @@ information on what an AppGate Server is. **Note**: This service is stateless and does not require SSD storage. -## Additional Considerations +### Additional Considerations 1. **Scalability**: As your infrastructure grows, you may need to adjust resources accordingly. 2. **Monitoring**: Implement a robust monitoring system to track resource usage and performance. diff --git a/docusaurus/docs/protocol/upgrades/upgrade_list.md b/docusaurus/docs/protocol/upgrades/upgrade_list.md index 4ac82aa2b..6bbda9b77 100644 --- a/docusaurus/docs/protocol/upgrades/upgrade_list.md +++ b/docusaurus/docs/protocol/upgrades/upgrade_list.md @@ -26,7 +26,7 @@ This table is currently incomplete and does not include all protocol upgrades. O | Version | Planned | Breaking | Requires Manual Intervention | Upgrade Height | | ------------------------------------------------------------------------ | :-----: | :------: | :--------------------------: | -------------- | -| [`v0.0.4`](https://github.com/pokt-network/poktroll/releases/tag/v0.0.4) | ❓ | ❓ | ❌ | ❓ | +| [`v0.0.4`](https://github.com/pokt-network/poktroll/releases/tag/v0.0.4) | ❓ | ❓ | ❌ | ❓ | ## MainNet From 3a85b8b32181de55e5b3f526556beb22cfff8cd1 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 6 Sep 2024 12:40:17 -0700 Subject: [PATCH 15/18] --wip-- [skip ci] --- cmd/poktrolld/cmd/config.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cmd/poktrolld/cmd/config.go b/cmd/poktrolld/cmd/config.go index 921400b12..f3b586d1c 100644 --- a/cmd/poktrolld/cmd/config.go +++ b/cmd/poktrolld/cmd/config.go @@ -35,8 +35,16 @@ func initSDKConfig() { config.Seal() } -// initCometBFTConfig helps to override default CometBFT Config values. -// return cmtcfg.DefaultConfig if no custom configuration is required for the application. +// The code below changes how the default configuration files are rendered on `poktrolld init` command. This command +// is ofter used by the validator and full node runners to provision the configuration prior to starting the node. +// These are the values **WE WANT** participants to have. This doesn't guarantee the node runners won't adjust the values +// but it helps making sure most of them are using the following configuration. +// Worth noting that changing these values in the future won't magically update them in the existing configuration, +// which makes it's important to pick the sensible defaults. + +// initCometBFTConfig helps to override default CometBFT Config (config.toml) values. +// These values are going to be rendered into the config file on `poktrolld init`. +// TODO_MAINNET: Reconsider values - check `config.toml` for possible options. func initCometBFTConfig() *cmtcfg.Config { cfg := cmtcfg.DefaultConfig() @@ -44,8 +52,6 @@ func initCometBFTConfig() *cmtcfg.Config { // cfg.P2P.MaxNumInboundPeers = 100 // cfg.P2P.MaxNumOutboundPeers = 40 - // Set default values so `poktrolld init` creates configs with "blessed" values: - // TODO_MAINNET: discuss block times cfg.Consensus.TimeoutPropose = 60 * time.Second cfg.Consensus.TimeoutProposeDelta = 5 * time.Second cfg.Consensus.TimeoutPrevote = 10 * time.Second @@ -59,8 +65,10 @@ func initCometBFTConfig() *cmtcfg.Config { return cfg } -// initAppConfig helps to override default appConfig template and configs. +// initAppConfig helps to override default appConfig (app.toml) template and configs. +// These values are going to be rendered into the config file on `poktrolld init`. // return "", nil if no custom configuration is required for the application. +// TODO_MAINNET: Reconsider values - check `app.toml` for possible options. func initAppConfig() (string, interface{}) { // The following code snippet is just for reference. type CustomAppConfig struct { @@ -85,12 +93,10 @@ func initAppConfig() (string, interface{}) { // srvCfg.MinGasPrices = "0stake" // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default - // TODO_MAINNET: reconsider values, especially MinGasPrices and MaxTxs - // Set default values so `poktrolld init` creates configs with "blessed" values: - srvCfg.MinGasPrices = "0.000000001upokt" // Also adjust `config.yml`. + srvCfg.MinGasPrices = "0.000000001upokt" // Also adjust ignite's `config.yml`. srvCfg.Mempool.MaxTxs = 10000 srvCfg.Telemetry.Enabled = true - srvCfg.Telemetry.PrometheusRetentionTime = 60 // in seconds + srvCfg.Telemetry.PrometheusRetentionTime = 60 // in seconds. This turns on Prometheus support. srvCfg.Telemetry.MetricsSink = "mem" srvCfg.Pruning = "nothing" // archiving node by default srvCfg.API.Enable = true From 02366a35e90e9c28ccf6643d2d2b3b2e1dae47ec Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 6 Sep 2024 13:23:09 -0700 Subject: [PATCH 16/18] update wording more --- config.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 4ca97a3e2..25917f40b 100644 --- a/config.yml +++ b/config.yml @@ -77,10 +77,12 @@ client: validators: - name: validator1 bonded: 900000000upokt - # Config overrides for `validator1` only (primarily used on LocalNet). - # To change the default configs (that can be created using `poktrolld init` - adjust `cmd/poktrolld/cmd/config.go`) + # DEV_NOTE: adjust `cmd/poktrolld/cmd/config.go` to change the default options. The section below **ONLY** changes + # the values for the first validator, and the config is rendered using `ignite` cli. This is primarily used for + # LocalNet. Other participants of the network are relying on `poktrolld init`, which gets values from `cmd/config.go`. app: - # Ignite does not carry over all defaults, so we are going to match `minimum-gas-prices` with `cmd/config.go`. + # DEV_NOTE: Ignite does not carry over all defaults, so we are going to match `minimum-gas-prices` with `cmd/config.go`. + # See the enhancement request here: https://github.com/ignite/cli/issues/4340 minimum-gas-prices: 0.000000001upokt telemetry: enabled: true From 7d5c12d0bc093be5c5c4e29b200b24119209da37 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Fri, 6 Sep 2024 13:27:48 -0700 Subject: [PATCH 17/18] spellcheck --- cmd/poktrolld/cmd/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/poktrolld/cmd/config.go b/cmd/poktrolld/cmd/config.go index f3b586d1c..c60118d70 100644 --- a/cmd/poktrolld/cmd/config.go +++ b/cmd/poktrolld/cmd/config.go @@ -36,12 +36,15 @@ func initSDKConfig() { } // The code below changes how the default configuration files are rendered on `poktrolld init` command. This command -// is ofter used by the validator and full node runners to provision the configuration prior to starting the node. +// is often used by the validator and full node runners to provision the configuration prior to starting the node. // These are the values **WE WANT** participants to have. This doesn't guarantee the node runners won't adjust the values // but it helps making sure most of them are using the following configuration. // Worth noting that changing these values in the future won't magically update them in the existing configuration, // which makes it's important to pick the sensible defaults. +// As we use `ignite` CLI to provision the first validator it is important to note that the configuration files +// provisioned by ignite have additional overrides adjusted in ignite's `config.yml` + // initCometBFTConfig helps to override default CometBFT Config (config.toml) values. // These values are going to be rendered into the config file on `poktrolld init`. // TODO_MAINNET: Reconsider values - check `config.toml` for possible options. From d3de45872715b17050c4b65689e21f3291791432 Mon Sep 17 00:00:00 2001 From: "Dmitry K." Date: Mon, 9 Sep 2024 09:37:46 -0700 Subject: [PATCH 18/18] change wording a bit --- cmd/poktrolld/cmd/config.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/poktrolld/cmd/config.go b/cmd/poktrolld/cmd/config.go index c60118d70..914dfc161 100644 --- a/cmd/poktrolld/cmd/config.go +++ b/cmd/poktrolld/cmd/config.go @@ -35,12 +35,15 @@ func initSDKConfig() { config.Seal() } -// The code below changes how the default configuration files are rendered on `poktrolld init` command. This command -// is often used by the validator and full node runners to provision the configuration prior to starting the node. -// These are the values **WE WANT** participants to have. This doesn't guarantee the node runners won't adjust the values -// but it helps making sure most of them are using the following configuration. -// Worth noting that changing these values in the future won't magically update them in the existing configuration, -// which makes it's important to pick the sensible defaults. +// The values set here become the default configuration for newly initialized nodes. +// However, it's crucial to note that: +// 1. These defaults only apply when a node is first initialized using `poktrolld init`. +// 2. Changing these values in the code will not automatically update existing node configurations. +// 3. Node operators can still manually override these defaults in their local config files. +// +// Therefore, it's critical to choose sensible default values carefully, as they will form +// the baseline configuration for most network participants. Any future changes to these +// defaults will only affect newly initialized nodes, not existing ones. // As we use `ignite` CLI to provision the first validator it is important to note that the configuration files // provisioned by ignite have additional overrides adjusted in ignite's `config.yml`