Upgrading your Injective Chain Node

This section details how to perform an update of your Injective Chain node.

Step 0 - Stopping the Services#

First, stop the injectived Injective Chain daemon and the peggo bridge relayer.

Step 1 - Upgrade the Binaries#

Then, update the injectived and peggo binaries to the latest versions.

  1. Download latest binaries using the following command.
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v4.0.13-1631158675/linux-amd64.zip

This zip file will contain two binaries: injectived which is the Injective Chain daemon as well as peggo which is the Injective Chain ERC-20 bridge relayer daemon.

  1. Unzip and add injectived and peggo to your /usr/bin.
unzip linux-amd64.zip
sudo mv injectived /usr/bin
sudo mv peggo /usr/bin

Step 2 - Reset the chain#

injectived unsafe-reset-all

Step 3 - Update injectived config#

  1. Updating the config (version 40013)
# clone config version 40013
git clone https://github.com/InjectiveLabs/testnet-config
# copy genesis file to config directory
cp testnet-config/staking/40013/genesis.json ~/.injectived/config/genesis.json
# copy config file to config directory
cp testnet-config/staking/40013/app.toml ~/.injectived/config/app.toml
  1. Verify the genesis file
sha256sum ~/.injectived/config/genesis.json
The output should be 1af15799b563f244df36efb88873a0a3562c4afa4bdefed46eb00ac9f3dc5f7c
  1. Update peers

Replace the persistent_peers field present in ~/.injectived/config/config.toml with the contents of testnet-config/staking/40013/seeds.txt and update the timeout_commit to 1500ms.

cat testnet-config/staking/40013/seeds.txt
nano ~/.injectived/config/config.toml
# timeout_commit = 1500ms
# persistent_peers = "3442db4971a8b1c51abf4f343da68da51c076da5@3.14.183.40:26656,5f85fceaa8a1fe1fc0067ab9e5687d9c2105c03b@3.15.11.190:26656"

Step 4 - Start the chain#

Using Terminal output#

injectived start

Using systemd service#

Configure systemd service for relayer if not configured already. You can suppress log level to error using this config.

Edit the config at /etc/systemd/system/injectived.service:

[Unit]
Description=injectived
[Service]
WorkingDirectory=/usr/bin
ExecStart=/bin/bash -c '/usr/bin/injectived --log-level=error start'
Type=simple
Restart=always
RestartSec=5
User=ec2-user
[Install]
WantedBy=multi-user.target

Starting and restarting systemd service

sudo systemctl daemon-reload
sudo systemctl restart injectived
sudo systemctl status injectived
# enable start on system boot
sudo systemctl enable injectived
# To check Logs
journalctl -u injectived -f

Logs checking#

At this point, your node should start syncing blocks from the chain. Logs will look like this with initial blockheight = 4423001.

INFO[0000] starting ABCI with Tendermint module=main
INFO[0015] Starting StateSync service impl=StateSync module=statesync
INFO[0017] executed block height=4423001 module=state num_invalid_txs=0 num_valid_txs=0
INFO[0018] commit synced commit=436F6D6D697449447B5B31323620363720313231203235203138342031383220373020313030203138203131302031373820323437203234312031313120313830203130372036342034352032333020313636203633203138342032343820313736203139322039203230332032353520362032333320323235203133345D3A3237463637397D module=main

Congratulations! You have successfully upgraded your node. 🎉

Step 5 - Resume Your Validator Node#

Once your node completed syncing the chain, check your validator status (here) or using the CLI command below.

injectived query staking validator $(injectived keys show {Your Validator Key Name} --bech val --address)

Unjail (if it's UNBONDING)#

injectived tx slashing unjail --from [Your validator key name] --chain-id=injective-888 --keyring-backend=file --yes --node=tcp://localhost:26657 --gas-prices=500000000inj

Restake and unjail (if it's UNBONDED)#

Check valid staked amount, the value tokens should be greater or equal than min-self-delegation.

# Check valid staked amount
# the value tokens should be greater or equal than min-self-delegation
injectived q staking validator [injvaloper-address]
```bash
# Example: self-delegate another 1 INJ to the validator, change with your appropriate amount
injectived tx staking delegate [injvaloper-address] 1000000000000000000inj --from [validator-key-name] --chain-id=injective-888 --keyring-backend=file --yes --node=tcp://localhost:26657 --gas-prices=500000000inj
# Now unjail your node as you've been off for a while
injectived tx slashing unjail --from [validator-key-name] --chain-id=injective-888 --keyring-backend=file --yes --node=tcp://localhost:26657 --gas-prices=500000000inj

Useful commands:

injectived keys list
injectived keys show [validator-key-name]
injectived q bank balances [Your Validator address]

Step 6 - Restart Your Relayer Bridge#

  1. Update relayer bridge config with new PEGGO_COINGECKO_API="https://api.coingecko.com/api/v3" field.

The config lives at ~/.peggo/.env in default configuration.

PEGGO_ENV="staking"
PEGGO_LOG_LEVEL="info"
PEGGO_SERVICE_WAIT_TIMEOUT="1m"
PEGGO_COSMOS_CHAIN_ID="injective-888"
PEGGO_COSMOS_GRPC="tcp://localhost:9900"
PEGGO_TENDERMINT_RPC="http://localhost:26657"
PEGGO_COSMOS_FEE_DENOM="inj"
PEGGO_COSMOS_GAS_PRICES="500000000inj"
PEGGO_COSMOS_KEYRING="file"
PEGGO_COSMOS_KEYRING_DIR={If you use injectived keyring - specify absolute homedir path}
PEGGO_COSMOS_KEYRING_APP="peggo"
PEGGO_COSMOS_FROM=
PEGGO_COSMOS_FROM_PASSPHRASE=
PEGGO_COSMOS_PK={Or add your cosmos private key as hex}
PEGGO_COSMOS_USE_LEDGER=false
PEGGO_ETH_CHAIN_ID=42
PEGGO_ETH_RPC="https://kovan.infura.io/v3/{Add your kovan api key}"
PEGGO_ETH_KEYSTORE_DIR=
PEGGO_ETH_FROM=
PEGGO_ETH_PASSPHRASE=
PEGGO_ETH_PK={Add your peggo eth private key as hex}
PEGGO_ETH_USE_LEDGER=false
PEGGO_COINGECKO_API="https://api.coingecko.com/api/v3"
PEGGO_RELAY_VALSETS=true
PEGGO_RELAY_BATCHES=true
PEGGO_MIN_BATCH_FEE_USD=0
PEGGO_STATSD_PREFIX="peggo."
PEGGO_STATSD_ADDR="localhost:8125"
PEGGO_STATSD_STUCK_DUR="5m"
PEGGO_STATSD_MOCKING=false
PEGGO_STATSD_DISABLED=true
  1. Configure systemd service for relayer if not configured already

Edit the config at /etc/systemd/system/peggo.service:

[Unit]
Description=peggo
[Service]
WorkingDirectory=/home/ec2-user/.peggo
ExecStart=/bin/bash -c 'peggo orchestrator'
Type=simple
Restart=always
RestartSec=5
User=ec2-user
[Install]
WantedBy=multi-user.target
  1. Restart systemd service
sudo systemctl daemon-reload
sudo systemctl restart peggo
# enable start on system boot
sudo systemctl enable peggo
# To check Logs
$ journalctl -f -u peggo
Last updated on