From 5798184aa4ffa24a2ff69d8f796c17eadd75720f Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Wed, 2 Apr 2025 15:29:20 +0900 Subject: [PATCH 1/7] add cosmovisor example --- .../running-nodes/manual-setup/cosmovisor.mdx | 134 +++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-) diff --git a/developers/running-nodes/manual-setup/cosmovisor.mdx b/developers/running-nodes/manual-setup/cosmovisor.mdx index 2cb48ce3..e811b055 100644 --- a/developers/running-nodes/manual-setup/cosmovisor.mdx +++ b/developers/running-nodes/manual-setup/cosmovisor.mdx @@ -2,6 +2,136 @@ title: Cosmovisor (Optional) --- -To help simplify the process of automatically switching the `initiad` application binary versions during chain upgrades, we recommend using the [Cosmovisor](https://docs.cosmos.network/main/tooling/cosmovisor) tool. +Cosmovisor is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. -To install Cosmovisor, follow the instructions on the [Cosmovisor Cosmos SDK documentation](https://docs.cosmos.network/v0.45/run-node/cosmovisor.html). \ No newline at end of file +Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval. + +## Set up Cosmovisor + +To set up Cosmovisor, you may follow different steps depending on your specific environment. There are two main paths: + +1. **Install `initiad` Locally:** This involves installing `initiad` directly onto your local machine. +2. **Using a Prebuilt Binary of the `initiad` Program:** This involves using a prebuilt binary of the `initiad` Program. This can be particularly useful if you want to avoid the hassle of building `initiad` from source. + +Please ensure to follow the correct instructions for your specific environment to avoid any issues during setup. + +#### Install Cosmovisor + +```sh +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest + +export DAEMON_HOME=~/.initia +export DAEMON_NAME=initiad + + +cosmovisor init ~/go/bin/initiad # + +# only if there is planned upgrade +export UPGRADE_NAME= +export UPGRADE_VERSION= +mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin +( \ + cd initia && \ + git fetch --all --tags && \ + git checkout $UPGRADE_VERSION && \ + make build && \ + mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \ +) +``` + +#### Update System Service File + +```sh +[Unit] +Description=initiad + +[Service] +Type=simple +User=ubuntu +ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia +WorkingDirectory=/home/ubuntu/.initia +Restart=on-abort +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=initiad +LimitNOFILE=4096 +Environment="DAEMON_NAME=initiad" +Environment="DAEMON_HOME=/home/ubuntu/.initia" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" +Environment="DAEMON_RESTART_AFTER_UPGRADE=true" +Environment="DAEMON_RESTART_DELAY=5s" + +[Install] +WantedBy=multi-user.target +``` + +#### Restart initiad + +```sh +sudo systemctl daemon-reload +sudo systemctl restart initiad +``` + +### Using a Prebuilt Binary of initiad + +#### Set up Cosmovisor + +```sh +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest + +export DAEMON_HOME=~/.initia +export DAEMON_NAME=initiad + +cosmovisor init `` +cp `` $DAEMON_HOME/current/bin/ + +# only if there is planned upgrade +export UPGRADE_NAME= +export UPGRADE_VERSION= +mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin +cd $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin + +# download the binary and place it in the upgrades directory +# you can get the binary from https://github.com/initia-labs/initia/releases +``` + +#### 2. Update System Service File + +```bash +[Unit] +Description=initiad + +[Service] +Type=simple +User=ubuntu +ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia +WorkingDirectory=/home/ubuntu/.initia +Restart=on-abort +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=initiad +LimitNOFILE=4096 +Environment="DAEMON_NAME=initiad" +Environment="DAEMON_HOME=/home/ubuntu/.initia" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" +Environment="DAEMON_RESTART_AFTER_UPGRADE=true" +Environment="DAEMON_RESTART_DELAY=5s" +Environment="LD_LIBRARY_PATH=/home/ubuntu/.initia/cosmovisor/current/bin" + +[Install] +WantedBy=multi-user.target +``` + + +`Environment="DAEMON_RESTART_DELAY=5s"` is to prevent upgrade failure due to the node not being ready to restart. +Without this,cosmovisor may result in failed to `initialize database: resource temporarily unavailable` error. + + +#### 3. Restart initiad + +```sh +sudo systemctl daemon-reload +sudo systemctl stop initiad +rm `` # to prevent loading wrong shared library +sudo systemctl start initiad +``` From aeae9b98bdbfddd0b22f26a2f1b79870fd08d63a Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Thu, 3 Apr 2025 18:04:39 +0900 Subject: [PATCH 2/7] update contents --- .../guides/exchange-integration.mdx | 5 +- .../running-nodes/manual-setup/cosmovisor.mdx | 137 ------- docs.json | 6 +- .../becoming-a-validator.mdx | 7 +- .../running-l1-nodes/cosmovisor.mdx | 64 +++ .../running-l1-nodes/l1-nodes-initiad.mdx | 372 ++++++++++++++++++ 6 files changed, 451 insertions(+), 140 deletions(-) delete mode 100644 developers/running-nodes/manual-setup/cosmovisor.mdx create mode 100644 nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx create mode 100644 nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad.mdx diff --git a/developers/developer-guides/guides/exchange-integration.mdx b/developers/developer-guides/guides/exchange-integration.mdx index dd5a6acd..e63fa8a6 100644 --- a/developers/developer-guides/guides/exchange-integration.mdx +++ b/developers/developer-guides/guides/exchange-integration.mdx @@ -13,7 +13,10 @@ You can find the details of Initia's network, including the chain endpoints, nod ## Running a Node -For more information on running a node, please refer to [this page](/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave). +For more information on running a node, please refer to + +- [Running Initia Node with Initiad](/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad) +- [Running Initia Node with Weave](/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave). ## Creating and Managing Accounts diff --git a/developers/running-nodes/manual-setup/cosmovisor.mdx b/developers/running-nodes/manual-setup/cosmovisor.mdx deleted file mode 100644 index e811b055..00000000 --- a/developers/running-nodes/manual-setup/cosmovisor.mdx +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: Cosmovisor (Optional) ---- - -Cosmovisor is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. - -Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval. - -## Set up Cosmovisor - -To set up Cosmovisor, you may follow different steps depending on your specific environment. There are two main paths: - -1. **Install `initiad` Locally:** This involves installing `initiad` directly onto your local machine. -2. **Using a Prebuilt Binary of the `initiad` Program:** This involves using a prebuilt binary of the `initiad` Program. This can be particularly useful if you want to avoid the hassle of building `initiad` from source. - -Please ensure to follow the correct instructions for your specific environment to avoid any issues during setup. - -#### Install Cosmovisor - -```sh -go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest - -export DAEMON_HOME=~/.initia -export DAEMON_NAME=initiad - - -cosmovisor init ~/go/bin/initiad # - -# only if there is planned upgrade -export UPGRADE_NAME= -export UPGRADE_VERSION= -mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin -( \ - cd initia && \ - git fetch --all --tags && \ - git checkout $UPGRADE_VERSION && \ - make build && \ - mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \ -) -``` - -#### Update System Service File - -```sh -[Unit] -Description=initiad - -[Service] -Type=simple -User=ubuntu -ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia -WorkingDirectory=/home/ubuntu/.initia -Restart=on-abort -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=initiad -LimitNOFILE=4096 -Environment="DAEMON_NAME=initiad" -Environment="DAEMON_HOME=/home/ubuntu/.initia" -Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" -Environment="DAEMON_RESTART_AFTER_UPGRADE=true" -Environment="DAEMON_RESTART_DELAY=5s" - -[Install] -WantedBy=multi-user.target -``` - -#### Restart initiad - -```sh -sudo systemctl daemon-reload -sudo systemctl restart initiad -``` - -### Using a Prebuilt Binary of initiad - -#### Set up Cosmovisor - -```sh -go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest - -export DAEMON_HOME=~/.initia -export DAEMON_NAME=initiad - -cosmovisor init `` -cp `` $DAEMON_HOME/current/bin/ - -# only if there is planned upgrade -export UPGRADE_NAME= -export UPGRADE_VERSION= -mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin -cd $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin - -# download the binary and place it in the upgrades directory -# you can get the binary from https://github.com/initia-labs/initia/releases -``` - -#### 2. Update System Service File - -```bash -[Unit] -Description=initiad - -[Service] -Type=simple -User=ubuntu -ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia -WorkingDirectory=/home/ubuntu/.initia -Restart=on-abort -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=initiad -LimitNOFILE=4096 -Environment="DAEMON_NAME=initiad" -Environment="DAEMON_HOME=/home/ubuntu/.initia" -Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" -Environment="DAEMON_RESTART_AFTER_UPGRADE=true" -Environment="DAEMON_RESTART_DELAY=5s" -Environment="LD_LIBRARY_PATH=/home/ubuntu/.initia/cosmovisor/current/bin" - -[Install] -WantedBy=multi-user.target -``` - - -`Environment="DAEMON_RESTART_DELAY=5s"` is to prevent upgrade failure due to the node not being ready to restart. -Without this,cosmovisor may result in failed to `initialize database: resource temporarily unavailable` error. - - -#### 3. Restart initiad - -```sh -sudo systemctl daemon-reload -sudo systemctl stop initiad -rm `` # to prevent loading wrong shared library -sudo systemctl start initiad -``` diff --git a/docs.json b/docs.json index 7841cc81..4d48f73a 100644 --- a/docs.json +++ b/docs.json @@ -133,7 +133,11 @@ "pages": [ { "group": "Running Initia L1 Nodes", - "pages": ["nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave"] + "pages": [ + "nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad", + "nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-weave", + "nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor" + ] }, { "group": "Running a Validator", diff --git a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx index 70169640..17885d90 100644 --- a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx +++ b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx @@ -66,7 +66,12 @@ Only the top 100 validators in voting power are included in the active validator -Initia validators are also required to run the Connect Oracle Sidecar. For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart). + +Initia validators are also required to run the Connect Oracle Sidecar. + +Please refer to [this section](/nodes-and-rollups/running-nodes/running-a-validator/oracle-sidecar.mdx) for further instructions. + +For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart). diff --git a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx new file mode 100644 index 00000000..1e6cfd17 --- /dev/null +++ b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx @@ -0,0 +1,64 @@ +--- +title: Cosmovisor (Optional) +--- + +[Cosmovisor](https://docs.cosmos.network/v0.52/build/tooling/cosmovisor) is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. + +Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval. + +## 1. Install Cosmovisor + +```sh +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest + +export DAEMON_HOME=~/.initia +export DAEMON_NAME=initiad + + +cosmovisor init ~/go/bin/initiad # + +# only if there is planned upgrade +export UPGRADE_NAME= +export UPGRADE_VERSION= +mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin +( \ + cd initia && \ + git fetch --all --tags && \ + git checkout $UPGRADE_VERSION && \ + make build && \ + mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \ +) +``` + +## 2. Update System Service File + +```sh +[Unit] +Description=initiad + +[Service] +Type=simple +User=ubuntu +ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia +WorkingDirectory=/home/ubuntu/.initia +Restart=on-abort +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=initiad +LimitNOFILE=4096 +Environment="DAEMON_NAME=initiad" +Environment="DAEMON_HOME=/home/ubuntu/.initia" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" +Environment="DAEMON_RESTART_AFTER_UPGRADE=true" +Environment="DAEMON_RESTART_DELAY=5s" + +[Install] +WantedBy=multi-user.target +``` + +#### 3. Restart initiad + +```sh +sudo systemctl daemon-reload +sudo systemctl restart initiad +``` \ No newline at end of file diff --git a/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad.mdx b/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad.mdx new file mode 100644 index 00000000..263f019c --- /dev/null +++ b/nodes-and-rollups/running-nodes/running-l1-nodes/l1-nodes-initiad.mdx @@ -0,0 +1,372 @@ +--- +title: Running L1 Nodes with Initiad +--- + +## Running Initia Node + +## Prerequisites + +The minimum hardware requirements for running an Initia node are: + +- CPU: 16 cores +- Memory: 32GB RAM +- Disk: 2 TB NVMe/SSD Storage with Write Throughput > 1000 MiBps +- Bandwidth: 100 Mbps + + +It is recommended to use Linux OS to run Initia nodes. Running Initia node has not been tested on other OS environments, and same environment settings and running conditions cannot be guaranteed. + + +#### Install Initia + +Installing Initia can be done in 2 different ways. + +1. Downloading the source and directly building Initia. + + + + +To build Initia, essential utilities must be installed. + +These utilities are provided on Linux distribution, and package components for Ubuntu can be found in the following link: + +- [x] Ubuntu [focal](https://packages.ubuntu.com/focal/build-essential) / [jammy](https://packages.ubuntu.com/jammy/build-essential) + +```bash +sudo apt install -y build-essential +``` + + + + +[golang v1.22](https://go.dev/doc/install) or above is required. + +Refer to the link to find out how to install Golang and use the command below to check the version. + +```bash +make --version # 3.8 or later +go version # 1.22 or later +``` + + + + +Clone and build the [Initia source code repo](https://github.com/initia-labs/initia). + +```bash +git clone git@github.com:initia-labs/initia.git +cd initia +git checkout $TAG # Tag the desired version +make install +``` + +Use the command below to check if the installation is successful. + + +If `initiad` is not found, run `go env` and check if `$GOBIN` or `$GOPATH/bin` directories are included in $PATH. + + +```bash +initiad version +``` + + + + + +2. Using prebuilt binaries + +You can download pre-built binaries for each of Testnet or Mainnet from the [initia repository](https://github.com/initia-labs/initia/releases). + +Download the compression file for your OS. + +#### Set Up Environment + +On Linux, the number of files that can be opened in a single process can be set on configuration. Many Linux distributions limit the number to 1024, which is smaller than the number of files opened by Initia. To use Initia, this configuration has to be modified. + +The current value can be checked with `ulimit -n` command, and root `/etc/security/limits.conf` file can be modified to change this parameter. By adding the below to `limits.conf` the maximum for all accounts can be increased to 65535. To only modify the number for the account running Initia, enter the account name instead of `*`. + +```bash +* soft nofile 65535 +* hard nofile 65535 +``` + +## Boot an Initia Node + +#### Initia basic setup + +The HOME directory used in this section is the default value `${HOME}/.initia`. To set a different directory, add `--home ` option on each command and use a different directory as Initia's HOME directory. + + + +Use the command below to initialize the Initia Node. + +```bash +initiad init +``` + +A moniker is a human-readable name for your node. Moniker can contain only ASCII characters, and cannot exceed 70 characters. + +Your private key is generated during the initialization, and is saved in `${HOME}/.initia/config/priv_validator_key.json`. + + +Remember to backup your private key if you are running a validator node. +If a private key is lost, node may never be recoverable from a hardware failure. +Plan your back up through running a Testnet node, and secure your private key safely for the mainnet. + + + + +Initia supports the below endpoints for external communications. + + Validator nodes are not recommended to open any of these endpoints. + +- REST: RESTful HTTP API +- gRPC/gRPC-WEB: gRPC API +- RPC: Tendermint/CometBFT provided API +- P2P: Gossip P2P with outher Initia nodes + +You can modify the below config values to turn on/off each Endpoint and change ports. + +| **Type** | **Config File Name** | **Item** | +|---------------|-----------------------------|--------------------------| +| **REST** | `~/.initia/config/app.toml` | `api.enable`: Enable / disable LCD | +| | | `api.swagger`: Enable / disable swagger | +| | | `api.address`: Listen address for LCD | +| **gRPC/gRPC-WEB** | `~/.initia/config/app.toml` | `grpc.enable`: Enable / disable GRPC | +| | | `grpc.address`: Listen address for GRPC | +| | | `grpc-web.enable`: Enable / disable GRPC-WEB | +| | | `grpc-web.address`: Listen address for GRPC-WEB | +| **RPC** | `~/.initia/config/config.toml` | `rpc.laddr`: Listen address for RPC | +| **P2P** | `~/.initia/config/config.toml` | `p2p.laddr`: Listen address for P2P | + +The below is a config example which enables all endpoints and listens to 0.0.0.0 as a default port. Modify your config accordingly. + +- `~/.initia/config/app.toml` + +```toml +# ... + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = true + +# Swagger defines if swagger documentation should automatically be registered. +swagger = true + +# Address defines the API server to listen on. +address = "tcp://0.0.0.0:1317" + +# ... + + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "0.0.0.0:9090" + +# ... + +############################################################################### +### 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. +enable = true + +# Address defines the gRPC-web server address to bind to. +address = "0.0.0.0:9091" + +# ... +``` + +- `~/.initia/config/config.toml` + +```toml +# ... + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://0.0.0.0:26657" + +# ... + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# ... +``` + + + + +To allow access from external nodes to your node through P2P network, config.toml has to be modified. By entering public IP/Port to p2p.external_address field, the network settings will allow external nodes to access your node. + +The below is an example, and the values can be modified through sed, jq, and curl command lines. + +```toml +####################################################### +### 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 or use UPnP +# to figure out the address. ip and port are required +# example: 159.89.10.97:26656 +external_address = "159.89.10.97:26656" +``` + +Below command line requires sed, curl and jq to be installed, and sets all ports to the default value: 26656. + +```bash +#!/usr/bash + +sed -i -e 's/external_address = \"\"/external_address = \"'$(curl httpbin.org/ip | jq -r .origin)':26656\"/g' ~/.initia/config/config.toml +``` + + + + +All local settings are completed. But to run `initiad` as a blockchain node, the node has to fetch genesis block information and be set to communicate with other nodes. + +Refer to [Connect to Initia Network](#connect-to-initia-network) section for more information. + +The below section is optional, but contains information on how to register the Initia daemon to the service to make it easier to run and manage. Note that this can help you run smoothly. + + + + +Easily run and manage Initia by registering it as a Linux Service. The below example uses initiad as a service name. + +1. Open `/etc/systemd/system/initiad.service` as `root` permission and enter the below information: + +- Modify the Service section to match your env settings before saving + - User: Account name to run `initiad` (Below example: ubuntu) + - ExecStart: Directory where `initiad` is installed + `start` (Below example: `/user/bin initiad start`) + +```bash +[Unit] +Description=initiad + +[Service] +Type=simple +User=ubuntu +ExecStart=/usr/bin/initiad start +Restart=on-abort +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=initiad +LimitNOFILE=65535 + +[Install] +WantedBy=multi-user.target +``` + +2. Run the below command line to activate initiad service. root permission might be required. + +```bash +systemctl enable initiad +``` + +3. The below command line can be used to start or stop Initia service. root permission might be required. + +- Start: `systemctl start initiad` +- Stop: `systemctl stop initiad` + +4. To apply the changes to `/etc/systemd/system/initiad.service`, run the below command line. This might require `root` permission, and to apply changes to a running node, a restart is required. + +```bash +systemctl daemon-reload +systemctl restart initiad +``` + +5. All logs from initiad resulting from step 1 are recorded on syslog. Use the below commands to check initiad's logs. + +```bash +journalctl -t initiad # Shows the current logs and ends. Can be used with the below options +journalctl -t initiad -f # Tracks and shows the most recent logs. +journalctl -t initiad -n # Shows the recent log at line +``` + + + + + +## Connect to Initia Network + +To establish a connection with the Initia Mainnet or Testnet, it is essential to obtain information about the genesis block and nodes currently connected to these networks. + +The necessary information on known peers can be accessed through [initia-registry](https://github.com/initia-labs/initia-registry/blob/main/mainnets/initia/chain.json). + +By adhering to the subsequent steps outlined in this document, you will be able to operate an Initia node and monitor logs pertaining to block synchronization. + +#### Genesis File + +For `genesis.json`, you can use the below command line: + +```bash +curl -s https://rpc.initia.xyz/genesis | jq -r '.result.genesis' > genesis.json +``` + +#### Accessing Network Information + +For network connectivity, utilize the publicly available persistent peer information, or alternatively, gather peer information from the `addrbook.json` file of a node that is already operational. + +#### Persistent Peer Configuration + +Information on known peers for each network is available within the network-specific repositories linked above. Choose an appropriate network, then apply the corresponding values to `p2p.persistent_peers` in the `~/.initia/config/config.toml` file. + +The below is an example: + +```bash +persistent_peers = "093e1b89a498b6a8760ad2188fbda30a05e4f300@35.240.207.217:26656,2c729d33d22d8cdae6658bed97b3097241ca586c@195.14.6.129:26019” +``` + +#### State Sync & Snapshot + +Validators on Initia can now join the network using state sync and snapshot. For more details, please visit below sites. + +| **Provider** | **URL** | +| ------------ | ------- | +| Polkachu | https://polkachu.com/testnets/initia/snapshots | +| bwarelabs | https://bwarelabs.com/snapshots/initia | + +#### Address Book + +We highly recommend to copy `addrbook.json` to `$INITIA_HOME/config/addrbook.json` for fast peer connection. + +```bash +# stop initiad +wget https://initia.s3.ap-southeast-1.amazonaws.com/interwoven-1/addrbook.json +mv addrbook.json ~/.initia/config/addrbook.json +# start initiad +``` \ No newline at end of file From 4ce0b049ccbb5a0af1d9a7009dbaf45e2c30bead Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Thu, 3 Apr 2025 18:09:12 +0900 Subject: [PATCH 3/7] update contetns --- .../running-nodes/running-a-validator/becoming-a-validator.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx index 17885d90..9269c965 100644 --- a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx +++ b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx @@ -69,8 +69,6 @@ Only the top 100 validators in voting power are included in the active validator Initia validators are also required to run the Connect Oracle Sidecar. -Please refer to [this section](/nodes-and-rollups/running-nodes/running-a-validator/oracle-sidecar.mdx) for further instructions. - For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart). From 4095105394e68efea34b47872145f1658db65168 Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Wed, 21 May 2025 16:22:08 +0900 Subject: [PATCH 4/7] update contetns --- .../developer-guides/tools/clis/initiad-cli/accounts.mdx | 4 ++-- .../running-nodes/running-l1-nodes/cosmovisor.mdx | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx b/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx index 28870c26..35bda89e 100644 --- a/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx +++ b/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx @@ -32,9 +32,9 @@ export ETH_COIN_TYPE=60 initiad keys add $ACCOUNT_NAME --key-type $ETH_KEY_TYPE --coin-type $ETH_COIN_TYPE ``` - + Even with the same mnemonic phrase, the derived addresses differ because the method of generating the public key varies, leading to each account being treated separately. - + ## Importing an Account diff --git a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx index 1e6cfd17..4f4de6cb 100644 --- a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx +++ b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx @@ -48,14 +48,19 @@ SyslogIdentifier=initiad LimitNOFILE=4096 Environment="DAEMON_NAME=initiad" Environment="DAEMON_HOME=/home/ubuntu/.initia" -Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" +Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" Environment="DAEMON_RESTART_AFTER_UPGRADE=true" Environment="DAEMON_RESTART_DELAY=5s" +Environment="UNSAFE_SKIP_BACKUP=true" [Install] WantedBy=multi-user.target ``` + +To update the node manually, set the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES=false`. This disables automatic binary downloads. Afterward, download the required binary yourself and place it in the designated installation directory. + + #### 3. Restart initiad ```sh From cf6b5abe0bba30d1dbe28f17da615465a59d04df Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Tue, 29 Jul 2025 14:28:12 +0900 Subject: [PATCH 5/7] use steps --- .../running-l1-nodes/cosmovisor.mdx | 113 +++++++++--------- 1 file changed, 55 insertions(+), 58 deletions(-) diff --git a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx index 4f4de6cb..c7ac3cb2 100644 --- a/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx +++ b/nodes-and-rollups/running-nodes/running-l1-nodes/cosmovisor.mdx @@ -2,68 +2,65 @@ title: Cosmovisor (Optional) --- -[Cosmovisor](https://docs.cosmos.network/v0.52/build/tooling/cosmovisor) is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. +[Cosmovisor](https://docs.cosmos.network/v0.52/build/tooling/cosmovisor) is a comprehensive process manager that can serve as an easy substitute for the standard `initiad start` command. It is designed for both manual use and as a system service, offering automatic updates for blockchains based on the Cosmos SDK. Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval. -Cosmovisor's main role is to keep track of software upgrade proposal signals and automatically download and update the node to the new binary following proposal approval. + + + ```sh + go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest -## 1. Install Cosmovisor + export DAEMON_HOME=~/.initia + export DAEMON_NAME=initiad -```sh -go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest + cosmovisor init ~/go/bin/initiad # -export DAEMON_HOME=~/.initia -export DAEMON_NAME=initiad + # only if there is planned upgrade + export UPGRADE_NAME= + export UPGRADE_VERSION= + mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin + ( \ + cd initia && \ + git fetch --all --tags && \ + git checkout $UPGRADE_VERSION && \ + make build && \ + mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \ + ) + ``` + + + ```sh + [Unit] + Description=initiad + [Service] + Type=simple + User=ubuntu + ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia + WorkingDirectory=/home/ubuntu/.initia + Restart=on-abort + StandardOutput=syslog + StandardError=syslog + SyslogIdentifier=initiad + LimitNOFILE=4096 + Environment="DAEMON_NAME=initiad" + Environment="DAEMON_HOME=/home/ubuntu/.initia" + Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" + Environment="DAEMON_RESTART_AFTER_UPGRADE=true" + Environment="DAEMON_RESTART_DELAY=5s" + Environment="UNSAFE_SKIP_BACKUP=true" -cosmovisor init ~/go/bin/initiad # + [Install] + WantedBy=multi-user.target + ``` -# only if there is planned upgrade -export UPGRADE_NAME= -export UPGRADE_VERSION= -mkdir -p $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin -( \ - cd initia && \ - git fetch --all --tags && \ - git checkout $UPGRADE_VERSION && \ - make build && \ - mv ./build/initiad $DAEMON_HOME/cosmovisor/upgrades/$UPGRADE_NAME/bin/ \ -) -``` - -## 2. Update System Service File - -```sh -[Unit] -Description=initiad - -[Service] -Type=simple -User=ubuntu -ExecStart=/home/ubuntu/go/bin/cosmovisor run start --home /home/ubuntu/.initia -WorkingDirectory=/home/ubuntu/.initia -Restart=on-abort -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=initiad -LimitNOFILE=4096 -Environment="DAEMON_NAME=initiad" -Environment="DAEMON_HOME=/home/ubuntu/.initia" -Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" -Environment="DAEMON_RESTART_AFTER_UPGRADE=true" -Environment="DAEMON_RESTART_DELAY=5s" -Environment="UNSAFE_SKIP_BACKUP=true" - -[Install] -WantedBy=multi-user.target -``` - - -To update the node manually, set the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES=false`. This disables automatic binary downloads. Afterward, download the required binary yourself and place it in the designated installation directory. - - -#### 3. Restart initiad - -```sh -sudo systemctl daemon-reload -sudo systemctl restart initiad -``` \ No newline at end of file + + To update the node manually, set the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES=false`. This disables automatic binary downloads. Afterward, download the required binary yourself and place it in the designated installation directory. + + + + ```sh + sudo systemctl daemon-reload + sudo systemctl restart initiad + ``` + + \ No newline at end of file From 986f4e0f87a3d1051fcfa337fdde87e24af9fd2f Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Tue, 29 Jul 2025 14:39:31 +0900 Subject: [PATCH 6/7] update contents --- .../running-a-validator/becoming-a-validator.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx index 9269c965..c0e11410 100644 --- a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx +++ b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx @@ -67,9 +67,7 @@ Only the top 100 validators in voting power are included in the active validator -Initia validators are also required to run the Connect Oracle Sidecar. - -For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart). +Initia validators are also required to run the Connect Oracle Sidecar. For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart). From b1675ca913fb253909fc42ff8c9913c232d146fe Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Tue, 29 Jul 2025 14:40:44 +0900 Subject: [PATCH 7/7] clean up --- .../developer-guides/tools/clis/initiad-cli/accounts.mdx | 4 ++-- .../running-a-validator/becoming-a-validator.mdx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx b/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx index 35bda89e..28870c26 100644 --- a/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx +++ b/developers/developer-guides/tools/clis/initiad-cli/accounts.mdx @@ -32,9 +32,9 @@ export ETH_COIN_TYPE=60 initiad keys add $ACCOUNT_NAME --key-type $ETH_KEY_TYPE --coin-type $ETH_COIN_TYPE ``` - + Even with the same mnemonic phrase, the derived addresses differ because the method of generating the public key varies, leading to each account being treated separately. - + ## Importing an Account diff --git a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx index c0e11410..70169640 100644 --- a/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx +++ b/nodes-and-rollups/running-nodes/running-a-validator/becoming-a-validator.mdx @@ -66,7 +66,6 @@ Only the top 100 validators in voting power are included in the active validator - Initia validators are also required to run the Connect Oracle Sidecar. For more information on how to run the sidecar, please refer to the [Skip Connect documentation](https://docs.skip.build/connect/validators/quickstart).