Skip to content
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
31 changes: 5 additions & 26 deletions docs/pages/CRISP/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,50 +128,29 @@ the script again (they must match).
The fastest way to get CRISP running is using the scripts provided in the `scripts/` directory:

```bash
# Install dependencies
pnpm install

# Setup and build the development environment
pnpm dev:setup

# Start all services (Anvil, Ciphernodes, Applications)
# Start all services (Hardhat, Ciphernodes, Applications)
pnpm dev:up

# Clean up all artifacts and generated output (e.g., builds)
# This must be run from enclave root (do cd ../../ if you are inside examples/CRISP)
pnpm clean
```

This will start all CRISP components:

- Anvil (local blockchain)
- Hardhat (local blockchain)
- Deploy all contracts
- Compile all ZK circuits
- Ciphernodes network
- CRISP applications (server, client)

```bash
# Build the development containers
pnpm dev:setup

# Start all services
pnpm dev:up

# Rebuild containers
pnpm dev:build

# Invoke the Server CLI
pnpm cli
```

Once everything is running, you can:

1. Navigate `http://localhost:3000` for the client interface
2. Add the Anvil private key to your wallet:
2. Add the Hardhat private key to your wallet:
`0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
3. Press `Connect Wallet` button and complete the association with your MetaMask account
4. Switch to `Anvil` local network (this will be handled automatically by the app. You just need to
press on the connected account on the frontend and select the network. Then, complete the
4. Switch to `Hardhat` local network (this will be handled automatically by the app. You just need
to press on the connected account on the frontend and select the network. Then, complete the
configuration on MetaMask pop-up).
5. Open a new terminal, run `pnpm cli` and start a new E3 Round.
6. Refresh and interact with the round following the Client interface.
Expand Down
27 changes: 2 additions & 25 deletions examples/CRISP/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,9 @@ You need to setup your environment variables for `client/` and `server/`. Just c
`.env.default` as `.env` and overwrite with your values the following variables (you can leave the
others initialized with the default values).

### Client
`pnpm dev:setup` already makes a copy of the env files for you.

```bash
VITE_E3_PROGRAM_ADDRESS=0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1 # Default E3 program address
```

### Server

```bash
ENCLAVE_ADDRESS="0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
CIPHERNODE_REGISTRY_ADDRESS="0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
NAIVE_REGISTRY_FILTER_ADDRESS="0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
E3_PROGRAM_ADDRESS="0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1" # CRISPProgram Contract Address
```

These address will be displayed after successfully running the `pnpm dev:up` command in a log that
The addresses will be displayed after successfully running the `pnpm dev:up` command in a log that
will look like the following:

```bash
Expand Down Expand Up @@ -140,16 +127,6 @@ This will start all CRISP components:
- Ciphernodes network
- CRISP applications (server, client)

Additionally, other specific commands are:

```bash
# Rebuild crates, compiles contracts and build the client app
pnpm dev:build

# Invoke the Server CLI
pnpm cli
```

Once everything is running, you can:

1. Navigate `http://localhost:3000` for the client interface
Expand Down
2 changes: 1 addition & 1 deletion examples/CRISP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"cli": "bash ./scripts/cli.sh",
"lint": "eslint .",
"dev:setup": "bash ./scripts/setup.sh",
"dev:build": "bash ./scripts/build.sh",
"dev:up": "bash ./scripts/dev.sh",
"test:e2e": "bash ./scripts/test_e2e.sh",
"compile:contracts": "pnpm -C packages/crisp-contracts compile",
"test:contracts": "pnpm -C packages/crisp-contracts test",
"ciphernode:add": "pnpm -C packages/crisp-contracts ciphernode:add",
"ciphernode:mint:tokens": "pnpm -C packages/crisp-contracts ciphernode:mint:tokens",
"ciphernode:add:self": "pnpm -C packages/crisp-contracts ciphernode:add:self",
Expand Down
17 changes: 15 additions & 2 deletions examples/CRISP/packages/crisp-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
This directory contains the Solidity contracts for CRISP - Coercion-Resistant Impartial Selection
Protocol.

Contracts are built and tested with [forge], which is part of the [Foundry] toolkit. Tests are
defined in the `tests` directory in the root of this template.
Contracts are built and tested with [Hardhat](https://hardhat.org). Tests are defined in the `test` directory.

## Running Tests

To run contract tests from the CRISP example root (`examples/CRISP/`):

```bash
pnpm test:contracts
```

Alternatively, you can run tests directly from this directory:

```bash
pnpm test
```

## CRISP Program

Expand Down
7 changes: 0 additions & 7 deletions examples/CRISP/scripts/build.sh

This file was deleted.

4 changes: 2 additions & 2 deletions examples/CRISP/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ echo "sdk"
(cd packages/crisp-sdk && pnpm install && pnpm build)
echo "evm"
(cd ../../packages/enclave-contracts && pnpm compile)
(cd packages/crisp-contracts && pnpm compile)
echo "server"
(cd ./server && [[ ! -f .env ]] && cp .env.example .env; cargo build --locked --bin cli && cargo build --locked --bin server)
echo "client"
Expand All @@ -21,5 +22,4 @@ if [[ ! -f ~/.cargo/bin/enclave ]]; then
(cd ../../ && cargo build --locked -p e3-cli && cargo install --locked --path crates/cli)
else
echo "enclave CLI already installed, skipping build"
fi
echo "Skipping circuit compilation - using pre-compiled circuits"
fi
Loading