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

Upgraded script to check both dependencies #1667

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
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
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.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.
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
Loading