COMIT is an open protocol facilitating trustless cross-blockchain applications. This is a reference implementation for the COMIT protocol.
WARNING - We do not recommend running COMIT on mainnet for now!!!
The repository contains three main folders:
cnd (the COMIT Node Daemon) and
btsieve hold code for the primary binaries that make up the reference implementation.
Code in these can depend on libraries located in
Contains crates that provide general functionality that is not specific to the domain of atomic swaps.
Crates defined in here MUST NOT depend on
They may be separated from the repository at some point (and possibly released on crates.io).
Setup build environment
curl https://sh.rustup.rs -sSf | sh
- Install libzmq:
apt install libzmq3-dev
- Mac (Homebrew)
brew install zeromq
- Install OpenSSL:
apt install libssl-dev pkg-config
Build & Run
- Put a (default) config file into
- startup bitcoin node (port to be set according to btsieve configuration)
- startup ethereum node (port to be set according to btsieve configuration)
- startup btsieve:
- startup cnd:
[web_gui] section is specified in the configuration the current release of the user interface comit-i will be served once cnd started up (served at
localhost:8080 as default).
In order to do a swap you will have to start two comit nodes (cnd & btsieve).
Setup testing/dev environment
node(check the version required in api_tests/package.json) &
- Install Rust
rustup install nightly-2019-07-31(this one is only used for
rustup component add rustfmt --toolchain nightly-2019-07-31
cargo install cargo-make
cargo makein the root folder of the repository, this will install various crates & tools such as clippy
cargo makeruns the whole test suite including integration tests but not end-to-end.
cargo make allalso runs the whole test suite, including end-to-end tests.
cargo make formatto format Rust code
cargo make ts-fixto format Typescript code
cargo make btsieveto run btsieve tests
cargo make dryto run cnd dry tests
cargo make apito run all API tests
cargo make e2eto run cnd end-to-end tests
cargo make e2e *btc*to run cnd end-to-end tests with
btcin 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
Contributions are welcome, please visit CONTRIBUTING for more details.
This project is licensed under the terms of the GNU GENERAL PUBLIC LICENSE v3.