Git Product home page Git Product logo

cap's Introduction

Configurable Asset Privacy (CAP) protocol -- a library in the Jellyfish ecosystem

Development environment setup

Install RUST

We recommend to use nix for installing the correct version of rust and additional libraries:

> curl -L https://nixos.org/nix/install | sh
> . ~/.nix-profile/etc/profile.d/nix.sh

Compiling the project for the first time

> nix-shell
> cargo build

Git Hooks

We use cargo-husky to automatically load any scripts under .cargo-husky/hooks into .git/hooks.

Changes made to any .cargo-husky/hooks will be automatically synced to .git/ every time you run cargo test -- no special extra command to run.

Tests

> cargo test --release

Note that by default the release mode does not check integers overflow. In order to enforce this check run:

> ./scripts/run_tests.sh

Test coverage

We use grcov for test coverage

> ./scripts/test_coverage.sh

Generate and read the documentation

Standard

> cargo doc --open

Code formatting

To format your code run

> cargo fmt

Updating non-cargo dependencies

To use the updates enter a new nix-shell.

Testing the nix-shell dev environment on other platforms

Refer to the nix/vagrant directory.

Benchmarks

Transactions generation/verification

Running the benchmarks produces a csv file containing the information about the note being benched (type, number of inputs/outputs, number of constraints, size in KB etc...) as well as the running time.

Benchmarks can be run

>./scripts/run_benchmarks.sh --help
CAP benchmarks
Usage: ./scripts/run_benchmarks.sh [--(no-)asm] [--(no-)multi_threads] [-h|--help]
	-h, --help: Prints help

# By default no asm and no multicore
> ./scripts/run_benchmarks.sh                         
Multi-threads: OFF
Asm feature: OFF
...

# Activate asm and multicore
> ./scripts/run_benchmarks.sh --asm --multi_threads 
Multi-threads: ON
Asm feature: ON

The csv files can be found at /tmp/{note_description}_cap_benchmark.csv, e.g. /tmp/transfer_note_cap_benchmark.csv.

The criterion report can be found at target/criterion/report/index.html.

cap's People

Contributors

zhenfeizhang avatar alxiong avatar ancient123 avatar dependabot[bot] avatar chancharles92 avatar jbearer avatar clu8 avatar fkrell avatar sveitser avatar victorkoenders avatar bfish713 avatar tri-joe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.