GithubHelp home page GithubHelp logo

shelbyn1125 / comit-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from comit-network/comit-rs

0.0 0.0 0.0 11.4 MB

Reference implementation of COMIT, an open protocol facilitating trustless cross-blockchain applications.

License: GNU General Public License v3.0

Rust 77.99% Shell 1.11% TypeScript 20.78% Dockerfile 0.13%

comit-rs's Introduction

COMIT-rs

CircleCI Safety Dance Bors enabled

COMIT is an open protocol facilitating trustless cross-blockchain applications. This is a reference implementation for the COMIT protocol.

DISCLAIMER: This is not mainnet ready!

  • Extensive testing on mainnet from our side still remains to be done
  • Several features for achieving production-ready robustness are still under works
  • Once we consider comit-rs production ready, we will release version 1.0.0

Structure

This repository is a cargo workspace:

  • Crates at the top level are where the main work happens. Consult the respective Cargo.toml for a description of what they do.
  • Crates inside the internal folder are considered to be private to this repository. They are used for sharing code between other crates in this repository. There is an ongoing effort to get rid of these crates because path dependencies block us from releasing any of the other crates to crates.io.
  • libp2p-comit: implementation of the comit messaging protocol on top of libp2p

Setup build environment

All you need is love rust: curl https://sh.rustup.rs -sSf | sh

Build & Run

  1. cargo install --path .
  2. startup bitcoin node with -regtest and -rest
  3. startup ethereum node with JSON-RPC interface exposed at localhost:8545
  4. startup cnd: cnd (or ./target/release/cnd if you do not have the ~/.cargo/bin folder in your $PATH)

If the [web_gui] section is specified in the configuration file the current release of the user interface comit-i will be served once cnd is started up (served at localhost:8080 by default).

Keep in mind that in order to do a swap locally you will need to start two instances of cnd.

Setup testing/dev environment

  1. Install docker & docker-compose
  2. Install node (check the version required in api_tests/package.json) & yarn
  3. Install Rust nightly-2019-07-31: rustup install nightly-2019-07-31 (this one is only used for rustfmt)
  4. Install rustfmt for nightly-2019-07-31: rustup component add rustfmt --toolchain nightly-2019-07-31
  5. Install cargo-make: cargo install cargo-make
  6. Run cargo make in the root folder of the repository, this will install various crates & tools such as clippy

Testing

  • cargo make runs the whole test suite including integration tests but not end-to-end.
  • cargo make all also runs the whole test suite, including end-to-end tests.
  • cargo make format to format Rust code
  • cargo make ts-fix to format Typescript code
  • cargo make dry to run cnd dry tests
  • cargo make api to run all API tests
  • cargo make e2e to run cnd end-to-end tests
  • cargo make e2e *btc* to run cnd end-to-end tests with btc in the folder name (supports shell glob on the name)

Alternatively, you can run the end-to-end tests and TypeScript related actions using yarn (careful! It does not recompile Rust for you):

  • yarn run test: run all tests
  • yarn run test <directory>: run all tests in the directory
  • yarn run test <path to test file>: run all tests in this test file, supports shell glob on the path
  • yarn run fix: run prettier and linter to fix format
  • yarn run check: run tsc (to check validity of TypeScript code) and verify format

Contributing

Contributions are welcome, please visit CONTRIBUTING for more details.

License

This project is licensed under the terms of the GNU GENERAL PUBLIC LICENSE v3.

comit-rs's People

Contributors

thomaseizinger avatar bonomat avatar llfourn avatar mergify[bot] avatar d4nte avatar luckysori avatar da-kami avatar dependabot-preview[bot] avatar bors[bot] avatar dependabot-support avatar tcharding avatar elpiel avatar cristianrgreco avatar korrat avatar dependabot[bot] avatar rex4539 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.