You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the `demo/` directory, go one level up to the `crypto-benchmarks.rs` directory and build the CLI binary:
4
6
5
-
This folder contains scripts that orchestrate end-to-end demonstrations of BLS-based vote aggregation and certificate generation/verification for the Leios project.
7
+
```bash
8
+
cd ..
9
+
cargo build --release
10
+
```
6
11
7
-
## Prerequisites
12
+
**Register the CLI path (while still in `crypto-benchmarks.rs/`)** so all demo scripts can find it:
8
13
9
-
- Ensure the CLI built from the repository root is available; see `crypto-benchmarks.rs/ReadMe.md` for build instructions and usage details.
10
-
- Ensure Python 3 is available with `cbor2` installed.
The scripts are designed to be run from the `demo/` directory.
24
+
Verify the `.env_cli` file and sanity‑check the CLI:
22
25
23
-
### Run Step by Step (Manual Mode)
26
+
```bash
27
+
cat scripts/.env_cli
28
+
source scripts/.env_cli
29
+
echo"$CLI"
30
+
$CLI --help
31
+
```
24
32
25
-
You can run each script individually to understand and control each step of the process for a given number of voters (e.g., 100). Use the `-d` option to specify the output directory (e.g., `run100`).
33
+
Ensure the CLI binary is accessible and working before proceeding.
26
34
27
-
#### 10_init_inputs.sh
35
+
##Python Environment Setup
28
36
29
-
Initialize inputs for N voters:
37
+
Create and activate a Python virtual environment, then install the required dependencies:
(Flask is required to serve the demo UI, and cbor2 is used for parsing CBOR files.)
46
+
47
+
## Run a Single End-to-End Demo
36
48
37
-
Build the registry from initialized inputs:
49
+
From the `demo/` directory, run the combined script to generate a complete demo for a specified number of voters and pools. Ensure `.env_cli` exists in this directory:
50
+
51
+
(If you haven’t yet, run the **Setup** steps above to build the CLI and create `scripts/.env_cli`.)
Cast votes with a specified fraction of voters voting (e.g., 1.0 means all vote):
59
+
1. Initialize inputs
60
+
2. Build the registry
61
+
3. Cast votes
62
+
4. Generate the aggregated certificate
63
+
5. Verify the certificate
64
+
6. Export data for the UI
46
65
47
-
```bash
48
-
scripts/30_cast_votes.sh -d run100 -f 0.75
49
-
```
66
+
All output files will be placed under `demo/run100/`.
50
67
51
-
#### 40_make_certificate.sh
68
+
##Launch the Demo UI
52
69
53
-
Generate the aggregated certificate:
70
+
After generating a demo run, start the UI server from the `demo/` directory:
54
71
55
72
```bash
56
-
scripts/40_make_certificate.sh -d run100
73
+
python3 ui/server.py
57
74
```
58
75
59
-
#### 50_verify_certificate.sh
76
+
Open your browser at [http://127.0.0.1:5050/ui](http://127.0.0.1:5050/ui) to explore the results.
77
+
78
+
## Run Step by Step (Manual Mode)
79
+
80
+
For advanced users who want to control each phase individually, the following scripts can be run sequentially from the `demo/` directory. Use the `-d` option to specify the output directory (e.g., `run100`).
3.**Cast votes with a fraction of voters participating:**
74
95
75
-
1. Initialize inputs (`10_init_inputs.sh`)
76
-
2. Build a registry (`20_make_registry.sh`)
77
-
3. Cast votes (`30_cast_votes.sh`)
78
-
4. Make a certificate (`40_make_certificate.sh`)
79
-
5. Verify the certificate (`50_verify_certificate.sh`)
80
-
6. Export data for the UI (`60_export_demo_json.sh`)
96
+
```bash
97
+
scripts/30_cast_votes.sh -d run100 -f 0.75
98
+
```
81
99
82
-
All files are placed in `demo/run100/`.
100
+
4.**Generate the aggregated certificate:**
83
101
84
-
### Launch the Demo UI
102
+
```bash
103
+
scripts/40_make_certificate.sh -d run100
104
+
```
85
105
86
-
After generating a demo run (for example via `scripts/70_run_one.sh`), start the UI server from this directory:
106
+
5.**Verify the generated certificate:**
87
107
88
108
```bash
89
-
python3 ui/server.py
109
+
scripts/50_verify_certificate.sh -d run100
90
110
```
91
111
92
-
Then open your browser at [http://127.0.0.1:5050/ui](http://127.0.0.1:5050/ui) to explore the results.
93
-
94
112
## Notes
95
113
96
114
- All scripts must be run from within the `demo/` directory.
@@ -101,4 +119,5 @@ Then open your browser at [http://127.0.0.1:5050/ui](http://127.0.0.1:5050/ui) t
101
119
votes_bytes / certificate_bytes
102
120
```
103
121
104
-
which illustrates the storage/bandwidth savings achieved by BLS aggregation.
122
+
which illustrates the storage and bandwidth savings achieved by BLS aggregation.
123
+
- The CLI path is stored in `scripts/.env_cli` (generated by `00_set_cli.sh`). Source it with `source scripts/.env_cli` to make `$CLI` available in your shell.
0 commit comments