COMIT is an open protocol facilitating cross-blockchain applications. With COMIT you can for examples exchange Bitcoin for any Erc20 token directly with another person.
This repository contains everything needed to do an atomic swap (locally) on your machine.
If you wish to do an atomic swap on your machine or to integrate COMIT into an application (e.g. a DEX) please take a look at the Getting Started section of the COMIT documentation. If you have any questions, feel free to reach out to the team in our Gitter chat!
create-comit-app
enables you to setup a local development environment for running and developing Javascript apps on top of COMIT.
create-comit-app
comes with demos and examples to demonstrate how to use the comit-js-sdk.
If you already have Docker, npm and yarn installed you are ready to run a demo-swap on your machine:
For more details please check the Detailed Guidelines and the Getting Started section of the COMIT documentation. If you have any question feel free to reach out to us on Gitter!
Install docker through your package manager. Make sure the unix-socket of the docker daemon is accessible.
Windows users have the choice between Docker Toolbox (the "old" docker) and Docker for Windows (the "new" docker). Docker for Windows requires Windows 10 Pro, whereas Docker Toolbox also works on older versions of Windows and Windows 10 Home.
Install Docker Toolbox and start the virtual machine.
Double check that the environment variables DOCKER_HOST
, DOCKER_CERT_PATH
and DOCKER_TLS_VERIFY
have been set.
To use create-comit-app with Docker for Windows please follow these steps:
- Set the
DOCKER_HOST
variable to the docker daemon endpoint. You can find that in the docker control panel, should be something liketcp://127.0.0.1:2375
. - Disable the TLS verification of the docker daemon endpoint: In your docker control panel: Settings > General > Expose daemon on tcp... without TLS
Install them either from the website or through your package manager.
create-comit-app
contains demos and examples.
Demos demonstrate how a swap works in a very simple manner, whereas examples go more into details and add maker, taker and negotiation.
Here is how you set up a project and run demos and examples:
yarn create comit-app <your-app-name>
,cd <your-app-name>
,yarn install
andyarn start-env
to start blockchain and COMIT nodes,- Run the btc-eth demo
- Navigate to the separate-apps demo directory
cd ./demos/btc_eth
, yarn install
to install dependencies,yarn swap
to execute the swap,
- Navigate to the separate-apps demo directory
- Run the btc-eth example (in separate terminals for the taker and maker):
- Navigate to the separate-apps example app directory
cd ./examples/btc_eth
, yarn install
to install dependencies,yarn run maker
to run the maker app,yarn run taker
to run the taker app,- Follow the steps be hitting
Return
to complete the swap.
- Navigate to the separate-apps example app directory
Important: You don't have to follow this section, the above section is actually sufficient.
create-comit-app
is a rust project separated in two modules:
- create: Contains the logic for setting up a new
comit-app
project through yarn. - scripts: Contains the logic of starting a local dev-environment.
- Starts up parity Ethereum node
- Start up bitcoind Bitcoin node
- Starts up two cnd nodes.
To build the project yourself:
- Install Docker,
- Install Rust:
curl https://sh.rustup.rs -sSf | sh
, - Checkout the repo:
git clone https://github.com/comit-network/create-comit-app/; cd create-comit-app
, - Build and install:
make install
.