Skip to content

Commit

Permalink
Update dev docs and rzup readme to use revamed rzup (risc0#2202)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchmErik authored Aug 9, 2024
1 parent fb18ffa commit e1707dc
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 39 deletions.
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@ When testing and running examples within this library, you can install `cargo-ri

```bash
cargo install --force --path risc0/cargo-risczero
cargo risczero install
```

Otherwise, if using a stable version branch, you can install `cargo-risczero` through the standard flow:

```bash
curl -L https://risczero.com/install | bash
rzup
rzup install
```

Optionally, you can specify which version of `cargo-risczero` to install with:

```bash
rzup --version $VERSION
rzup install --version $VERSION
```

> NOTE: It is only important that you install `cargo-risczero` with a matching version of the `zkvm` crate when interacting with the proof system as a separate, pre-built process ([`ExternalProver`](https://docs.rs/risc0-zkvm/latest/risc0_zkvm/struct.ExternalProver.html)), which is currently the default. If you are using the `prove` feature on the `risc0-zkvm` crate for the host, this will compile the proving system into the host binary.
Expand Down
5 changes: 2 additions & 3 deletions examples/browser-verify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ cargo xtask gen-receipt
Next, install the `cargo-risczero` tool and install the toolchain with:

```bash
cargo install cargo-binstall
cargo binstall cargo-risczero
cargo risczero install
curl -L https://risczero.com/install | bash
rzup install
```

### Running a test of in-browser verification
Expand Down
6 changes: 3 additions & 3 deletions risc0/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ fn detect_toolchain(name: &str) {
let stdout = String::from_utf8(result.stdout).unwrap();
if !stdout.lines().any(|line| line.trim().starts_with(name)) {
eprintln!("The 'risc0' toolchain could not be found.");
eprintln!("To install the risc0 toolchain, use cargo-risczero.");
eprintln!("To install the risc0 toolchain, use rzup.");
eprintln!("For example:");
eprintln!(" cargo binstall cargo-risczero");
eprintln!(" cargo risczero install");
eprintln!(" curl -L https://risczero.com/install | bash");
eprintln!(" rzup install");
std::process::exit(-1);
}
}
Expand Down
6 changes: 3 additions & 3 deletions risc0/cargo-risczero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ To install this Cargo subcommand, first you'll want to [install
Rust][install-rust] and then you'll execute:

```bash
cargo install cargo-binstall
cargo binstall cargo-risczero
curl -L https://risczero.com/install | bash
rzup install
```

To install from local source, use:
Expand All @@ -38,7 +38,7 @@ The `install` command installs the latest RISC Zero toolchain. This toolchain is
needed to compile guest programs into ELF binaries that the zkVM can execute.

```bash
cargo risczero install
rzup install
```

You can verify it was installed correctly by running:
Expand Down
8 changes: 3 additions & 5 deletions risc0/zkvm/src/guest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
//! ## Installation
//!
//! To build and run RISC Zero zkVM code, you will need to install the RISC Zero
//! toolchain, which can be done using the
//! [`cargo-risczero`](https://crates.io/crates/cargo-risczero) tool:
//! toolchain, which can be done using the rzup utility:
//!
//! ```sh
//! cargo install cargo-binstall
//! cargo binstall cargo-risczero
//! cargo risczero install
//! curl -L https://risczero.com/install | bash
//! rzup install
//! ```
//!
//! ## Example
Expand Down
10 changes: 5 additions & 5 deletions rzup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ curl -L https://risczero.com/install | bash
To install the latest RISC Zero release version:

```sh
rzup
rzup install
```

To install a specific release version:

```sh
rzup --version <VERSION>
rzup install --version <VERSION>
```

Where `VERSION` can be replaced with specified RISC Zero release (e.g.,
Where `VERSION` can be replaced with a specified RISC Zero release (e.g.,
`1.0.0`). See our [releases](https://github.com/risc0/risc0/releases) for more
information.


To enable verbose installation logs:
```sh
rzup --verbose
rzup --verbose install
```

To view usage/help information:
Expand All @@ -40,4 +40,4 @@ rzup --help
```

---
**Tip**: Most flags have a single character shorthand. See `rzup -h` for more information.
**Tip**: Most flags have a single-character shorthand. See `rzup -h` for more information.
31 changes: 14 additions & 17 deletions website/api/zkvm/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These instructions guide you through installing or updating RISC Zero tools to b

The RISC Zero zkVM requires [Rust]. If you don't already have Rust and [rustup] installed, start by [installing Rust and rustup][install-rust]. Please follow the recommended Rust installation instructions using [rustup], as RISC Zero specifically depends on the [rustup] tool.

## Install
## Installation for x86-64 Linux and arm64 macOS

`rzup` is the RISC Zero toolchain installer. We recommend using `rzup` to manage the installation of RISC Zero.

Expand All @@ -19,38 +19,35 @@ The RISC Zero zkVM requires [Rust]. If you don't already have Rust and [rustup]
2. Run `rzup` to install RISC Zero:

```sh
rzup
rzup install
```

Running `rzup` will install the latest version of the RISC Zero toolchain.

For a specific version, use `rzup --version <version>`, where the `<version>` is a [release tag].
For a specific version, use `rzup install --version <version>`, where the `<version>` is a [release tag].

See `rzup --help` for more options. You can find out more about `rzup` [here](https://github.com/risc0/risc0/tree/main/rzup).

### Manual Installation
### Manual Installation and installation for all other systems (e.g. x86-64 macOS, arm64 Linux)

For users who prefer manual installation, follow these steps:
For users who prefer manual installation or those who use systems such as x86-64 macOS, arm64 Linux, follow these steps:

1. Install the [`cargo risczero`][cargo-risczero] tool and use its [`install` command][cargo-risczero] to install the Rust and C++ toolchains by running:
- Clone the repository with `git clone https://github.com/risc0/risc0.git`.
- In the root of the repository, install `rzup` with `cargo install --path rzup`.
- Build and install the rust toolchain with `rzup toolchain build rust`. This command may require utilities such as `cmake` and the `ninja` build system to be installed.
- Build and install the `cargo-risczero` by first checking out the branch `release-*` where `*` is `[major release number].[minor release number]` of your desired zkVM version. For example, if you would like to install version 1.1.0, run `git checkout origin/release-1.1` and run `cargo install --path risc0/cargo-risczero`.

```sh
cargo install cargo-binstall
cargo binstall cargo-risczero
cargo risczero install
```

> Note: To install a specific version instead of using the latest stable version, use `cargo binstall cargo-risczero@<version>`, where the version is a [release tag].
>
> The version used must match the `risc0-zkvm` version from your guest and host.
For x86-64 linux and arm64 macOS, install the C++ toolchains by running:

2. For x86-64 macOS, you must run `cargo risczero build-toolchain` instead of `cargo risczero install`.
```sh
rzup install cpp
```

## Update

To update your installation:

1. Run `rzup` to update the RISC Zero toolchain to the latest [release tag] version.
1. Run `rzup update` to update the RISC Zero toolchain to the latest [release tag] version.

After you update your installation, be sure to update your project's RISC Zero crates. To do this, you must update all RISC Zero dependencies in your project's host and guest `Cargo.toml` files. In most projects, this is done by updating the host and guest `risc0-zkvm` crate and the `risc0-build` build dependency. They should be updated to use the version number displayed by `cargo risczero --version`.

Expand Down

0 comments on commit e1707dc

Please sign in to comment.