|
| 1 | +# Contributing to risc0 |
| 2 | + |
| 3 | +Thank you for your interest in contributing to RISC Zero! We welcome contributions from everyone. |
| 4 | + |
| 5 | +If you have any questions about contributing, or about the project in general, please ask in our [Discord channel](https://discord.gg/risczero). |
| 6 | + |
| 7 | +## Quick Start |
| 8 | + |
| 9 | +To run the test suite, the following dependencies are needed: |
| 10 | + |
| 11 | +#### [Git Large File Storage](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage) |
| 12 | + |
| 13 | +Once installed, run: |
| 14 | + |
| 15 | +```console |
| 16 | +git lfs install |
| 17 | +git lfs pull |
| 18 | +``` |
| 19 | + |
| 20 | +#### [Rust](https://www.rust-lang.org/tools/install) |
| 21 | + |
| 22 | +```console |
| 23 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 24 | +``` |
| 25 | + |
| 26 | +#### [RISC Zero toolchain](https://dev.risczero.com/api/zkvm/quickstart#1-install-the-risc-zero-toolchain) |
| 27 | + |
| 28 | +The RISC Zero toolchain must match the version of crates you are compiling. |
| 29 | + |
| 30 | +When testing and running examples within this library, you can install `cargo-risczero` from source: |
| 31 | + |
| 32 | +```console |
| 33 | +cargo install --force --path risc0/cargo-risczero |
| 34 | +cargo risczero install |
| 35 | +``` |
| 36 | + |
| 37 | +Otherwise, if using a stable version branch, you can install `cargo-risczero` through the standard flow: |
| 38 | + |
| 39 | +```console |
| 40 | +cargo install cargo-binstall |
| 41 | +cargo binstall cargo-risczero |
| 42 | +cargo risczero install |
| 43 | +``` |
| 44 | + |
| 45 | +Optionally, you can specify which version of `cargo-risczero` to install with: |
| 46 | + |
| 47 | +```console |
| 48 | +cargo binstall cargo-risczero@<version> |
| 49 | +``` |
| 50 | + |
| 51 | +> 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. |
| 52 | +
|
| 53 | +#### [Foundry](https://book.getfoundry.sh/getting-started/installation) |
| 54 | + |
| 55 | +```console |
| 56 | +curl -L https://foundry.paradigm.xyz | bash |
| 57 | +foundryup |
| 58 | +``` |
| 59 | + |
| 60 | +#### xtask wasm tools (if testing [browser-verify](./examples/browser-verify)) |
| 61 | + |
| 62 | +```console |
| 63 | +cargo xtask install |
| 64 | +cargo xtask gen-receipt |
| 65 | +``` |
| 66 | + |
| 67 | +## PR Checklist |
| 68 | + |
| 69 | +Before submitting a PR, ensure the following: |
| 70 | + |
| 71 | +1. Fork the `risc0` repository and create a new branch there to do your work. |
| 72 | +2. Format with `cargo fmt --all`. |
| 73 | +3. Lint with `cargo clippy --all-targets`. |
| 74 | +4. Tests pass with `cargo test -F default -F prove --workspace` |
| 75 | +5. Open a PR against the `main` branch. |
0 commit comments