Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(prism-bin): renaming to prism-cli, refactoring args/config, and adding full-node type #145

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ readme = "README.md"

[workspace]
default-members = [
"crates/bin",
"crates/cli",
"crates/tests",
"crates/node_types/prover",
"crates/node_types/lightclient",
Expand All @@ -26,7 +26,7 @@ default-members = [
]

members = [
"crates/bin",
"crates/cli",
"crates/tests",
"crates/node_types/prover",
"crates/node_types/lightclient",
Expand Down Expand Up @@ -93,7 +93,7 @@ prism-storage = { path = "crates/storage" }
prism-nova = { path = "crates/zk/nova" }
prism-da = { path = "crates/da" }
prism-errors = { path = "crates/errors" }
prism-bin = { path = "crates/bin" }
prism-cli = { path = "crates/cli" }
prism-groth16 = { path = "crates/zk/groth16" }
prism-prover = { path = "crates/node_types/prover" }
prism-tests = { path = "crates/tests" }
Expand Down
43 changes: 33 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,55 @@ We are currently experimenting with various proof systems and have handwritten g

### Prerequisites

### Install Redis
### Install Dependencies

Redis serves as a powerful in-memory database that is used to store the label-value pairs. Follow these steps to install Redis:
We use `just` as a task runner. Once installed, you can install the rest of the dependencies with:

1. Download Redis from [Redis Download Page](https://redis.io/download/).
2. Follow the installation instructions for your operating system.
```bash
just install-deps
```

### Building

To build the project, run:

```bash
just build
```

### Install Celestia
This will compile the `prism-cli` binary and sp1 `ELF` that are used to run the prover, light-client, and full-node.

A DA layer such as Celestia is an important component for data security and availability. It stores the cryptographic commitments and parameters of the zkSNARKs and ideally enables them to be verified. Follow the instructions [here](https://github.com/celestiaorg/apollo) to deploy a local testnet.
### Running a local DA layer

To run a local Celestia network for testing, use:

```bash
just celestia-up
```

### Starting the prover

If Redis is installed and the local devnet is running, Prism can be started. Prism can be started in two different ways, as a prover (service provider and proof generator) or as a light-client (to verify the proofs posted on Celestia using the cryptographic commitments). To start the prover, run the following command:
If the dependencies are installed and the local devnet is running, a prism node can be started.

Prism can be started in three different ways:
1. as a prover (service provider and proof generator)
2. as a light-client (to verify the proofs posted on Celestia using the cryptographic commitments)
3. as a full-node (acts as a service provider, processing all transactions and making the state available to the light-clients)

To start the prover, run:
```bash
cargo run prover
prism-cli prover
```

This will output the prover's verifying key in the logs, which you can use along with the light-client and full-node to verify the proofs.

distractedm1nd marked this conversation as resolved.
Show resolved Hide resolved
to start the light-client, run the following command:

```bash
cargo run light-client
prism-cli light-client|full-node --verifying-key <verifying-key>
```

You can then interact with Prism via the interfaces defined in [webserver.rs](https://github.com/deltadevsde/prism/blob/main/src/webserver.rs). Based on the data exchanged or stored via the interface the global indexed merkle tree changes and proofs based on these changes then are created in defined epochs (currently 60 seconds) and cryptographic commitments including the proof parameters are posted in the Celestia namespace.
You can then interact with Prism via the interfaces defined in [webserver.rs](https://github.com/deltadevsde/prism/blob/main/crates/prover/src/webserver.rs).

## Contributions

Expand Down
86 changes: 0 additions & 86 deletions crates/bin/src/main.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/bin/Cargo.toml → crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "prism-bin"
name = "prism-cli"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
Loading
Loading