-
Notifications
You must be signed in to change notification settings - Fork 615
fix: include ignition data in package or save after 1st download #2591
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
14a4071
save ignition data on download
spypsy edc4e0e
Undo dev changes
spypsy 0e8e64e
gud test (browser fix)
spypsy 00758c5
use 'dirname' after 'isNode'
spypsy dd67a65
fix paths
spypsy 2fca6a0
Offset options when reading downloaded file
spypsy 1280b60
Include ignition data in circuits.js npm package
spypsy 7bf65c0
Move srs download to dockerfile
spypsy 12f5e01
Merge branch 'master' into spy/save-ignition-data
spypsy fef74bb
fixes + add circuits.js gitignore
spypsy c511f74
revert deploy_npm.sh changes
spypsy 4f23228
revert EOF newline
spypsy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| resources/ignition/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #!/bin/sh | ||
| # Downloads the ignition trusted setup transcripts. | ||
| # | ||
| # See here for details of the contents of the transcript.dat files: | ||
| # https://github.com/AztecProtocol/ignition-verification/blob/master/Transcript_spec.md | ||
| # | ||
| # To download all transcripts. | ||
| # ./download_ignition.sh | ||
| # | ||
| # To download a range of transcripts, e.g. 0, 1 and 2. | ||
| # ./download_ignition.sh 2 | ||
| # | ||
| # If a checksums file is available, it will be used to validate if a download is required | ||
| # and also check the validity of the downloaded transcripts. If not the script downloads | ||
| # whatever is requested but does not check the validity of the downloads. | ||
| set -eu | ||
|
|
||
| mkdir -p ignition | ||
| cd ignition | ||
| mkdir -p monomial | ||
| cd monomial | ||
| NUM=${1:-19} | ||
| RANGE_START=${2:-} | ||
| RANGE_END=${3:-} | ||
| APPEND=${4:-"false"} | ||
|
|
||
| if command -v sha256sum > /dev/null; then | ||
| SHASUM=sha256sum | ||
| else | ||
| SHASUM="shasum -a 256" | ||
| fi | ||
|
|
||
| checksum() { | ||
| grep transcript${1}.dat checksums | $SHASUM -c | ||
| return $? | ||
| } | ||
|
|
||
| download() { | ||
| # Initialize an empty variable for the Range header | ||
| RANGE_HEADER="" | ||
|
|
||
| # If both RANGE_START and RANGE_END are set, add them to the Range header | ||
| if [ -n "$RANGE_START" ] && [ -n "$RANGE_END" ]; then | ||
| RANGE_HEADER="-H Range:bytes=$RANGE_START-$RANGE_END" | ||
| fi | ||
|
|
||
| # Download the file | ||
| if [ "$APPEND" = "true" ]; then | ||
| curl $RANGE_HEADER https://aztec-ignition.s3-eu-west-2.amazonaws.com/MAIN%20IGNITION/monomial/transcript${1}.dat >> transcript${1}.dat | ||
| else | ||
| curl $RANGE_HEADER https://aztec-ignition.s3-eu-west-2.amazonaws.com/MAIN%20IGNITION/monomial/transcript${1}.dat > transcript${1}.dat | ||
| fi | ||
|
|
||
| } | ||
|
|
||
| for TRANSCRIPT in $(seq 0 $NUM); do | ||
| NUM=$(printf %02d $TRANSCRIPT) | ||
| if [ -f checksums ] && [ -z "$RANGE_START" ] && [ -z "$RANGE_END" ] ; then | ||
| checksum $NUM && continue | ||
| download $NUM | ||
| checksum $NUM || exit 1 | ||
| else | ||
| download $NUM | ||
| fi | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this file changed other than whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed no, will remove from PR