See these docs for an explanation of oracles. Those docs implement an oracle server in typescript. This repo implements an oracle server in rust. Rust has been chosen here due to its similarity to Noir syntax, so unconstrained functions and oracle functions should look very similar.
- Write Noir code which makes oracle calls. See example here.
- In main.rs, route each oracle call to a handler.
- Write handlers to format the inputs, call rust functions, and format the outputs.
- Write rust functions to compute whatever you wanted your oracle call to compute.
Co-written @iAmMichaelConnor @kashbrti (pair programming, and not sure why the initial day of commits don't reflect the shared contributions, since "co-authored-by" was set in the commit messages).
In one terminal:
cargo build && RUST_LOG=info cargo run
Wait for the server to start at http://127.0.0.1:3000
In another terminal:
cd noir_packages
nargo test --show-output --oracle-resolver http://127.0.0.1:3000