Skip to content

Commit

Permalink
chore: update readme about sepolia (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang authored May 8, 2024
1 parent 62d4677 commit 808c1d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This repository is split into 3 components:
### Installation

To install our Rust circuit SDK into a Cargo project, run:

```bash
cargo add axiom-sdk
```
Expand Down Expand Up @@ -39,17 +40,20 @@ pub struct AccountAgeInput {
### Compute Function Specification

You must implement the `AxiomComputeFn` on your input struct. There is only one trait function that you must implement:

```rust
fn compute(
api: &mut AxiomAPI,
assigned_inputs: AccountAgeCircuitInput<AssignedValue<Fr>>,
) -> Vec<AxiomResult>
```

where `AccountAgeCircuitInput` should be replaced with your derived circuit input struct.

The `AxiomAPI` struct gives you access to subquery calling functions in addition to a `RlcCircuitBuilder` to specify your circuit. Your compute function should then return any values that you wish to pass on-chain in the `Vec<AxiomResult>` -- an `AxiomResult` is either an enum of either `HiLo<AssignedValue<Fr>>` or `AssignedValue<Fr>` (in which case it is converted to hi-lo for you).

Here is an example:

```rust
impl AxiomComputeFn for AccountAgeInput {
fn compute(
Expand Down Expand Up @@ -83,12 +87,14 @@ impl AxiomComputeFn for AccountAgeInput {
### Running The Circuit

To run your circuit, create a `main` function call the `run_cli` function with your input struct as the generic parameter:

```rust
fn main() {
env_logger::init();
run_cli::<AccountAgeInput>();
}
```

The `main` function will run a CLI that allows you to run mock proving, key generation, and proving of your circuit. The CLI has the following commands:

```
Expand Down Expand Up @@ -117,3 +123,4 @@ cargo run --example account_age -- --input data/account_age_input.json -k 12 -p

where `PROVIDER_URI` is a JSON-RPC URI, and `CMD` is `mock`, `prove`, `keygen`, or `run`.

Note that for the above example to work with the provied `data/account_age_input.json`, the `PROVIDER_URI` needs to be a JSON-RPC URI for Sepolia Testnet.

0 comments on commit 808c1d4

Please sign in to comment.