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

Restore logs output functionality in cluster script #1561

Merged
merged 1 commit into from
May 29, 2023
Merged
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
39 changes: 21 additions & 18 deletions scripts/cluster
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ function createGenesis() {
function initRootchain() {
echo "Initializing rootchain"

./polygon-edge rootchain server > /dev/null &

if [ "$1" == "write-logs" ]; then
echo "Writing rootchain server logs to the file..."
./polygon-edge rootchain server 2>&1 | tee ./rootchain-server.log &
else
./polygon-edge rootchain server >/dev/null &
fi

set +e
t=1
while [ $t -gt 0 ]
do
while [ $t -gt 0 ]; do
nc -z 127.0.0.1 8545 </dev/null
t=$?
sleep 1
Expand All @@ -56,8 +60,8 @@ function initRootchain() {

./polygon-edge rootchain deploy \
--stake-manager ${stakeManagerAddr} \
--test
--test

customSupernetManagerAddr=$(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr')
supernetID=$(cat genesis.json | jq -r '.params.engine.polybft.supernetID')

Expand All @@ -74,22 +78,21 @@ function initRootchain() {
--jsonrpc http://127.0.0.1:8545

counter=1
while [ $counter -le 4 ]
do
while [ $counter -le 4 ]; do
echo "Registering validator: ${counter}"

./polygon-edge polybft register-validator \
--supernet-manager ${customSupernetManagerAddr} \
--data-dir test-chain-${counter} \
--jsonrpc http://127.0.0.1:8545
--supernet-manager ${customSupernetManagerAddr} \
--data-dir test-chain-${counter} \
--jsonrpc http://127.0.0.1:8545

./polygon-edge polybft stake \
--data-dir test-chain-${counter} \
--amount 1000000000000000000000000 \
--supernet-id ${supernetID} \
--stake-manager ${stakeManagerAddr} \
--stake-token ${stakeToken} \
--jsonrpc http://127.0.0.1:8545
--data-dir test-chain-${counter} \
--amount 1000000000000000000000000 \
--supernet-id ${supernetID} \
--stake-manager ${stakeManagerAddr} \
--stake-token ${stakeToken} \
--jsonrpc http://127.0.0.1:8545

((counter++))
done
Expand Down Expand Up @@ -203,7 +206,7 @@ case "$2" in
initPolybftConsensus
# Create genesis file and start the server from binary
createGenesis
initRootchain
initRootchain $2
startServerFromBinary $2
exit 0
else
Expand Down