Skip to content

Commit

Permalink
Fix polygon-edge.sh typos and shellcheck (#1317)
Browse files Browse the repository at this point in the history
polygon-edge.sh is missing a `fi` and has an erroneous trailing `\` around line 34.
shellcheck complains about globbing unquoted vars.
  • Loading branch information
sergerad authored Mar 22, 2023
1 parent 985ddb5 commit 16822c1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docker/local/polygon-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ case "$1" in
"ibft")
if [ -f "$GENESIS_PATH" ]; then
echo "Secrets have already been generated."
else
else
echo "Generating secrets..."
secrets=$("$POLYGON_EDGE_BIN" secrets init --insecure --num 4 --data-dir /data/data- --json)
echo "Secrets have been successfully generated"
echo "Generating IBFT Genesis file..."
cd /data && /polygon-edge/polygon-edge genesis $CHAIN_CUSTOM_OPTIONS \
cd /data && /polygon-edge/polygon-edge genesis $CHAIN_CUSTOM_OPTIONS \
--dir genesis.json \
--consensus ibft \
--ibft-validators-prefix-path data- \
--validator-set-size=4 \
--bootnode /dns4/node-1/tcp/1478/p2p/$(echo $secrets | jq -r '.[0] | .node_id') \
--bootnode /dns4/node-2/tcp/1478/p2p/$(echo $secrets | jq -r '.[1] | .node_id') \
--bootnode "/dns4/node-1/tcp/1478/p2p/$(echo "$secrets" | jq -r '.[0] | .node_id')" \
--bootnode "/dns4/node-2/tcp/1478/p2p/$(echo "$secrets" | jq -r '.[1] | .node_id')"
fi
;;
"polybft")
echo "Generating PolyBFT secrets..."
Expand All @@ -47,8 +48,8 @@ case "$1" in
--consensus polybft \
--manifest /data/manifest.json \
--validator-set-size=4 \
--bootnode /dns4/node-1/tcp/1478/p2p/$(echo $secrets | jq -r '.[0] | .node_id') \
--bootnode /dns4/node-2/tcp/1478/p2p/$(echo $secrets | jq -r '.[1] | .node_id')
--bootnode "/dns4/node-1/tcp/1478/p2p/$(echo "$secrets" | jq -r '.[0] | .node_id')" \
--bootnode "/dns4/node-2/tcp/1478/p2p/$(echo "$secrets" | jq -r '.[1] | .node_id')"
;;
esac
;;
Expand Down

0 comments on commit 16822c1

Please sign in to comment.