Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.
/ testnet-demo Public archive

An example to perform an atomic swap between BTC and ETH on testnet/ropsten

License

Notifications You must be signed in to change notification settings

comit-network/testnet-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testnet Demo

Intro

Synced testnet nodes are a requirement for running the COMIT Node Daemon (cnd) against testnet. In order to make your life easier we provide fully synced testnet nodes for your cnd here:

Note that our testnet nodes might not always be running, but are just started before workshops/events. If you have any questions please contact us through the COMIT community chat on gitter.

This guide assumes that you run both the taker and the maker on the same machine (for the example’s sake). In a more real world scenario maker and taker would of course be separate people on separate machines.

Setup

Run cnd taker

Create a config file for the taker in taker/config.toml with the following content:

Create a seed file for the taker in taker/seed.pem:

We assume that cnd is in your path. For how to do so have a look at: https://github.com/comit-network/comit-rs/readme.md

Startup command:

cnd --config config.toml

Run cnd maker

Create a config file for the maker in maker/config.toml with the following content:

Create a seed file for the maker in maker/seed.pem:

We assume that cnd is in your path. For how to do so have a look at: https://github.com/comit-network/comit-rs/readme.md Startup command:

cnd --config config.toml

Key/account generation and funding for both wallets

Keep in mind when running both maker and taker on the same machine you have to create a Bitcoin and Ethereum account for both maker and taker, thus you have to create and fund two Bitcoin and two Ethereum accounts.

Bitcoin

  1. Generate HD key (master-key) with [Wagyu](https://github.com/ArgusHQ/wagyu):
    wagyu bitcoin hd --network testnet --derivation "m"

  2. Copy the Extended Private Key generated by Wagyu into the env file for maker and taker.

  3. Once the maker (or taker) is started, it will print you some addresses which you will need to fund using an online faucet e.g. https://testnet-faucet.mempool.co/

Ethereum

  1. Generate an Ethereum account with [Wagyu](https://github.com/ArgusHQ/wagyu)
    wagyu ethereum hd

  2. Copy the Private Key (NOT the extended private key) to the env file for maker and taker.

  3. Fund the account through an Ethereum ropsten coin faucet

Run the example

  1. Both maker and taker cnd are running,

  2. env files were properly initialized with the bitcoin HD keys and Ethereum private keys

  3. Bitcoin addresses and Ethereum accounts were properly funded.

  4. Start the maker:
    yarn run maker

  5. Start the taker:

  6. The wallets will sync at the beginning which takes a while depending on your internet connection and computer. The swap should happen completely automated (note: this may take a while given testnets are not reliable).

About

An example to perform an atomic swap between BTC and ETH on testnet/ropsten

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published