Once the params are set, you can run the script to generate the [`JSON file`](./input.json).
```bash
sudo bash ./gen_input.sh
```
### Build the Circuit
To build the circuit and measure the time to build, you can simply run the script:
```bash
sudo bash ./build_circuit.sh
```
To see the source code of how to build the circuit, see [`build_circ`](./src/bin/build_circ.rs).
### Generate the Proof
After generating the circuit input (in a JSON file),
you can run the circuits to generate the proofs.
First make sure you have the [`JSON file`](./input.json), then follow the steps:
#### Step 1: Setting Up Circuit Parameters
Parameters for the circuit can be defined in [`circ_params.sh`](./circ_params.sh).
You can customize the test parameters by setting the following environment variables:
```bash
export MAX_DEPTH=32 # maximum depth of the slot tree
export MAX_LOG2_N_SLOTS=8 # Depth of the dataset tree = ceiling_log2(max_slots)
export BLOCK_TREE_DEPTH=5 # depth of the mini tree (block tree)
export N_FIELD_ELEMS_PER_CELL=272 # number of field elements per cell
export N_SAMPLES=5 # number of samples to prove
```
#### Step 2: Run the Script
Once the params are set, you can run the script to generate the proof.
You can also see the time taken to generate the proof.
```bash
sudo bash ./prove.sh
```
### Build, Prove, and Verify
To automate the whole process, you can run the following script
the script builds the circuit, loads the JSON circuit input, generates the proof, and verifies it.
It also shows the time taken for each step.
Make sure that you generate the circuit input prior to this so that you have the [`JSON input file`](./input.json) and set the [`circ_params.sh`](./circ_params.sh).
```bash
sudo bash ./prove_and_verify.sh
```
To inspect the source code, see [`prove_and_verify`](./src/bin/prove_and_verify.rs).