From 24a1b1fe10b03ab7dfa0905b334994ec4a3b67ea Mon Sep 17 00:00:00 2001 From: poma Date: Mon, 11 May 2020 11:14:33 +0300 Subject: [PATCH] contribution verification scripts --- phase2/batch.sh | 9 +++++++++ phase2/download.sh | 10 ++++++++++ phase2/verify.sh | 10 +++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 phase2/batch.sh create mode 100644 phase2/download.sh diff --git a/phase2/batch.sh b/phase2/batch.sh new file mode 100644 index 0000000..9efefd0 --- /dev/null +++ b/phase2/batch.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cargo build --release --bin verify_contribution +echo "0" > current + +for i in $(seq 0 $1); do + ./verify.sh $2 & + sleep 1 +done \ No newline at end of file diff --git a/phase2/download.sh b/phase2/download.sh new file mode 100644 index 0000000..a6338fb --- /dev/null +++ b/phase2/download.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +wget https://tornado-cash-ceremony.s3-us-west-2.amazonaws.com/circuit.json +wget https://tornado-cash-ceremony.s3-us-west-2.amazonaws.com/phase1radix2m15 +wget https://tornado-cash-ceremony.s3-us-west-2.amazonaws.com/initial.params +mv initial.params response_0 + +for i in $(seq 0 $1); do + wget https://tornado-cash-ceremony.s3-us-west-2.amazonaws.com/response_$i >> download.log 2>&1 & +done \ No newline at end of file diff --git a/phase2/verify.sh b/phase2/verify.sh index 966e67a..0bfd801 100755 --- a/phase2/verify.sh +++ b/phase2/verify.sh @@ -1,6 +1,10 @@ #!/bin/bash -x -END=$(($1-1)) -for i in $(seq 0 $END); do - cargo run --release --bin verify_contribution circuit.json response_$i response_$((i+1)) +while true; do + CURRENT=`cat current` + echo $((CURRENT+1)) > current + if [ $CURRENT -ge $1 ]; then + exit 0 + fi + ./target/release/verify_contribution circuit.json response_$CURRENT response_$((CURRENT+1)) >> verify.log 2>&1 done \ No newline at end of file