Decentralized Exchange
DEX is a decentralized exchange implementation that focuses on low-latency and high-throughput.
DEX implements the Dfinity consensus protocol described in their paper. And it implements native on-chain matching engine.
Please see here for how to run the nodes, use the wallet CLI, the detailed steps of reproducing the features, and how to pressure test the system.
You can find the White Paper in the wiki. It has system overview and the plan to solve the scalability problem.
Install Barreto-Naehrig curves
Install the prebuilt libraries in their readme page into /usr/lib
.
Install the dependency libgmp apt get install libgmp-dev
.
Download and run the prebuilt binaries (built on Ubuntu 16.04) from the release page.
$ docker pull helinwang/dex:build
$ git clone [email protected]:helinwang/dex.git
$ cd dex
$ docker run -v `pwd`:/root/env/gopath/src/github.com/helinwang/dex -it helinwang/dex:build bash
$ cd /root/env/gopath/src/github.com/helinwang/dex
$ glide install
$ go test ./pkg/...
$ go build ./cmd/node/
Install the latest version of Go
Install Barreto-Naehrig curves
Ubuntu or OSX can use the latest prebuilt libraries in the readme page.
Install the include files and built libraries into /usr/include
and /usr/lib
respectively (or anywhere else the Go build
toolchain can find).
Install dependencies apt install llvm g++ libgmp-dev libssl-dev
,
they are required by cgo when building the BLS Go wrapper.
Test the installation by:
$ go get github.com/dfinity/go-dfinity-crypto
$ cd $GOPATH/src/github.com/dfinity/go-dfinity-crypto/bls
$ go test
Install package manager Glide
Download source and build
$ go get github.com/helinwang/dex
$ cd $GOPATH/src/github.com/helinwang/dex
$ glide install
$ go test ./pkg/...
$ go build ./cmd/node/
GPLv3
[1] Benchmark performed by running multiple nodes on my local machine, steps here. Machine configuration: 16core, 32GB. Please note these are preliminary results, the system has a lot of room for optimization. The block time can be more stable with some improvements.
[2] Normal operation is a likely event that happens when there is only one notarized block produced in the round. For more detail please see the Dfinity Consensus Paper.