Giter Club home page Giter Club logo

chia_rs's Introduction

Build Test PyPI PyPI - Format GitHub Coverage Status

This cargo workspace contains code useful for working with the Chia network.

Tests

To run tests:

cargo test --all

Some slow tests are only enabled in optimized builds, so it may also be a good idea to run the tests in release mode:

cargo test --all --release

You may need a python virtual environment activated for the tests to link. This seems to be caused by the pyo3 dependency in the wheel.

Benchmarks

To run benchmarks for a specific crate:

cargo bench -- --save-baseline before
<make change>
cargo bench -- --save-baseline after
critcmp after before

You can also run all the benchmarks by including --workspace on the command line.

pre-commit

This repository has a pre-commit configuration, which is hooked into git by running:

pre-commit install --hook-type pre-commit --hook-type pre-push

It runs cargo fmt on all crates on every commit, and runs clippy and builds on push.

To run all checks explicitly (without pushing), run:

pre-commit run --all --hook-stage pre-push

python bindings

The wheel crate is a single python wheel that exports the functionality of all crates in the repository.

It's built with maturin. You need to have activated a python virtual environment for the build to work.

pip install maturin
cd wheel
maturin develop

Once built, the python tests can be run, from the root of the repository. Note that the tests require that chia-blockchain and blspy wheels are installed.

pytest tests

Fuzzers

Fuzzers can't be run or listed for the whole workspace, but only for individual crates. There is a tool to generate a fuzzing corpus from a blockchain database. It's run like this:

cd crates/chia-tools
cargo run --release --bin gen-corpus -- --help

The following crates have fuzzers:

  • chia-bls
  • chia-protocol
  • chia-wallet
  • clvm-utils
  • chia (the root crate)

To list and run fuzzers:

cargo fuzz list
cargo fuzz run <name-of-fuzzer>

chia_rs's People

Contributors

arvidn avatar rigidity avatar richardkiss avatar altendky avatar emlowe avatar cmmarslender avatar aminekhaldi avatar starttoaster avatar chiaautomation avatar chiaminejp avatar pmaslana avatar wallentx avatar nirajpathak13 avatar dependabot[bot] avatar xearl4 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.