How to use the snarkjs.generateCall function in snarkjs

To help you get started, we’ve selected a few snarkjs examples, based on popular ways it is used in public projects.

github LimeChain / etherlime / packages / etherlime / cli-commands / zk-proof / generate-call.js View on Github external
const run = async (signals, proof) => {
	const publicSignals = require(`${process.cwd()}/${generatedProofPath}/${signals}`);
	const generatedProof = zkSnark.unstringifyBigInts((require(`${process.cwd()}/${generatedProofPath}/${proof}`)));

	createGenerateCallFolder(generatedCallPath);

	const generatedCall = await zkSnark.generateCall(publicSignals, generatedProof);
	
	
	fs.writeFileSync(`${generatedCallPath}/generatedCall.json`, zkSnark.stringifyBigInts(generatedCall));
	console.log('===== Generated Call Complete! =====');
	console.log('===== Generated Call: =====')
	console.log(generatedCall)
};