Code Monkey home page Code Monkey logo

dex's Introduction

DEX

DEX is a decentralized exchange implementation that focuses on low-latency and high-throughput.

  • Block time: 1s on normal load, ~2.7s on high load [1]
  • Near instant finality: a transaction is finalized after three block confirmations under normal operation [2]
  • Transaction per second: ~2500 [1]

DEX implements the Dfinity consensus protocol described in their paper. And it implements native on-chain matching engine.

Features

  • Trading tokens
  • Issue new tokens
  • Sending, receiving, freezing and burning tokens

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.

Running Prebuilt Binaries

  1. Install Barreto-Naehrig curves

    1. Install the prebuilt libraries in their readme page into /usr/lib.

    2. Install the dependency libgmp apt get install libgmp-dev.

  2. Download and run the prebuilt binaries (built on Ubuntu 16.04) from the release page.

Build

Build with Docker

$ 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/

Build from Source

  • 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/
    

License

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.

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.