Git Product home page Git Product logo

axon-contract's Introduction

AXON development contracts

Clone the repo and submodules. Because the submodules we used contains submodules too, we should add --recursive parameter.

git submodule update --init --recursive

Build blst archive (only contract checkpoint needs it now, so you can skip this step if checkpoint is not needed)

The docker version has some problem, so we have to execute the following beforehand to update no_asm.h & vect.h mannually.

cd common/blst/ckb-lib-secp256k1-blst/deps/blst
git apply ../../blst/blst.patch

After runing the above command, you should see changes in no_asm.h & vect.h.

Then, We can build lib blst:

cd common/blst/ckb-lib-secp256k1-blst
make all-via-docker

Prepare work to run Eth sig releated contracts (stake at, delegate at, withdraw at) :

cd common/c/secp256k1_extra
cp secp256k1_data_info.h ../deps/ckb-production-scripts/build/
cp libsecp256k1-config.h ecmult_static_context.h ecmult_static_pre_context.h ../deps/ckb-production-scripts/deps/secp256k1/src

Meanwhile, to avoid duplicate symbol error, we must remove line 175 to 472 in common/c/deps/ckb-production-scripts/c/blake2b.h.

Build CKB contracts:
You can use capsule build to build all contracts at once. or build sepecific contract using following commands.

capsule build -n selection
capsule build -n checkpoint
...

run tests: You can run cargo test to run all tests. Also, you can run test for specific contract using following commands.

cd tests
cargo test test_selection_success -- --nocapture
cargo test test_checkpoint_success -- --nocapture
...

axon-contract's People

Contributors

ashuralyk avatar felicityin avatar hongda3141 avatar kaoimin avatar wenyuanhust avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.