Skip to content

Commit 7a754bb

Browse files
committed
Merge branch 'injective' into main
2 parents a4bb050 + 6d0f957 commit 7a754bb

File tree

5 files changed

+255
-0
lines changed

5 files changed

+255
-0
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export MONIKER=AuraStake
2+
export CHAIN_ID=injective-1
3+
export INJ_VER=v1.1.1-1640627705 # Check for the latest at https://github.com/InjectiveLabs/injective-chain-releases/releases
4+
export VALIDATOR_KEY_NAME=aurastake2-inj
5+
export ORCHESTRATOR_KEY_NAME=aurastake2-orch

injective/sample/peggo.service

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=peggo
3+
4+
[Service]
5+
Type=simple
6+
User=$USER
7+
WorkingDirectory=/home/$USER/.peggo
8+
ExecStart=/bin/bash -c 'peggo orchestrator '
9+
Restart=always
10+
RestartSec=1
11+
12+
[Install]
13+
WantedBy=multi-user.target

injective/setup.sh

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# Setting up a node
2+
3+
## Prerequisites
4+
5+
mkdir -p ~/Downloads
6+
cd ~/Downloads
7+
sudo apt-get install -y unzip
8+
9+
### Install Go Ethereum
10+
11+
#;https://geth.ethereum.org/docs/install-and-build/installing-geth
12+
sudo add-apt-repository -y ppa:ethereum/ethereum
13+
sudo apt-get update
14+
sudo apt-get install ethereum
15+
16+
### Get an account with Infura
17+
18+
#;infura.io
19+
20+
## Using a snapshot for mainnet.
21+
22+
### Check out https://docs.injective.network/docs/staking/mainnet/validate-on-mainnet/sync-from-snapshot/
23+
24+
### 1A. Install awscli
25+
mkdir -p ~/Downloads
26+
cd ~/Downloads
27+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
28+
unzip awscliv2.zip
29+
sudo ./aws/install
30+
31+
### Download the snapshot without using any credentials.
32+
aws s3 sync --delete s3://injective-snapshots/mainnet/injectived/data /mnt/injective/data/ --no-sign-request
33+
34+
./mainnet.sh
35+
36+
### Download the latest binaries.
37+
mkdir ~/Downloads/$INJ_VER
38+
cd ~/Downloads/$INJ_VER
39+
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/$INJ_VER/linux-amd64.zip
40+
41+
### Unzip and add the binaries to the path.
42+
unzip linux-amd64.zip
43+
sudo mv -i injectived peggo injective-exchange /usr/bin
44+
45+
### Check the version.
46+
injectived version #Version dev (096cbe5)
47+
peggo version # Version dev (5c7638b)
48+
injective-exchange version # Version dev (102daa7)
49+
50+
### Initialize a new chain node.
51+
injectived init $MONIKER --chain-id $CHAIN_ID
52+
53+
### Complete preparations.
54+
cd ~/Downloads
55+
git clone https://github.com/InjectiveLabs/mainnet-config
56+
cp mainnet-config/10001/genesis.json ~/.injectived/config/genesis.json
57+
cp mainnet-config/10001/app.toml ~/.injectived/config/app.toml
58+
sha256sum ~/.injectived/config/genesis.json # 573b89727e42b41d43156cd6605c0c8ad4a1ce16d9aad1e1604b02864015d528
59+
60+
### Update `persistent_peers` with the seeds value and `timeout_commit = 2500ms`.
61+
cat mainnet-config/10001/seeds.txt
62+
vi ~/.injectived/config/config.toml
63+
64+
### Start syncing the node
65+
injectived start
66+
67+
### Configure as validator
68+
69+
See section "Create the validator account".
70+
71+
## 1B. For testnet.
72+
./testnet.sh
73+
74+
### Download the binaries.
75+
mkdir ~/Downloads/$INJ_VER
76+
cd ~/Downloads/$INJ_VER
77+
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/$INJ_VER/linux-amd64.zip
78+
79+
### Unzip and add the binaries to the path.
80+
unzip linux-amd64.zip
81+
sudo mv -i injectived peggo injective-exchange /usr/bin
82+
83+
### Check the version.
84+
injectived version # Version dev (639589c)
85+
peggo version # Version dev (5c7638b)
86+
injective-exchange version # Version dev (102daa7)
87+
88+
### Initialize a new chain node.
89+
injectived init $MONIKER --chain-id $CHAIN_ID
90+
91+
### Complete the preparations.
92+
93+
git clone https://github.com/InjectiveLabs/testnet-config/
94+
cp testnet-config/staking/$TESTNET_VER/genesis.json ~/.injectived/config/genesis.json
95+
cp testnet-config/staking/$TESTNET_VER/app.toml ~/.injectived/config/app.toml
96+
sha256sum ~/.injectived/config/genesis.json # e45b7c97d2afb37b9529e7dc234a410ff5cc8961adef2d39a3ef6923c0acfb22
97+
98+
### Update `persistent_peers` with the seeds value and `timeout_commit = 1500ms`.
99+
cat testnet-config/staking/$TESTNET_VER/seeds.txt
100+
vi ~/.injectived/config/config.toml
101+
102+
### Start syncing the node.
103+
injectived start
104+
105+
### Configure as validator
106+
107+
See section "Create the validator account" below.
108+
109+
## 2. Create the validator account.
110+
injectived keys add $VALIDATOR_KEY_NAME
111+
export VALIDATOR_ADDR=$(injectived keys show $VALIDATOR_KEY_NAME | grep address | cut -d' ' -f4)
112+
export VALIDATOR_PUBKEY=$(injectived tendermint show-validator)
113+
114+
### Store the secret phase!
115+
116+
### Transfer KINJ token to the validator account
117+
118+
#;For testnet tokens: https://faucet.injective.network
119+
#;For mainnet tokens: obtain some real INJ on Mainnet Ethereum (ERC-20 token address 0xe28b3b32b6c345a34ff64674606124dd5aceca30). https://chain.injective.network/guides/mainnet/becoming-a-validator.html#step-3-transfer-inj-to-your-validator-account-on-the-injective-chain
120+
121+
### Check for balance.
122+
injectived q bank balances $VALIDATOR_ADDR
123+
124+
#;Create validator.
125+
AMOUNT=3000000000000000000inj # 3inj
126+
MAX_CHANGE_RATE=0.5
127+
MAX_RATE=0.5
128+
RATE=0.01
129+
MIN_SELF_DELEGATION=1000000000000000000 # 1inj
130+
injectived tx staking create-validator \
131+
--moniker=$MONIKER \
132+
--amount=$AMOUNT \
133+
--pubkey=$VALIDATOR_PUBKEY \
134+
--from=$VALIDATOR_KEY_NAME \
135+
--keyring-backend=file \
136+
--node=tcp://localhost:26657 \
137+
---chain-id=$CHAIN_ID \
138+
--commission-max-change-rate=$MAX_CHANGE_RATE \
139+
--commission-max-rate=$MAX_RATE \
140+
--commission-rate=$RATE \
141+
--min-self-delegation=$MIN_SELF_DELEGATION
142+
--identity=
143+
--security-contact=
144+
--website=
145+
146+
#After setting up the validator, the next step is to set up the Ethereum Bridge Relayer. https://chain.injective.network/guides/testnet/peggo.html
147+
148+
## 3A. Configure Peggo (mainnet)
149+
150+
mkdir ~/.peggo
151+
cp mainnet-config/10001/peggo-config.env ~/.peggo/.env
152+
cd ~/.peggo
153+
154+
#;Update PEGGO_ETH_RPC in .env with a valid Ethereum EVM RPC endpoint.
155+
156+
injectived keys add $ORCHESTRATOR_KEY_NAME
157+
export ORCHESTRATOR_ADDR=$(injectived keys show $ORCHESTRATOR_KEY_NAME | grep address | cut -d' ' -f4)
158+
159+
#;Update the passphrase for the key.
160+
PEGGO_COSMOS_FROM=$ORCHESTRATOR_KEY_NAME
161+
PEGGO_COSMOS_FROM_PASSPHRASE=<>
162+
163+
### Manage Ethereum keys for peggo
164+
165+
geth account new --datadir=$HOME/.peggo/data
166+
167+
#;Update the environment file with these keys.
168+
169+
PEGGO_ETH_KEYSTORE_DIR=$HOME/.peggo/data/keystore
170+
PEGGO_ETH_FROM=0x<>
171+
PEGGO_ETH_PASSPHRASE=<>
172+
#;export ETHEREUM_ADDR=PEGGO_ETH_FROM
173+
174+
### Transfer some tokens to the Ethereum wallet
175+
176+
177+
178+
### Register Ethereum address
179+
180+
injectived tx peggy set-orchestrator-address $VALIDATOR_ADDR $ORCHESTRATOR_ADDR $ETHEREUM_ADDR --from $VALIDATOR_KEY_NAME --chain-id=$CHAIN_ID --yes --gas-prices=500000000inj
181+
182+
### Start the relayer
183+
184+
peggo orchestrator
185+
186+
## 3B. Configure Peggo (testnet)
187+
188+
mkdir ~/.peggo
189+
cp testnet-config/staking/$TESTNET_VER/peggo-config.env ~/.peggo/.env
190+
cd ~/.peggo
191+
192+
#;Update PEGGO_ETH_RPC in .env with a Kovan EVM RPC endpoint.
193+
194+
injectived keys add $ORCHESTRATOR_KEY_NAME
195+
export ORCHESTRATOR_ADDR=$(injectived keys show $ORCHESTRATOR_KEY_NAME | grep address | cut -d' ' -f4)
196+
197+
#;Update the passphrase for the key.
198+
PEGGO_COSMOS_FROM=$ORCHESTRATOR_KEY_NAME
199+
PEGGO_COSMOS_FROM_PASSPHRASE=<>
200+
201+
### Manage Ethereum keys for peggo
202+
203+
geth account new --datadir=$HOME/.peggo/data/
204+
205+
#;Update the environment file with these keys.
206+
207+
PEGGO_ETH_KEYSTORE_DIR=$HOME/.peggo/data/keystore
208+
PEGGO_ETH_FROM=0x<>
209+
PEGGO_ETH_PASSPHRASE=<>
210+
#;export ETHEREUM_ADDR=PEGGO_ETH_FROM
211+
212+
### Get some tokens
213+
214+
#;For testnet: https://gitter.im/kovan-testnet/faucet
215+
216+
### Register Ethereum address
217+
218+
peggo tx register-eth-key
219+
220+
#;Verify registration by checking for validator's mapped ethereum address at https://staking-lcd-testnet.injective.network/peggy/v1/valset/current
221+
222+
### Start the relayer
223+
224+
peggo orchestrator
225+
226+
#;Verify by checking at https://staking-lcd-testnet.injective.network/peggy/v1/valset/current

injective/testnet.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export MONIKER=CloverStake
2+
export CHAIN_ID=injective-888
3+
export INJ_VER=v0.4.17-1640702850 # Check for the latest at https://github.com/InjectiveLabs/injective-chain-releases/releases
4+
export VALIDATOR_KEY_NAME=cloverstake2-inj
5+
export ORCHESTRATOR_KEY_NAME=cloverstake2-orch
6+
export TESTNET_VER=40018 # Check for the latest at https://github.com/InjectiveLabs/testnet-config/tree/master/staking

0 commit comments

Comments
 (0)