From 81211b07d4c1100bed6eab6162d9e6d02cab346b Mon Sep 17 00:00:00 2001 From: Mudassir Shabbir Date: Fri, 13 Sep 2024 09:36:45 +0500 Subject: [PATCH 1/2] chore: removed bg voting loop --- contract/scripts/run-chain.sh | 61 ++--------------------------------- 1 file changed, 3 insertions(+), 58 deletions(-) diff --git a/contract/scripts/run-chain.sh b/contract/scripts/run-chain.sh index e6435bd..c66201d 100755 --- a/contract/scripts/run-chain.sh +++ b/contract/scripts/run-chain.sh @@ -1,69 +1,14 @@ #!/bin/bash -wait_for_bootstrap() { - endpoint="localhost" - while true; do - if json=$(curl -s --fail -m 15 "$endpoint:26657/status"); then - if [[ "$(echo "$json" | jq -r .jsonrpc)" == "2.0" ]]; then - if last_height=$(echo "$json" | jq -r .result.sync_info.latest_block_height); then - if [[ "$last_height" != "1" ]]; then - echo "$last_height" - return - else - echo "$last_height" - fi - fi - fi - fi - echo "waiting for next block..." - sleep 5 - done - echo "done" -} - -waitForBlock() ( - echo "waiting for block..." - times=${1:-1} - echo "$times" - for ((i = 1; i <= times; i++)); do - b1=$(wait_for_bootstrap) - while true; do - b2=$(wait_for_bootstrap) - if [[ "$b1" != "$b2" ]]; then - echo "block produced" - break - fi - sleep 5 - done - done - echo "done" -) - -approveProposals() { - while true; do - proposals=$(make -s -C /workspace/contract gov-voting-q 2>/dev/null) - exit_status=$? - if [ $exit_status -eq 0 ]; then - echo "Approving proposals: $proposals" - printf $proposals | xargs -I {} make -s -C /workspace/contract vote PROPOSAL={} - else - echo "No proposals to approve, continuing..." - fi - - sleep 10 - done -} +. /usr/src/upgrade-test-scripts/env_setup.sh # Start the chain in the background /usr/src/upgrade-test-scripts/start_agd.sh & # wait for blocks to start being produced -waitForBlock 2 - -# Approve any proposals forever in the background. -approveProposals & +waitForBlock 1 make -C /workspace/contract mint100 # bring back chain process to foreground -wait +wait \ No newline at end of file From 56ca1fa168f95e22190cc9f2589cbc0774d1f7f1 Mon Sep 17 00:00:00 2001 From: Mudassir Shabbir Date: Fri, 13 Sep 2024 09:37:50 +0500 Subject: [PATCH 2/2] chore: removed version from docker file --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9e45abd..ad10773 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.5' - services: agd: # cf. https://github.com/Agoric/agoric-3-proposals