sudo apt update && sudo apt upgrade
sudo apt install cmake build-essential -y
# install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
# install the RISC-V target
rustup target add riscv32i-unknown-none-elf
# Install the Nexus zkVm
cargo install --git https://github.com/nexus-xyz/nexus-zkvm cargo-nexus --tag 'v0.2.0' --force
cargo nexus new nexus-projectV2
cd nexus-projectV2
echo '#![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),
}
}
#[nexus_rt::main]
fn main() {
let n = 7;
let result = fib(n);
assert_eq!(result, 13);
}' > ./src/main.rs
cargo nexus run
cargo nexus prove
![Screenshot 2024-07-21 at 12 01 36 AM](https://private-user-images.githubusercontent.com/153465797/350722798-6fd567e0-5666-46ef-afb5-af8eb3e03f8d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNDM2MjQsIm5iZiI6MTczOTA0MzMyNCwicGF0aCI6Ii8xNTM0NjU3OTcvMzUwNzIyNzk4LTZmZDU2N2UwLTU2NjYtNDZlZi1hZmI1LWFmOGViM2UwM2Y4ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxOTM1MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZmJhMjlmMzFjYTdkOWUyZTYwZDkyMDJkYzIzZjQ0N2ExOWQyNGI1ZjdhNDJiNzNmODc4YjZjNWM3ZmQ4Mzg3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2l-_h4tUlCh63spsTnPfWNwYCHuDu9faZRwijU9pN3Q)
save the nexus-proof
file in a safe place
you can download the file from VPS with scp
if your os is linux or macOS
scp -r root@your-server-ip:/root/nexus-projectV2/nexus-proof .