diff --git a/scripts/cluster b/scripts/cluster index d23945eca5..149fdfb6ab 100755 --- a/scripts/cluster +++ b/scripts/cluster @@ -27,11 +27,36 @@ function createGenesis() { } function startServerFromBinary() { - ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --num-block-confirmations 2 --seal --log-level DEBUG & - ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --num-block-confirmations 2 --seal --log-level DEBUG & - ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --num-block-confirmations 2 --seal --log-level DEBUG & - ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --num-block-confirmations 2 --seal --log-level DEBUG & - wait + if [ "$1" == "write-logs" ]; then + echo "Writing validators logs to the files..." + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \ + --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-1.log & + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \ + --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-2.log & + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \ + --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-3.log & + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \ + --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-4.log & + wait + else + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \ + --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \ + --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \ + --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \ + --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + wait + fi } function startServerFromDockerCompose() { @@ -95,14 +120,14 @@ case "$2" in initIbftConsensus # Create genesis file and start the server from binary createGenesis - startServerFromBinary + startServerFromBinary $2 exit 0; elif [ "$1" == "polybft" ]; then # Initialize polybft consensus initPolybftConsensus # Create genesis file and start the server from binary createGenesis - startServerFromBinary + startServerFromBinary $2 exit 0; else echo "Unsupported consensus mode. Supported modes are: ibft and polybft "