-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce local development cluster script (#912)
* Introduce local development cluster script
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Reset test-dirs | ||
rm -rf test-chain-* | ||
rm -f genesis.json | ||
|
||
go build -o polygon-edge . | ||
|
||
if [ "$1" == "ibft" ]; then | ||
echo "Running with ibft consensus" | ||
nodeid=$(./polygon-edge secrets init --data-dir test-chain- --num 4 | grep Node | head -n 1 | awk -F ' ' '{print $4}') | ||
genesis_params="--consensus ibft --ibft-validators-prefix-path test-chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/$nodeid" | ||
|
||
nodeid=$(./polygon-edge secrets init --data-dir test-chain- --num 4 | grep Node | head -n 1 | awk -F ' ' '{print $4}') | ||
else | ||
echo "Running with polybft consensus" | ||
genesis_params="--consensus polybft --validator-set-size=4" | ||
./polygon-edge polybft-secrets --data-dir test-chain- --num 4 | ||
fi | ||
|
||
./polygon-edge genesis $genesis_params \ | ||
--block-gas-limit 10000000 \ | ||
--premine 0x85da99c8a7c2c95964c8efd687e95e632fc533d6:1000000000000000000000 | ||
|
||
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :10001 --jsonrpc :10002 --seal --log-level DEBUG & | ||
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :20001 --jsonrpc :20002 --seal & | ||
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30001 --jsonrpc :30002 --seal & | ||
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :40001 --jsonrpc :40002 --seal & | ||
wait |