risc0_zkvm

Function default_prover

Source
pub fn default_prover() -> Rc<dyn Prover>
Available on crate feature client and non-target_os="zkvm" only.
Expand description

Return a default Prover based on environment variables and feature flags.

The RISC0_PROVER environment variable, if specified, will select the following Prover implementation:

  • bonsai: BonsaiProver to prove on Bonsai.
  • local: LocalProver to prove locally in-process. Note: this requires the prove feature flag.
  • ipc: ExternalProver to prove using an r0vm sub-process. Note: r0vm must be installed. To specify the path to r0vm, use RISC0_SERVER_PATH.

If RISC0_PROVER is not specified, the following rules are used to select a Prover:

  • BonsaiProver if the BONSAI_API_URL and BONSAI_API_KEY environment variables are set unless RISC0_DEV_MODE is enabled.
  • LocalProver if the prove feature flag is enabled.
  • ExternalProver otherwise.