-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rs
24 lines (18 loc) · 930 Bytes
/
main.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::{error::Error, result::Result};
use gevulot_shim::{Task, TaskResult};
fn main() -> Result<(), Box<dyn Error>> {
gevulot_shim::run(run_task)
}
// The main function that executes the prover program.
fn run_task(task: Task) -> Result<TaskResult, Box<dyn Error>> {
// Display program arguments we received. These could be used for
// e.g. parsing CLI arguments with clap.
println!("prover: task.args: {:?}", &task.args);
// -----------------------------------------------------------------------
// Here would be the control logic to run the prover with given arguments.
// -----------------------------------------------------------------------
// Write generated proof to a file.
std::fs::write("/workspace/proof.dat", b"this is a proof.")?;
// Return TaskResult with reference to the generated proof file.
task.result(vec![], vec![String::from("/workspace/proof.dat")])
}