Compiling & Proving
We recommend to host your circuit as a separate process as it can take up much more computing resource than typical web servers.
Spin Up a Prover for Your AppCircuit
The fastest way to spin up a prover is to use the prover service module in the Go SDK. prover.NewService
automatically compiles your circuit and sets up proving/verifying keys if your circuit changes or if it's your first time compiling. Read more about Prover Service.
You can also opt for manually compile & prove with Go
Calling the Prover From Node.js
Sending the Proof Request to Your Prover
Error handling
If you receive ERROR_INVALID_INPUT, check your data against Limits and Performance to see if any data exceeds the limits.
Sending Your Proof to Brevis
Pay for Your Request on the Data Source Chain
Call BrevisRequest.sendRequest()
with the id acquired from brevisRes
and the fee (in native token). contract addresses
Wait for Your App Contract to be Called
Since Brevis calls your app contract's callback function when the final proof is submitted, you can listen to your app contract's event. Or, you could use the built-in function to wait for final tx submission.
Last updated