├── assets ├── Initia-Banner.png └── Initia-Oracle-Banner.png ├── oracle └── README.md └── README.md /assets/Initia-Banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trusted-point/initia-tools/HEAD/assets/Initia-Banner.png -------------------------------------------------------------------------------- /assets/Initia-Oracle-Banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trusted-point/initia-tools/HEAD/assets/Initia-Oracle-Banner.png -------------------------------------------------------------------------------- /oracle/README.md: -------------------------------------------------------------------------------- 1 | [banner]() 2 | 3 | # Overview 4 | **[Slinky](https://github.com/skip-mev/slinky/)** is a general-purpose price oracle leveraging ABCI++. 5 | 6 | ## Components 7 | 8 | The Slinky Oracle consists of two main elements: 9 | 10 | 1. **On-Chain Component** 11 | - Retrieves price data from the sidecar with each block. 12 | - Forwards these prices to the blockchain through vote extensions. 13 | - Compiles prices from all validators involved. 14 | 15 | 2. **Sidecar Process** 16 | - Dedicated to polling price information from various providers. 17 | - Delivers this data to the on-chain component. 18 | 19 | ### Navigation Menu 20 | - [Overview](#overview) 21 | - [Components](#components) 22 | - [Navigation Menu](#navigation-menu) 23 | - [Hardware requirements](#hardware-requirements) 24 | - [Config](#config) 25 | - [Installation guide](#installation-guide) 26 | - [1. Install required packages](#1-install-required-packages) 27 | - [2. Install Go](#2-install-go) 28 | - [3. Install `slinky` binary](#3-install-slinky-binary) 29 | - [4. Set Up Variables](#4-set-up-variables) 30 | - [5. Update oracle configuration](#5-update-oracle-configuration) 31 | - [6. Create a Service File](#6-create-a-service-file) 32 | - [7. Start the Oracle](#7-start-the-oracle) 33 | - [8. Validating Prices](#8-validating-prices) 34 | - [9. Enable Oracle Vote Extension](#9-enable-oracle-vote-extension) 35 | - [Monitoring](#monitoring) 36 | - [Oracle Service Metrics](#oracle-service-metrics) 37 | - [Oracle Application Metrics](#oracle-application-metrics) 38 | - [Useful commands](#useful-commands) 39 | - [Monitor server load](#monitor-server-load) 40 | - [Check logs of the oracle](#check-logs-of-the-oracle) 41 | - [Restart the oracle](#restart-the-oracle) 42 | - [Upgrade the oracle](#upgrade-the-oracle) 43 | - [Stop the oracle](#stop-the-oracle) 44 | - [Delete the oracle from the server](#delete-the-oracle-from-the-server) 45 | 46 | ## Hardware requirements 47 | ```py 48 | - Memory: 16 GB RAM 49 | - CPU: 4 cores 50 | - Bandwidth: 1 Gbps 51 | - Linux amd64 arm64 (Ubuntu LTS release) 52 | ``` 53 | 54 | ## Config 55 | 56 | To operate the oracle sidecar, it is essential to have valid configuration files for both the oracle component and the market component. The oracle executable recognizes flags that specify each configuration file. Below are recommended default settings suitable for the existing Initia Devnet environment. 57 | 58 | 1. **Oracle Component** 59 | - Determines how often to poll price providers. 60 | - Manages multiplexing behavior of websockets and more. 61 | - This configuration has been tested by Skip and is safe to use. 62 | - The recommended oracle component configuration can be found in `config/core/oracle.json` within the Slinky repo. 63 | 64 | 2. **Market Component** 65 | - Determines which markets the sidecar should fetch prices for. 66 | - The desired markets will be stored on-chain and pulled by the sidecar. 67 | - To properly configure the sidecar, you must point the sidecar to the GRPC port on a node (typically port 9090). This can be done by: 68 | - Adding the `--market-map-endpoint` flag when starting the sidecar. 69 | - Modifying the `oracle.json` component as shown below: 70 | 71 | ```json 72 | { 73 | "market_map_endpoint": "http://localhost:9090" 74 | } 75 | ``` 76 | 77 | ## Installation guide 78 | 79 | ### 1. Install required packages 80 | ```bash 81 | sudo apt update && \ 82 | sudo apt install curl git jq build-essential gcc unzip wget -y 83 | ``` 84 | 85 | ### 2. Install Go 86 | ```bash 87 | cd $HOME && \ 88 | ver="1.22.2" && \ 89 | wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \ 90 | sudo rm -rf /usr/local/go && \ 91 | sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \ 92 | rm "go$ver.linux-amd64.tar.gz" && \ 93 | echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \ 94 | source $HOME/.bash_profile && \ 95 | go version 96 | ``` 97 | 98 | ### 3. Install `slinky` binary 99 | ```bash 100 | cd $HOME && \ 101 | ver="v0.4.3" && \ 102 | git clone https://github.com/skip-mev/slinky.git && \ 103 | cd slinky && \ 104 | git checkout $ver && \ 105 | make build && \ 106 | mv build/slinky /usr/local/bin/ 107 | ``` 108 | 109 | ### 4. Set Up Variables 110 | 111 | Set up the necessary environment variables for the oracle sidecar. The `NODE_GRPC_ENDPOINT` should point to the Initia node (validator) gRPC endpoint, which typically runs on port 9090. The `ORACLE_CONFIG_PATH` should point to the local path of the oracle configuration file. The `ORACLE_GRPC_PORT` is the default port for the GRPC server, and the `ORACLE_METRICS_ENDPOINT` is the default Prometheus metrics endpoint. 112 | 113 | ```bash 114 | echo 'export NODE_GRPC_ENDPOINT="0.0.0.0:9090"' >> ~/.bash_profile 115 | echo 'export ORACLE_CONFIG_PATH="$HOME/slinky/config/core/oracle.json"' >> ~/.bash_profile 116 | echo 'export ORACLE_GRPC_PORT="8080"' >> ~/.bash_profile 117 | echo 'export ORACLE_METRICS_ENDPOINT="0.0.0.0:8002"' >> ~/.bash_profile 118 | source $HOME/.bash_profile 119 | ``` 120 | 121 | ### 5. Update oracle configuration 122 | ```bash 123 | sed -i "s|\"url\": \".*\"|\"url\": \"$NODE_GRPC_ENDPOINT\"|" $ORACLE_CONFIG_PATH 124 | sed -i "s|\"prometheusServerAddress\": \".*\"|\"prometheusServerAddress\": \"$ORACLE_METRICS_ENDPOINT\"|" $ORACLE_CONFIG_PATH 125 | sed -i "s|\"port\": \".*\"|\"port\": \"$ORACLE_GRPC_PORT\"|" $ORACLE_CONFIG_PATH 126 | ``` 127 | 128 | ### 6. Create a Service File 129 | 130 | Create a systemd service file to manage the Initia Oracle. 131 | 132 | ```bash 133 | sudo tee /etc/systemd/system/initia-oracle.service > /dev/null <]() 2 | 3 |
About Initia
4 | 5 | * ### **[Initia](https://initia.xyz/)** is a pioneering network for interwoven rollups, revolutionizing blockchain by simplifying complexity and providing a unified platform akin to using your favorite smartphone, inspired by Apple's design philosophy. 6 | 7 |
8 | Website 9 | Github 10 | Twitter 11 | Discord 12 | Blog 13 |
14 | 15 | ### Navigation Menu 16 | - [Hardware requirements](#hardware-requirements) 17 | - [TrustedPoint Services](#trustedpoint-services) 18 | - [Installation guide](#installation-guide) 19 | - [1. Install required packages](#1-install-required-packages) 20 | - [2. Install Go](#2-install-go) 21 | - [3. Install `initia` binary](#3-install-initia-binary) 22 | - [4. Set up variables](#4-set-up-variables) 23 | - [5. Initialize the node](#5-initialize-the-node) 24 | - [6. Download genesis.json](#6-download-genesisjson) 25 | - [7. Add seeds and peers to the config.toml](#7-add-seeds-and-peers-to-the-configtoml) 26 | - [8. Change ports (Optional)](#8-change-ports-optional) 27 | - [9. Configure prunning to save storage (Optional)](#9-configure-prunning-to-save-storage-optional) 28 | - [10. Set min gas price](#10-set-min-gas-price) 29 | - [11. Enable indexer (Optional)](#11-enable-indexer-optional) 30 | - [12. Create a service file](#12-create-a-service-file) 31 | - [13. Start the node](#13-start-the-node) 32 | - [14. Create a wallet for your validator](#14-create-a-wallet-for-your-validator) 33 | - [15. Request tokens from the faucet on Discord](#15-request-tokens-from-the-faucet-on-discord) 34 | - [16. Check wallet balance](#16-check-wallet-balance) 35 | - [17. Create a validator](#17-create-a-validator) 36 | - [State sync](#state-sync) 37 | - [1. Stop the node](#1-stop-the-node) 38 | - [2. Backup priv\_validator\_state.json](#2-backup-priv_validator_statejson) 39 | - [3. Reset DB](#3-reset-db) 40 | - [4. Setup required variables (One command)](#4-setup-required-variables-one-command) 41 | - [4. Move priv\_validator\_state.json back](#4-move-priv_validator_statejson-back) 42 | - [5. Start the node](#5-start-the-node) 43 | - [6. Check the synchronization status](#6-check-the-synchronization-status) 44 | - [7. Disable state sync](#7-disable-state-sync) 45 | - [Download fresh addrbook.json](#download-fresh-addrbookjson) 46 | - [1. Stop the node and use `wget` to download the file](#1-stop-the-node-and-use-wget-to-download-the-file) 47 | - [2. Restart the node](#2-restart-the-node) 48 | - [3. Check the synchronization status](#3-check-the-synchronization-status) 49 | - [Add fresh persistent peers](#add-fresh-persistent-peers) 50 | - [1. Extract persistent\_peers from our endpoint](#1-extract-persistent_peers-from-our-endpoint) 51 | - [2. Restart the node](#2-restart-the-node-1) 52 | - [3. Check the synchronization status](#3-check-the-synchronization-status-1) 53 | - [Download Snapshot](#download-snapshot) 54 | - [1. Download latest snapshot from our endpoint](#1-download-latest-snapshot-from-our-endpoint) 55 | - [2. Stop the node](#2-stop-the-node) 56 | - [3. Backup priv\_validator\_state.json](#3-backup-priv_validator_statejson) 57 | - [4. Reset DB](#4-reset-db) 58 | - [5. Extract files from the archive](#5-extract-files-fromt-the-arvhive) 59 | - [6. Move priv\_validator\_state.json back](#6-move-priv_validator_statejson-back) 60 | - [7. Restart the node](#7-restart-the-node) 61 | - [8. Check the synchronization status](#8-check-the-synchronization-status) 62 | - [Useful commands](#useful-commands) 63 | - [Check node status](#check-node-status) 64 | - [Query your validator](#query-your-validator) 65 | - [Query missed blocks counter \& jail details of your validator](#query-missed-blocks-counter--jail-details-of-your-validator) 66 | - [Unjail your validator](#unjail-your-validator) 67 | - [Delegate tokens to your validator](#delegate-tokens-to-your-validator) 68 | - [Get your p2p peer address](#get-your-p2p-peer-address) 69 | - [Edit your validator](#edit-your-validator) 70 | - [Send tokens between wallets](#send-tokens-between-wallets) 71 | - [Query your wallet balance](#query-your-wallet-balance) 72 | - [Monitor server load](#monitor-server-load) 73 | - [Query active validators](#query-active-validators) 74 | - [Query inactive validators](#query-inactive-validators) 75 | - [Check logs of the node](#check-logs-of-the-node) 76 | - [Restart the node](#restart-the-node) 77 | - [Stop the node](#stop-the-node) 78 | - [Delete the node from the server](#delete-the-node-from-the-server) 79 | - [Example gRPC usage](#example-grpc-usage) 80 | - [Example REST API query](#example-rest-api-query) 81 | 82 | ## Hardware requirements 83 | ```py 84 | - Memory: 16 GB RAM 85 | - CPU: 4 cores 86 | - Disk: 1 TB SSD 87 | - Bandwidth: 1 Gbps 88 | - Linux amd64 arm64 (Ubuntu LTS release) 89 | ``` 90 | ## TrustedPoint Services 91 | 92 | | Parameter | Value 93 | |-|- 94 | | indexing | kv 95 | | pruning | custom (100/17) 96 | | min-retain-blocks | 0 97 | | snapshot-interval | 2000 98 | | snapshot-keep-recent | 2 99 | | minimum-gas-prices | 0.15uinit 100 | 101 | --- 102 | - RPC: https://rpc-initia-testnet.trusted-point.com:443 103 | - REST API: https://rpc-initia-testnet.trusted-point.com:443 104 | - WSS: wss://rpc-initia-testnet.trusted-point.com:443/websocket 105 | - P2P Persistent Peer: a63a6f6eae66b5dce57f5c568cdb0a79923a4e18@peer-initia-testnet.trusted-point.com:26628 106 | --- 107 | - State sync: [Guide](#state-sync) 108 | - Fresh Snapshot: [URL](https://rpc-initia-testnet.trusted-point.com/latest_snapshot.tar.lz4) / [Guide](#download-snapshot) **(Being updated every 10 hours)** 109 | - Fresh addrbook: [URL](https://rpc-initia-testnet.trusted-point.com/addrbook.json) / [Guide](#download-fresh-addrbookjson) **(Being updated every 5 minutes)** 110 | - Live Peers scanner: [URL](https://rpc-initia-testnet.trusted-point.com/peers.txt) / [Guide](#add-fresh-persistent-peers) **(Being updated every 5 minutes)** 111 | 112 | ## Installation guide 113 | 114 | ### 1. Install required packages 115 | ```bash 116 | sudo apt update && \ 117 | sudo apt install curl git jq build-essential gcc unzip wget lz4 -y 118 | ``` 119 | ### 2. Install Go 120 | ```bash 121 | cd $HOME && \ 122 | ver="1.22.0" && \ 123 | wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \ 124 | sudo rm -rf /usr/local/go && \ 125 | sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \ 126 | rm "go$ver.linux-amd64.tar.gz" && \ 127 | echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \ 128 | source $HOME/.bash_profile && \ 129 | go version 130 | ``` 131 | ### 3. Install `initia` binary 132 | ```bash 133 | git clone https://github.com/initia-labs/initia.git 134 | cd initia 135 | git checkout v0.2.15 136 | make install 137 | initiad version 138 | ``` 139 | ### 4. Set up variables 140 | ```bash 141 | # Customize if you need 142 | echo 'export MONIKER="My_Node"' >> ~/.bash_profile 143 | echo 'export CHAIN_ID="initiation-1"' >> ~/.bash_profile 144 | echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile 145 | echo 'export RPC_PORT="26657"' >> ~/.bash_profile 146 | source $HOME/.bash_profile 147 | ``` 148 | ### 5. Initialize the node 149 | ```bash 150 | cd $HOME 151 | initiad init $MONIKER --chain-id $CHAIN_ID 152 | initiad config set client chain-id $CHAIN_ID 153 | initiad config set client node tcp://localhost:$RPC_PORT 154 | initiad config set client keyring-backend os # You can set it to "test" so you will not be asked for a password 155 | ``` 156 | ### 6. Download genesis.json 157 | ```bash 158 | wget https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/genesis.json -O $HOME/.initia/config/genesis.json 159 | ``` 160 | ### 7. Add seeds and peers to the config.toml 161 | ```bash 162 | PEERS="e3ac92ce5b790c76ce07c5fa3b257d83a517f2f6@178.18.251.146:30656,2692225700832eb9b46c7b3fc6e4dea2ec044a78@34.126.156.141:26656,2a574706e4a1eba0e5e46733c232849778faf93b@84.247.137.184:53456,40d3f977d97d3c02bd5835070cc139f289e774da@168.119.10.134:26313,1f6633bc18eb06b6c0cab97d72c585a6d7a207bc@65.109.59.22:25756,4a988797d8d8473888640b76d7d238b86ce84a2c@23.158.24.168:26656,e3679e68616b2cd66908c460d0371ac3ed7795aa@176.34.17.102:26656,d2a8a00cd5c4431deb899bc39a057b8d8695be9e@138.201.37.195:53456,329227cf8632240914511faa9b43050a34aa863e@43.131.13.84:26656,517c8e70f2a20b8a3179a30fe6eb3ad80c407c07@37.60.231.212:26656,07632ab562028c3394ee8e78823069bfc8de7b4c@37.27.52.25:19656,028999a1696b45863ff84df12ebf2aebc5d40c2d@37.27.48.77:26656,3c44f7dbb473fee6d6e5471f22fa8d8095bd3969@185.219.142.137:53456,8db320e665dbe123af20c4a5c667a17dc146f4d0@51.75.144.149:26656,c424044f3249e73c050a7b45eb6561b52d0db456@158.220.124.183:53456,767fdcfdb0998209834b929c59a2b57d474cc496@207.148.114.112:26656,edcc2c7098c42ee348e50ac2242ff897f51405e9@65.109.34.205:36656,140c332230ac19f118e5882deaf00906a1dba467@185.219.142.119:53456,4eb031b59bd0210481390eefc656c916d47e7872@37.60.248.151:53456,ff9dbc6bb53227ef94dc75ab1ddcaeb2404e1b0b@178.170.47.171:26656,ffb9874da3e0ead65ad62ac2b569122f085c0774@149.28.134.228:26656" && \ 163 | SEEDS="2eaa272622d1ba6796100ab39f58c75d458b9dbc@34.142.181.82:26656,c28827cb96c14c905b127b92065a3fb4cd77d7f6@testnet-seeds.whispernode.com:25756" && \ 164 | sed -i \ 165 | -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" \ 166 | -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" \ 167 | "$HOME/.initia/config/config.toml" 168 | ``` 169 | ### 8. Change ports (Optional) 170 | ```bash 171 | # Customize if you need 172 | EXTERNAL_IP=$(wget -qO- eth0.me) \ 173 | PROXY_APP_PORT=26658 \ 174 | P2P_PORT=26656 \ 175 | PPROF_PORT=6060 \ 176 | API_PORT=1317 \ 177 | GRPC_PORT=9090 \ 178 | GRPC_WEB_PORT=9091 179 | ``` 180 | ```bash 181 | sed -i \ 182 | -e "s/\(proxy_app = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$PROXY_APP_PORT\"/" \ 183 | -e "s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$RPC_PORT\"/" \ 184 | -e "s/\(pprof_laddr = \"\)\([^:]*\):\([0-9]*\).*/\1localhost:$PPROF_PORT\"/" \ 185 | -e "/\[p2p\]/,/^\[/{s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$P2P_PORT\"/}" \ 186 | -e "/\[p2p\]/,/^\[/{s/\(external_address = \"\)\([^:]*\):\([0-9]*\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/; t; s/\(external_address = \"\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/}" \ 187 | $HOME/.initia/config/config.toml 188 | ``` 189 | ```bash 190 | sed -i \ 191 | -e "/\[api\]/,/^\[/{s/\(address = \"tcp:\/\/\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$API_PORT\4/}" \ 192 | -e "/\[grpc\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_PORT\4/}" \ 193 | -e "/\[grpc-web\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_WEB_PORT\4/}" \ 194 | $HOME/.initia/config/app.toml 195 | ``` 196 | ### 9. Configure prunning to save storage (Optional) 197 | ```bash 198 | sed -i \ 199 | -e "s/^pruning *=.*/pruning = \"custom\"/" \ 200 | -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" \ 201 | -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" \ 202 | "$HOME/.initia/config/app.toml" 203 | ``` 204 | ### 10. Set min gas price 205 | ```bash 206 | sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.15uinit,0.01uusdc\"/" $HOME/.initia/config/app.toml 207 | ``` 208 | ### 11. Disable indexer 209 | ```bash 210 | sed -i "s/^indexer *=.*/indexer = \"null\"/" $HOME/.initia/config/config.toml 211 | ``` 212 | ### 12. Create a service file 213 | ```bash 214 | sudo tee /etc/systemd/system/initiad.service > /dev/null < FAUCET <- 248 | ### 16. Check wallet balance 249 | Make sure your node is fully synced unless it won't work. 250 | ```bash 251 | initiad status | jq -r .sync_info 252 | ``` 253 | ```bash 254 | initiad q bank balances $(initiad keys show $WALLET_NAME -a) 255 | ``` 256 | ### 17. Create a validator 257 | ```bash 258 | initiad tx mstaking create-validator \ 259 | --amount=1000000uinit \ 260 | --pubkey=$(initiad tendermint show-validator) \ 261 | --moniker=$MONIKER \ 262 | --chain-id=$CHAIN_ID \ 263 | --commission-rate=0.05 \ 264 | --commission-max-rate=0.10 \ 265 | --commission-max-change-rate=0.01 \ 266 | --from=$WALLET_NAME \ 267 | --identity="" \ 268 | --website="" \ 269 | --details="Initia to the moon!" \ 270 | --gas=2000000 --fees=300000uinit \ 271 | -y 272 | ``` 273 | Do not forget to save `priv_validator_key.json` file located in $HOME/.initia/config/ 274 | 275 | ## State sync 276 | 277 | ### 1. Stop the node 278 | ```bash 279 | sudo systemctl stop initiad 280 | ``` 281 | ### 2. Backup priv_validator_state.json 282 | ```bash 283 | cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup 284 | ``` 285 | ### 3. Reset DB 286 | ```bash 287 | initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-book 288 | ``` 289 | ### 4. Setup required variables (One command) 290 | ```bash 291 | PEERS="a63a6f6eae66b5dce57f5c568cdb0a79923a4e18@peer-initia-testnet.trusted-point.com:26628" && \ 292 | RPC="https://rpc-initia-testnet.trusted-point.com:443" && \ 293 | LATEST_HEIGHT=$(curl -s --max-time 3 --retry 2 --retry-connrefused $RPC/block | jq -r .result.block.header.height) && \ 294 | TRUST_HEIGHT=$((LATEST_HEIGHT - 1500)) && \ 295 | TRUST_HASH=$(curl -s --max-time 3 --retry 2 --retry-connrefused "$RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash) && \ 296 | 297 | if [ -n "$PEERS" ] && [ -n "$RPC" ] && [ -n "$LATEST_HEIGHT" ] && [ -n "$TRUST_HEIGHT" ] && [ -n "$TRUST_HASH" ]; then 298 | sed -i.bak \ 299 | -e "/\[statesync\]/,/^\[/{s/\(enable = \).*$/\1true/}" \ 300 | -e "/^rpc_servers =/ s|=.*|= \"$RPC,$RPC\"|;" \ 301 | -e "/^trust_height =/ s/=.*/= $TRUST_HEIGHT/;" \ 302 | -e "/^trust_hash =/ s/=.*/= \"$TRUST_HASH\"/" \ 303 | -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" \ 304 | $HOME/.initia/config/config.toml 305 | echo -e "\nLATEST_HEIGHT: $LATEST_HEIGHT\nTRUST_HEIGHT: $TRUST_HEIGHT\nTRUST_HASH: $TRUST_HASH\nPEERS: $PEERS\n\nALL IS FINE" 306 | else 307 | echo -e "\nError: One or more variables are empty. Please try again or change RPC\nExiting...\n" 308 | fi 309 | ``` 310 | ### 4. Move priv_validator_state.json back 311 | ```bash 312 | mv $HOME/.initia/priv_validator_state.json.backup $HOME/.initia/data/priv_validator_state.json 313 | ``` 314 | ### 5. Start the node 315 | ```bash 316 | sudo systemctl restart initiad && sudo journalctl -u initiad -f -o cat 317 | ``` 318 | You should see the following logs. It may take up to 5 minutes for the snapshot to be discovered. If doesn't work, try downloading [snapshot](#download-snapshot) 319 | ```py 320 | 2:39PM INF sync any module=statesync msg="Discovering snapshots for 15s" server=node 321 | 2:39PM INF Discovered new snapshot format=3 hash="?^��I��\r�=�O�E�?�CQD�6�\x18�F:��\x006�" height=602000 module=statesync server=node 322 | 2:39PM INF Discovered new snapshot format=3 hash="%���\x16\x03�T0�v�f�C��5�uinit --from $WALLET_NAME --gas=2000000 --fees=300000uinit -y 441 | ``` 442 | ### Get your p2p peer address 443 | ```bash 444 | initiad status | jq -r '"\(.NodeInfo.id)@\(.NodeInfo.listen_addr)"' 445 | ``` 446 | ### Edit your validator 447 | ```bash 448 | initiad tx mstaking edit-validator --website="" --details="" --moniker="" --from=$WALLET_NAME --gas=2000000 --fees=300000uinit -y 449 | ``` 450 | ### Send tokens between wallets 451 | ```bash 452 | initiad tx bank send $WALLET_NAME uinit --gas=2000000 --fees=300000uinit -y 453 | ``` 454 | ### Query your wallet balance 455 | ```bash 456 | initiad q bank balances $WALLET_NAME 457 | ``` 458 | ### Monitor server load 459 | ```bash 460 | sudo apt update 461 | sudo apt install htop -y 462 | htop 463 | ``` 464 | ### Query active validators 465 | ```bash 466 | initiad q mstaking validators -o json --limit=1000 \ 467 | | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' \ 468 | | jq -r '.voting_power + " - " + .description.moniker' \ 469 | | sort -gr | nl 470 | ``` 471 | ### Query inactive validators 472 | ```bash 473 | initiad q mstaking validators -o json --limit=1000 \ 474 | | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' \ 475 | | jq -r '.voting_power + " - " + .description.moniker' \ 476 | | sort -gr | nl 477 | ``` 478 | ### Check logs of the node 479 | ```bash 480 | sudo journalctl -u initiad -f -o cat 481 | ``` 482 | ### Restart the node 483 | ```bash 484 | sudo systemctl restart initiad 485 | ``` 486 | ### Stop the node 487 | ```bash 488 | sudo systemctl stop initiad 489 | ``` 490 | ### Delete the node from the server 491 | ```bash 492 | # !!! IF YOU HAVE CREATED A VALIDATOR, MAKE SURE TO BACKUP `priv_validator_key.json` file located in $HOME/.initia/config/ 493 | sudo systemctl stop initiad 494 | sudo systemctl disable initiad 495 | sudo rm /etc/systemd/system/initiad.service 496 | rm -rf $HOME/.initia 497 | sudo rm /usr/local/bin/initiad 498 | ``` 499 | ### Example gRPC usage 500 | ```bash 501 | wget https://github.com/fullstorydev/grpcurl/releases/download/v1.7.0/grpcurl_1.7.0_linux_x86_64.tar.gz 502 | tar -xvf grpcurl_1.7.0_linux_x86_64.tar.gz 503 | chmod +x grpcurl 504 | ./grpcurl -plaintext localhost:$GRPC_PORT list 505 | ### MAKE SURE gRPC is enabled in app.toml 506 | # grep -A 3 "\[grpc\]" $HOME/.initia/config/app.toml 507 | ``` 508 | ### Example REST API query 509 | ```bash 510 | curl localhost:$API_PORT/cosmos/mstaking/v1beta1/validators 511 | ### MAKE SURE API is enabled in app.toml 512 | # grep -A 3 "\[api\]" $HOME/.initia/config/app.toml 513 | ``` 514 | 515 | --------------------------------------------------------------------------------