forked from lavanet/lava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lavanet#1130 from lavanet/CNS-run-second-validator
CNS-run-second-validator
- Loading branch information
Showing
7 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,65 @@ | ||
# this script is adding another validator to the chain (without a running node) (this validator will be soon jailed due to inactivity) | ||
clear | ||
rm -rf ~/.lava_test | ||
lavad init validator2 --chain-id lava --home ~/.lava_test | ||
lavad config broadcast-mode sync --home ~/.lava_test | ||
lavad config keyring-backend test --home ~/.lava_test | ||
lavad keys add validator2 --home ~/.lava_test | ||
home=~/.lava2 | ||
rm -rf $home | ||
lavad init validator2 --chain-id lava --home $home | ||
lavad config broadcast-mode sync --home $home | ||
lavad config keyring-backend test --home $home | ||
lavad keys add validator2 --home $home | ||
|
||
cp ~/.lava/config/addrbook.json $home/config/addrbook.json | ||
cp ~/.lava/config/app.toml $home/config/app.toml | ||
cp ~/.lava/config/client.toml $home/config/client.toml | ||
cp ~/.lava/config/genesis.json $home/config/genesis.json | ||
|
||
|
||
# Specify the file path, field to edit, and new value | ||
path="$home/config/" | ||
config='config.toml' | ||
app='app.toml' | ||
|
||
# Determine OS | ||
os_name=$(uname) | ||
case "$(uname)" in | ||
Darwin) | ||
SED_INLINE="-i ''" ;; | ||
Linux) | ||
SED_INLINE="-i" ;; | ||
*) | ||
echo "unknown system: $(uname)" | ||
exit 1 ;; | ||
esac | ||
|
||
sed $SED_INLINE \ | ||
-e 's/tcp:\/\/0\.0\.0\.0:26656/tcp:\/\/0.0.0.0:36656/' \ | ||
-e 's/tcp:\/\/127\.0\.0\.1:26658/tcp:\/\/127.0.0.1:36658/' \ | ||
-e 's/tcp:\/\/127\.0\.0\.1:26657/tcp:\/\/127.0.0.1:36657/' \ | ||
-e 's/tcp:\/\/127\.0\.0\.1:26656/tcp:\/\/127.0.0.1:36656/' "$path$config" | ||
|
||
# Edit app.toml file | ||
sed $SED_INLINE \ | ||
-e 's/tcp:\/\/localhost:1317/tcp:\/\/localhost:2317/' \ | ||
-e 's/localhost:9090/localhost:8090/' \ | ||
-e 's/":7070"/":7070"/' \ | ||
-e 's/localhost:9091/localhost:8091/' "$path$app" | ||
|
||
|
||
GASPRICE="0.000000001ulava" | ||
lavad tx bank send $(lavad keys show alice -a) $(lavad keys show validator2 -a --home ~/.lava_test) 500000ulava -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE | ||
lavad tx bank send $(lavad keys show alice -a) $(lavad keys show validator2 -a --home $home) 10000000000001ulava -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE | ||
sleep 3 | ||
|
||
lavad tx staking create-validator -y --from validator2 --amount="50000ulava" --pubkey=$(lavad tendermint show-validator --home ~/.lava_test) --commission-rate="0.10" \ | ||
lavad tx staking create-validator -y --from validator2 --amount="10000000000000ulava" --pubkey=$(lavad tendermint show-validator --home $home) \ | ||
--commission-rate="0.10" \ | ||
--commission-max-rate="0.20" \ | ||
--commission-max-change-rate="0.01" \ | ||
--min-self-delegation="1000" \ | ||
--gas-adjustment "1.5" \ | ||
--gas "auto" \ | ||
--gas-prices $GASPRICE \ | ||
--home ~/.lava_test | ||
--home $home | ||
|
||
id=$(lavad status | jq .NodeInfo.id -r) | ||
addr=$(lavad status | jq .NodeInfo.listen_addr -r | sed 's/tcp:\/\///') | ||
lavad start --home $home --p2p.seeds $id@$addr | ||
|
||
|
||
lavad tx staking redelegate lava@valoper1yhzkfrcdwf2hwpc4cre8er5tamp6wdm4stx2ec lava@valoper1z025w20ms6cpdht585nhsw682jph4yc7hx0gqc 500000000000ulava -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters