Skip to content

Commit a450144

Browse files
committed
Refined the script describing the steps for Injective.
1 parent e1c7b7d commit a450144

File tree

4 files changed

+86
-38
lines changed

4 files changed

+86
-38
lines changed

injective/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Introduction
2+
3+
This folder contains the steps in a shell script (_./setup.sh_) that can be followed step-by-step to set up a validator.
4+
5+
The documentation about the upgrade (https://chain.injective.network/guides/mainnet/canonical-chain-upgrade.html) can be ignored if using the snapshot. The snapshot's height is around 5142521, which is already beyond the heights mentioned in the documentation.

injective/mainnet.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export MONIKER=AuraStake
2+
export CHAIN_ID=injective-1

injective/setup.sh

Lines changed: 77 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,120 @@
1+
# Setting up a node
2+
3+
## Prerequisites
4+
15
mkdir -p ~/Downloads
26
cd ~/Downloads
7+
sudo apt-get install -y unzip
38

4-
# Download the binaries.
5-
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v0.4.17-1635998233/linux-amd64.zip
9+
## Using a snapshot for mainnet.
610

7-
# Unzip and add the binaries to the path.
11+
### Check out https://docs.injective.network/docs/staking/mainnet/validate-on-mainnet/sync-from-snapshot/
12+
13+
### Install awscli
14+
mkdir -p ~/Downloads
15+
cd ~/Downloads
16+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
17+
unzip awscliv2.zip
18+
sudo ./aws/install
19+
20+
### Download the snapshot without using any credentials.
21+
aws s3 sync --delete s3://injective-snapshots/mainnet/injectived/data /mnt/injective/data/ --no-sign-request
22+
23+
### Download the latest binaries.
24+
export INJ_VER=v1.1.1-1636733798 ## Check for the latest at https://github.com/InjectiveLabs/injective-chain-releases/releases
25+
mkdir ~/Downloads/$INJ_VER
26+
cd ~/Downloads/$INJ_VER
27+
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/$INJ_VER/linux-amd64.zip
28+
29+
### Unzip and add the binaries to the path.
830
unzip linux-amd64.zip
931
sudo mv -i injectived peggo injective-exchange /usr/bin
1032

11-
# Check the version.
12-
injectived version
13-
# Version dev (639589c)
33+
### Check the version.
34+
injectived version #Version dev (096cbe5)
1435

15-
peggo version
16-
# Version dev (5c7638b)
36+
### Initialize a new chain node.
37+
./mainnet.sh
38+
injectived init $MONIKER --chain-id $CHAIN_ID
1739

18-
injective-exchange version
19-
# Version dev (102daa7)
40+
### Complete preparations.
41+
cd ~/Downloads
42+
git clone https://github.com/InjectiveLabs/mainnet-config
43+
cp mainnet-config/10001/genesis.json ~/.injectived/config/genesis.json
44+
cp mainnet-config/10001/app.toml ~/.injectived/config/app.toml
45+
sha256sum ~/.injectived/config/genesis.json # 573b89727e42b41d43156cd6605c0c8ad4a1ce16d9aad1e1604b02864015d528
2046

21-
# Initialize a new chain node.
22-
export MONIKER=CloverStake
23-
injectived init $MONIKER --chain-id injective-888
47+
### Update `persistent_peers` with the seeds value and `timeout_commit = 2500ms`.
48+
cat mainnet-config/10001/seeds.txt
49+
vi ~/.injectived/config/config.toml
2450

25-
# Complete the preparations.
26-
git clone https://github.com/InjectiveLabs/testnet-config/
51+
### Start syncing the node
52+
injectived start
2753

28-
# copy genesis file to config directory
29-
cp testnet-config/staking/40017/genesis.json ~/.injectived/config/genesis.json
54+
## For testnet.
55+
56+
### Download the binaries.
57+
export INJ_VER=v0.4.17-1635998233
58+
mkdir ~/Downloads/$INJ_VER
59+
cd ~/Downloads/$INJ_VER
60+
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/$INJ_VER/linux-amd64.zip
61+
62+
### Unzip and add the binaries to the path.
63+
unzip linux-amd64.zip
64+
sudo mv -i injectived peggo injective-exchange /usr/bin
65+
66+
### Check the version.
67+
injectived version # Version dev (639589c)
68+
peggo version # Version dev (5c7638b)
69+
injective-exchange version # Version dev (102daa7)
3070

31-
# copy config file to config directory
71+
### Initialize a new chain node.
72+
./testnet.sh
73+
injectived init $MONIKER --chain-id $CHAIN_ID
74+
75+
### Complete the preparations.
76+
git clone https://github.com/InjectiveLabs/testnet-config/
77+
cp testnet-config/staking/40017/genesis.json ~/.injectived/config/genesis.json
3278
cp testnet-config/staking/40017/app.toml ~/.injectived/config/app.toml
3379

34-
# Add seeds to `persistent_peers`.
80+
### Update `persistent_peers` with the seeds value and `timeout_commit = 1500ms`.
3581
cat testnet-config/staking/40017/seeds.txt
3682
vi ~/.injectived/config/config.toml
3783

38-
# Change timeout_commit = 1500ms
39-
vi ~/.injectived/config/config.toml
40-
41-
# Start the node.
84+
### Start syncing the node.
4285
injectived start
4386

44-
# Create the validator account.
87+
### Create the validator account.
4588
export VALIDATOR_KEY_NAME=validator-inj
4689
injectived keys add $VALIDATOR_KEY_NAME
4790
export VALIDATOR_ADDR=<>
4891
export VALIDATOR_PUBKEY=$(injectived tendermint show-validator)
4992

50-
# Copy the secret phase.
93+
### Copy the secret phase.
5194

52-
# Transfer KINJ token to the validator account
95+
### Transfer KINJ token to the validator account
5396

54-
# Check for balance.
97+
### Check for balance.
5598
injectived q bank balances $VALIDATOR_ADDR
5699

57100
# Create validator.
58-
AMOUNT=30000000000000000000inj # 10inj
101+
AMOUNT=3000000000000000000inj # 3inj
59102
MAX_CHANGE_RATE=0.1
60103
MAX_RATE=0.4
61104
RATE=0.05
62-
MIN_SELF_DELEGATION=1000000000000000000inj
105+
MIN_SELF_DELEGATION=1000000000000000000 # 1inj
63106
injectived tx staking create-validator \
64107
--moniker=$MONIKER \
65108
--amount=$AMOUNT \
66109
--pubkey=$VALIDATOR_PUBKEY \
67110
--from=$VALIDATOR_KEY_NAME \
68-
--keyring-backend=file
111+
--keyring-backend=file \
69112
--node=tcp://localhost:26657 \
70-
--chain-id=injective-888 \
113+
---chain-id=$CHAIN_ID \
71114
--commission-max-change-rate=$MAX_CHANGE_RATE \
72115
--commission-max-rate=$MAX_RATE \
73116
--commission-rate=$RATE \
74117
--min-self-delegation=$MIN_SELF_DELEGATION
75-
76-
#####
77-
# Sync the node
78-
## Install awscli
79-
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
80-
unzip awscliv2.zip
81-
sudo ./aws/install
118+
--identity=
119+
--security-contact=
120+
--website=

injective/testnet.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export MONIKER=CloverStake
2+
export CHAIN_ID=injective-888

0 commit comments

Comments
 (0)