Skip to content

Commit

Permalink
Upgraded script to check both dependencies and display all missing on…
Browse files Browse the repository at this point in the history
…es at the same time (#1667)
  • Loading branch information
criadoperez committed Jun 27, 2023
1 parent bb8f77c commit 36fa7a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Run servers form local binary
# Run servers from local binary

## Prerequisites

When deploying with `polybft` consensus, there are some additional dependencies:
* [npm](https://nodejs.org/en/)
* [go 1.20.x](https://go.dev/dl/)
* [jq](https://jqlang.github.io/jq)
* Netcat (nc)

## Local development
Running `polygon-edge` from local binary can be done very easily by using provided `scripts` folder.
Expand Down
18 changes: 16 additions & 2 deletions scripts/cluster
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
#!/usr/bin/env bash

dp_error_flag=0

# Check if jq is installed
if [[ "$1" == "polybft" ]] && ! command -v jq >/dev/null 2>&1; then
echo "jq is not installed. Please install it manually and run the script again."
echo "jq is not installed."
echo "Manual installation instructions: Visit https://jqlang.github.io/jq/ for more information."
exit 1
dp_error_flag=1
fi

# Check if nc is installed
if [[ "$1" == "polybft" ]] && ! command -v nc >/dev/null 2>&1; then
echo "Netcat (nc) is not installed."
dp_error_flag=1
fi

# Stop script if any of the dependencies have failed
if [[ "$dp_error_flag" -eq 1]]; then
echo "Missing dependencies. Please install them and run the script again."
exit 1
fi

function initIbftConsensus() {
echo "Running with ibft consensus"
./polygon-edge secrets init --insecure --data-dir test-chain- --num 4
Expand Down

0 comments on commit 36fa7a6

Please sign in to comment.