Skip to content

Commit

Permalink
tweak validator script
Browse files Browse the repository at this point in the history
  • Loading branch information
Son of Odin committed Nov 2, 2023
1 parent 68c59e9 commit 4a384a6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
set -o pipefail
set -ex

PEER="${PEER:=none}" # the hostname of a seed node set as tendermint persistent peer
CHAIN_ID="arkeo"
PORT_RPC=${PORT_RPC:=26657}
PORT_P2P=${PORT_P2P:=26656}
RPC="${RPC:=seed.arkeo.network:26657}"
SEED="${SEED:=seed.arkeo.network:26656}"
PEER="${PEER:=none}" # the hostname of a seed node set as tendermint persistent peer
PEER_ID=$(curl -s http://$RPC/status | jq -r '.result.node_info.id')

find ~/.arkeo/config -size 0 -print -delete

if [ ! -f ~/.arkeo/config/genesis.json ]; then
echo "setting validator node"
Expand All @@ -27,14 +32,14 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then
done

# fetch genesis file from seed node
curl "$PEER:$PORT_RPC/genesis" | jq '.result.genesis' >~/.arkeo/config/genesis.json
curl -sL "$PEER:$PORT_RPC/genesis" | jq '.result.genesis' > ~/.arkeo/config/genesis.json

# fetch node id
SEED_ID=$(curl -s "$PEER:$PORT_RPC/status" | jq -r .result.node_info.id)
SEEDS="$SEED_ID@$PEER:$PORT_P2P"

sed -i 's/enable = false/enable = true/g' ~/.arkeo/config/app.toml
sed -i "s/seeds = \"\"/seeds = \"$SEEDS\"/g" ~/.arkeo/config/config.toml
sed -i "s/seeds = \"\"/seeds = \"$PEER_ID@$SEED\"/g" ~/.arkeo/config/config.toml
# TODO: create this one as a validator
# arkeod tx staking create-validator --amount=100000000000uarkeo --pubkey=$(arkeod tendermint show-validator) --moniker="validator 1" --from=bob --keyring-backend test --commission-rate="0.10" --commission-max-rate="0.20" --commission-max-change-rate="0.01" --min-self-delegation="1"
fi
Expand Down

0 comments on commit 4a384a6

Please sign in to comment.