diff --git a/scripts/README.md b/scripts/README.md index 4c65952327..e82c4cdc38 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,4 +1,4 @@ -# Run servers form local binary +# Run servers from local binary ## Prerequisites @@ -6,6 +6,7 @@ When deploying with `polybft` consensus, there are some additional dependencies: * [npm](https://nodejs.org/en/) * [go 1.19.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. diff --git a/scripts/cluster b/scripts/cluster index 07b6669991..8ac9ffbe26 100755 --- a/scripts/cluster +++ b/scripts/cluster @@ -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