mirror of
https://github.com/vacp2p/zerokit.git
synced 2025-02-16 16:37:03 +00:00
Update documentation for building and testing (#120)
* chore: fix Makefile pre-build * chore: add Makefile command to install depenedncy cargo-make * chore: update all READMEs with instructions to install dependencies, build and test * chore: add target to fetch all submodules
This commit is contained in:
parent
48fa1b9b3d
commit
62018b4eba
17
Makefile
17
Makefile
@ -1,13 +1,20 @@
|
|||||||
.PHONY: all test clean
|
.PHONY: all installdeps build test clean
|
||||||
|
|
||||||
all: .pre-build
|
all: .pre-build build
|
||||||
@cargo make build
|
|
||||||
|
|
||||||
.pre-build:
|
.fetch-submodules:
|
||||||
ifndef $(cargo make --help)
|
@git submodule update --init --recursive
|
||||||
|
|
||||||
|
.pre-build: .fetch-submodules
|
||||||
|
ifeq (, $(shell which cargo-make))
|
||||||
@cargo install --force cargo-make
|
@cargo install --force cargo-make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
installdeps: .pre-build
|
||||||
|
|
||||||
|
build: .pre-build
|
||||||
|
@cargo make build
|
||||||
|
|
||||||
test: .pre-build
|
test: .pre-build
|
||||||
@cargo make test
|
@cargo make test
|
||||||
|
|
||||||
|
12
README.md
12
README.md
@ -17,3 +17,15 @@ in Rust.
|
|||||||
- [RLN library](https://github.com/kilic/rln) written in Rust based on Bellman.
|
- [RLN library](https://github.com/kilic/rln) written in Rust based on Bellman.
|
||||||
|
|
||||||
- [semaphore-rs](https://github.com/worldcoin/semaphore-rs) written in Rust based on ark-circom.
|
- [semaphore-rs](https://github.com/worldcoin/semaphore-rs) written in Rust based on ark-circom.
|
||||||
|
|
||||||
|
## Build and Test
|
||||||
|
|
||||||
|
To install missing dependencies, run the following commands from the root folder
|
||||||
|
```bash
|
||||||
|
make installdeps
|
||||||
|
```
|
||||||
|
To build and test all crates, run the following commands from the root folder
|
||||||
|
```bash
|
||||||
|
make build
|
||||||
|
make test
|
||||||
|
```
|
||||||
|
@ -3,7 +3,15 @@
|
|||||||
Example wrapper around a basic Circom circuit to test Circom 2 integration
|
Example wrapper around a basic Circom circuit to test Circom 2 integration
|
||||||
through ark-circom and FFI.
|
through ark-circom and FFI.
|
||||||
|
|
||||||
# FFI
|
## Build and Test
|
||||||
|
|
||||||
|
To build and test, run the following commands within the module folder
|
||||||
|
```bash
|
||||||
|
cargo make build
|
||||||
|
cargo make test
|
||||||
|
```
|
||||||
|
|
||||||
|
## FFI
|
||||||
|
|
||||||
To generate C or Nim bindings from Rust FFI, use `cbindgen` or `nbindgen`:
|
To generate C or Nim bindings from Rust FFI, use `cbindgen` or `nbindgen`:
|
||||||
|
|
||||||
|
@ -2,3 +2,10 @@
|
|||||||
|
|
||||||
This module is to provide APIs to manage, compute and verify [Private Settlement](https://rfc.vac.dev/spec/44/) zkSNARK proofs and primitives.
|
This module is to provide APIs to manage, compute and verify [Private Settlement](https://rfc.vac.dev/spec/44/) zkSNARK proofs and primitives.
|
||||||
|
|
||||||
|
## Build and Test
|
||||||
|
|
||||||
|
To build and test, run the following commands within the module folder
|
||||||
|
```bash
|
||||||
|
cargo make build
|
||||||
|
cargo make test
|
||||||
|
```
|
||||||
|
@ -10,6 +10,12 @@ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|||||||
```
|
```
|
||||||
cargo install cargo-make
|
cargo install cargo-make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
```
|
||||||
|
make installdeps
|
||||||
|
```
|
||||||
3. Compile zerokit for `wasm32-unknown-unknown`:
|
3. Compile zerokit for `wasm32-unknown-unknown`:
|
||||||
```
|
```
|
||||||
cd rln-wasm
|
cd rln-wasm
|
||||||
|
@ -3,15 +3,21 @@
|
|||||||
This module provides APIs to manage, compute and verify [RLN](https://rfc.vac.dev/spec/32/) zkSNARK proofs and RLN primitives.
|
This module provides APIs to manage, compute and verify [RLN](https://rfc.vac.dev/spec/32/) zkSNARK proofs and RLN primitives.
|
||||||
|
|
||||||
## Pre-requisites
|
## Pre-requisites
|
||||||
### Install
|
### Install dependencies and clone repo
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
make installdeps
|
||||||
git clone https://github.com/vacp2p/zerokit.git
|
git clone https://github.com/vacp2p/zerokit.git
|
||||||
cd zerokit/rln
|
cd zerokit/rln
|
||||||
```
|
```
|
||||||
Implemented tests can be executed by running within the module folder
|
|
||||||
|
|
||||||
`cargo test --release`
|
### Build and Test
|
||||||
|
|
||||||
|
To build and test, run the following commands within the module folder
|
||||||
|
```bash
|
||||||
|
cargo make build
|
||||||
|
cargo make test
|
||||||
|
```
|
||||||
|
|
||||||
### Compile ZK circuits
|
### Compile ZK circuits
|
||||||
|
|
||||||
|
@ -8,3 +8,11 @@ Goal is also to provide a basic FFI around protocol.rs, which is currently not
|
|||||||
in scope for that project.
|
in scope for that project.
|
||||||
|
|
||||||
See that project for more information.
|
See that project for more information.
|
||||||
|
|
||||||
|
## Build and Test
|
||||||
|
|
||||||
|
To build and test, run the following commands within the module folder
|
||||||
|
```bash
|
||||||
|
cargo make build
|
||||||
|
cargo make test
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user