Skip to content

Commit

Permalink
Update README.md (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
SVell authored Dec 11, 2024
1 parent 675f214 commit c1a61b6
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ First, install Rust: https://www.rust-lang.org/tools/install.

Also, make sure you have a working version of [cmake](https://cmake.org/).

Note: cmake is a required dependency.

Next, install the RISC-V target:

```shell
Expand All @@ -61,6 +63,12 @@ This should print the available CLI commands.
cargo nexus new nexus-project
```

And change directory to the new project:

```shell
cd nexus-project
```

This will create a new Rust project directory with the following structure:

```shell
Expand All @@ -75,20 +83,12 @@ As an example, you can change the content of `./src/main.rs` to:

```rust
#![cfg_attr(target_arch = "riscv32", no_std, no_main)]

fn fib(n: u32) -> u32 {
match n {
0 => 0,
1 => 1,
_ => fib(n - 1) + fib(n - 2),
}
}


use nexus_rt::write_log;

#[nexus_rt::main]
fn main() {
let n = 7;
let result = fib(n);
assert_eq!(result, 13);
write_log("Hello, World!\n");
}
```

Expand All @@ -98,6 +98,11 @@ fn main() {
cargo nexus run
```

You should see the program print:
```bash
"Hello, World!"
```

This command should run successfully. To print the full step-by-step execution trace on the NVM, run:

```bash
Expand All @@ -122,6 +127,8 @@ Finally, load and verify the proof:
cargo nexus verify
```

You should see the program print "Verifying Proof..." and finally "Finished" when complete.

## Learn More

Run `cargo nexus --help` to see all the available commands.
Expand Down

0 comments on commit c1a61b6

Please sign in to comment.