@@ -35,6 +35,8 @@ First, install Rust: https://www.rust-lang.org/tools/install.
35
35
36
36
Also, make sure you have a working version of [ cmake] ( https://cmake.org/ ) .
37
37
38
+ Note: cmake is a required dependency.
39
+
38
40
Next, install the RISC-V target:
39
41
40
42
``` shell
@@ -61,6 +63,12 @@ This should print the available CLI commands.
61
63
cargo nexus new nexus-project
62
64
```
63
65
66
+ And change directory to the new project:
67
+
68
+ ``` shell
69
+ cd nexus-project
70
+ ```
71
+
64
72
This will create a new Rust project directory with the following structure:
65
73
66
74
``` shell
@@ -75,20 +83,12 @@ As an example, you can change the content of `./src/main.rs` to:
75
83
76
84
``` rust
77
85
#![cfg_attr(target_arch = " riscv32" , no_std, no_main)]
78
-
79
- fn fib (n : u32 ) -> u32 {
80
- match n {
81
- 0 => 0 ,
82
- 1 => 1 ,
83
- _ => fib (n - 1 ) + fib (n - 2 ),
84
- }
85
- }
86
-
86
+
87
+ use nexus_rt :: write_log;
88
+
87
89
#[nexus_rt:: main]
88
90
fn main () {
89
- let n = 7 ;
90
- let result = fib (n );
91
- assert_eq! (result , 13 );
91
+ write_log (" Hello, World!\ n" );
92
92
}
93
93
```
94
94
@@ -98,6 +98,11 @@ fn main() {
98
98
cargo nexus run
99
99
```
100
100
101
+ You should see the program print:
102
+ ``` bash
103
+ " Hello, World!"
104
+ ```
105
+
101
106
This command should run successfully. To print the full step-by-step execution trace on the NVM, run:
102
107
103
108
``` bash
@@ -122,6 +127,8 @@ Finally, load and verify the proof:
122
127
cargo nexus verify
123
128
```
124
129
130
+ You should see the program print "Verifying Proof..." and finally "Finished" when complete.
131
+
125
132
## Learn More
126
133
127
134
Run ` cargo nexus --help ` to see all the available commands.
0 commit comments