Skip to content

Commit

Permalink
chore: fix filename in command (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang authored Dec 16, 2024
1 parent c9f6c33 commit 93e4890
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions book/src/writing-apps/write-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ More examples of guest programs can be found in the [benchmarks/programs](https:

Although it's usually ok to use std (like in quickstart), not all std functionalities are supported (e.g., randomness). There might be unexpected runtime errors if one uses std, so it is recommended you develop no_std libraries if possible to reduce surprises.
Even without std, `assert!` and `panic!` can work as normal. To use `std` features, one should add the following to `Cargo.toml` feature sections:

```toml
[features]
std = ["openvm/std"]
```
```

### Building and running

*TODO*: point to CLI installation instructions
_TODO_: point to CLI installation instructions

First we need to build the program targeting the OpenVM runtime, and that requires some configuration. Put the following in `openvm.toml`:

```toml
[app_fri_params]
log_blowup = 2
Expand All @@ -53,7 +55,7 @@ cargo openvm build --transpile --transpiler-config openvm.toml --transpile-to ou
Next we can keygen the generate the proving and verifying keys:

```bash
cargo openvm keygen --config app_config.toml --output outputs/pk --vk-output outputs/vk
cargo openvm keygen --config openvm.toml --output outputs/pk --vk-output outputs/vk
```

Now, to prove the program some input is needed. The input parameter is either a hex string or a file path. So for example if we want to compute the 10th fibonacci number, we can run:
Expand All @@ -70,6 +72,7 @@ No errors should be returned, and the proof should be correctly verified.
The program can take input from stdin, with some functions provided by `openvm::io`.

`openvm::io::read` takes from stdin and deserializes it into a generic type `T`, so one should specify the type when calling it:

```rust
let n: u64 = read();
```
Expand Down

0 comments on commit 93e4890

Please sign in to comment.