-
Notifications
You must be signed in to change notification settings - Fork 7
/
g2.sh
executable file
·20 lines (16 loc) · 1.07 KB
/
g2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
mkdir g2points;
rm g2points/*.dat
cd g2points;
echo "Downloading G2 points of each transcript_0"
if type "jq" > /dev/null; then
TRANSCRIPT_NAMES=$(curl https://aztec-ignition.s3.eu-west-2.amazonaws.com/MAIN+IGNITION/manifest.json | jq ".participants | [ to_entries[] | (if .value.position|tostring|length == 1 then (\"00\" + (.value.position|tostring)) else if .value.position|tostring|length == 2 then (\"0\" + (.value.position|tostring)) else (.value.position|tostring) end end) + \"_\" + .value.address ] ")
echo $TRANSCRIPT_NAMES | tr '[:upper:]' '[:lower:]' | jq " to_entries[] | \"curl https://aztec-ignition.s3.eu-west-2.amazonaws.com/MAIN+IGNITION/\" + (.value) + \"/transcript00.dat -H 'Range: bytes=322560028-322560283' > \" + (.value) + \"_g2.dat\" " > keys
# Manual addition of sealed transcript
echo "curl https://aztec-ignition.s3.eu-west-2.amazonaws.com/MAIN+IGNITION/sealed/transcript00.dat -H 'Range: bytes=322560028-322560283' > 198_sealed_g2.dat" >> keys
fi
while read p;
do
echo $p
eval $(sed -e 's/^"//' -e 's/"$//' <<< $p)
done < keys;