|
|
@ -21,8 +21,10 @@ export const createCircuit = async (entryPoint: string, apiKey: string) => { |
|
|
|
if (file === entryPoint) continue |
|
|
|
if (file === entryPoint) continue |
|
|
|
files.push(new File([deps[file]], file)) |
|
|
|
files.push(new File([deps[file]], file)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(`creating circuit "${entryPoint}"...`) |
|
|
|
const circuitProject = await client.createCircuit(files) |
|
|
|
const circuitProject = await client.createCircuit(files) |
|
|
|
|
|
|
|
console.log(`circuit created ${circuitProject.circuit_id}`) |
|
|
|
return circuitProject |
|
|
|
return circuitProject |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -34,7 +36,9 @@ export const createCircuit = async (entryPoint: string, apiKey: string) => { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export const proveCircuit = async (circuitId: string, signals: { [id: string]: string }, apiKey: string) => { |
|
|
|
export const proveCircuit = async (circuitId: string, signals: { [id: string]: string }, apiKey: string) => { |
|
|
|
client.authorize({ apiKey }) |
|
|
|
client.authorize({ apiKey }) |
|
|
|
|
|
|
|
console.log(`proving circuit ${circuitId}...`) |
|
|
|
const proof = await client.proveCircuit(circuitId, JSON.stringify(signals)) |
|
|
|
const proof = await client.proveCircuit(circuitId, JSON.stringify(signals)) |
|
|
|
|
|
|
|
console.log(`proof id: ${proof.proof_id}`) |
|
|
|
return proof |
|
|
|
return proof |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -55,4 +59,4 @@ export const saveCircuit = async (circuitProject) => { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export const loadCircuit = async (circuitId: string) => { |
|
|
|
export const loadCircuit = async (circuitId: string) => { |
|
|
|
return JSON.parse(await remix.call('fileManager', 'readFile', `.sindri/${circuitId}.json`)) |
|
|
|
return JSON.parse(await remix.call('fileManager', 'readFile', `.sindri/${circuitId}.json`)) |
|
|
|
} |
|
|
|
} |
|
|
|