-
Notifications
You must be signed in to change notification settings - Fork 10
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
change to permanent urls #107
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 | ||
---|---|---|---|---|
|
@@ -3,17 +3,17 @@ import { VerificationKey } from './types' | |||
import axios from 'axios' | ||||
|
||||
type ICircuitParams = { | ||||
wasmFile: string | Uint8Array, | ||||
finalZkey: string | Uint8Array, | ||||
wasmFile: string | Uint8Array; | ||||
finalZkey: string | Uint8Array; | ||||
} | ||||
|
||||
type IRLNParams = ICircuitParams & { verificationKey: VerificationKey } | ||||
type IWithdrawParams = ICircuitParams | ||||
|
||||
// TODO: Change to a more permanent URL after trusted setup is complete | ||||
const resourcesURL = 'https://rln-resources-temp.s3.us-west-1.amazonaws.com/resources' | ||||
const resourcesURL = | ||||
'https://rln-trusted-setup-ceremony-pse-p0tion-production.s3.eu-central-1.amazonaws.com/circuits' | ||||
const rln20URL = `${resourcesURL}/rln-20` | ||||
const withdrawURL = `${resourcesURL}/withdraw` | ||||
const withdrawURL = `${resourcesURL}/rln-withdraw` | ||||
const treeDepthToDefaultRLNParamsURL = { | ||||
'20': rln20URL, | ||||
} | ||||
|
@@ -32,7 +32,8 @@ function parseVerificationKeyJSON(o: any): VerificationKey { | |||
if (!o.vk_beta_2) throw new Error('Verification key has no vk_beta_2') | ||||
if (!o.vk_gamma_2) throw new Error('Verification key has no vk_gamma_2') | ||||
if (!o.vk_delta_2) throw new Error('Verification key has no vk_delta_2') | ||||
if (!o.vk_alphabeta_12) throw new Error('Verification key has no vk_alphabeta_12') | ||||
if (!o.vk_alphabeta_12) | ||||
throw new Error('Verification key has no vk_alphabeta_12') | ||||
if (!o.IC) throw new Error('Verification key has no IC') | ||||
return o | ||||
} | ||||
|
@@ -47,9 +48,12 @@ export async function getDefaultRLNParams(treeDepth: number): Promise<IRLNParams | |||
if (!url) { | ||||
return undefined | ||||
} | ||||
const wasmFileURL = `${url}/circuit.wasm` | ||||
const finalZkeyURL = `${url}/final.zkey` | ||||
const verificationKeyURL = `${url}/verification_key.json` | ||||
const wasmFileURL = `${url}/RLN-20.wasm` | ||||
const finalZkeyURL = `${url}/contributions/rln-20_final.zkey` | ||||
console.log(url) | ||||
console.log(wasmFileURL) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
console.log(finalZkeyURL) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
const verificationKeyURL = `${url}/rln-20_vkey.json` | ||||
const verificationKey = await downloadVerificationKey(verificationKeyURL) | ||||
const [wasmFile, finalZkey] = await Promise.all([ | ||||
downloadBinary(wasmFileURL), | ||||
|
@@ -63,8 +67,8 @@ export async function getDefaultRLNParams(treeDepth: number): Promise<IRLNParams | |||
} | ||||
|
||||
export async function getDefaultWithdrawParams(): Promise<IWithdrawParams> { | ||||
const wasmFileURL = `${withdrawURL}/circuit.wasm` | ||||
const finalZkeyURL = `${withdrawURL}/final.zkey` | ||||
const wasmFileURL = `${withdrawURL}/RLN-Withdraw.wasm` | ||||
const finalZkeyURL = `${withdrawURL}/contributions/rln-withdraw_final.zkey` | ||||
const [wasmFile, finalZkey] = await Promise.all([ | ||||
downloadBinary(wasmFileURL), | ||||
downloadBinary(finalZkeyURL), | ||||
|
@@ -74,5 +78,3 @@ export async function getDefaultWithdrawParams(): Promise<IWithdrawParams> { | |||
finalZkey, | ||||
} | ||||
} | ||||
|
||||
|
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.
Could you remove the
console.log
s?