Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odin/validatorsh #251

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scripts/validator.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/bin/bash

set -o pipefail
Expand Down Expand Up @@ -26,17 +27,17 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then
fi

# wait for peer
until curl -s "$PEER:$PORT_RPC" 1>/dev/null 2>&1; do
echo "Waiting for peer: $PEER:$PORT_RPC"
until curl -s "$PEER" 1>/dev/null 2>&1; do
echo "Waiting for peer: $PEER"
sleep 3
done

# fetch genesis file from seed node
curl -sL "$PEER:$PORT_RPC/genesis" | jq '.result.genesis' > ~/.arkeo/config/genesis.json
curl -sL "$PEER/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"
SEED_ID=$(curl -s "$PEER/status" | jq -r .result.node_info.id)
SEEDS="$SEED_ID@$SEED"

sed -i 's/enable = false/enable = true/g' ~/.arkeo/config/app.toml
sed -i "s/seeds = \"\"/seeds = \"$PEER_ID@$SEED\"/g" ~/.arkeo/config/config.toml
Expand Down
Loading