Skip to content

Commit ac24436

Browse files
committed
docs: add guide to run SNARK tests
1 parent b2c5b73 commit ac24436

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

RUN-SNARK-TESTS.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Running SNARK Proofs Tests
2+
3+
This guide walks you through running SNARK proof tests for Mithril, covering both unit tests and the full end-to-end test suite.
4+
5+
## Prerequisites
6+
7+
- **Operating System**: Linux (Ubuntu 24.04 or later)
8+
- **Rust toolchain**: latest stable version
9+
10+
## Getting Started
11+
12+
Clone the Mithril repository:
13+
14+
```bash
15+
git clone git@github.com:input-output-hk/mithril.git
16+
cd mithril
17+
```
18+
19+
## Unit Tests
20+
21+
Run the full workspace unit tests with the `future_snark` feature enabled:
22+
23+
```bash
24+
cargo test --all-features --features future_snark
25+
```
26+
27+
## End-to-End Test
28+
29+
### Branch Setup
30+
31+
Switch to the dedicated SNARK end-to-end test branch:
32+
33+
```bash
34+
git switch jpraynaud/3107-snark-e2e-test
35+
```
36+
37+
### Working Directory Configuration
38+
39+
> **Important**: The working directory path must be kept short because the Cardano node uses local socket files with path length limitations. Use an absolute path such as the example below. **Do not** use `.` as the working directory, this could delete your entire repository.
40+
41+
Set the working directory environment variable:
42+
43+
```bash
44+
WORK_DIRECTORY=~/Desktop/mithril/artifacts
45+
```
46+
47+
### Running the Test
48+
49+
The following command compiles all required nodes and runs the end-to-end test with SNARK proofs. Expect the full process to take approximately **10 to 20 minutes** depending on your machine:
50+
51+
```bash
52+
cargo build --release --features future_snark \
53+
-p mithril-aggregator \
54+
-p mithril-signer \
55+
-p mithril-client-cli \
56+
-p mithril-relay \
57+
-p mithril-end-to-end \
58+
&& RUST_BACKTRACE=1 ./target/release/mithril-end-to-end -vvvv \
59+
--bin-directory ./target/release/ \
60+
--work-directory=$WORK_DIRECTORY \
61+
--devnet-scripts-directory=./mithril-test-lab/mithril-devnet \
62+
--mithril-era=lagrange \
63+
--aggregate-signature-type=Snark \
64+
--cardano-epoch-length=50 \
65+
--cardano-slot-length=1.0 \
66+
--mithril-run-interval 500
67+
```

0 commit comments

Comments
 (0)