Git Product home page Git Product logo

substrate-dex's Introduction

Dex demo build by substrate

This is a decentralized exchange (DEX) build by substrate.

WARNING This project is just for demo/poc/self-learning. The author does not guarantee any availability or stability. And we DO NOT suggest use it in any production environment.

Any questions, feel free to post an issue.

Please refer to the wiki for the detail information. (Continuously updated)

Build

Install Rust:

curl https://sh.rustup.rs -sSf | sh

Install required tools:

./scripts/init.sh

Build Wasm and native code:

cargo build

Run

Single node development chain

You can start a development chain with:

cargo run -- --dev

Detailed logs may be shown by running the node with the following environment variables set: RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev.

Play with the dex

Please refer the client/transactions-api to see how to play with the dex chain. You can:

  • issue the token
  • transfer the token
  • create the trade pair
  • create the limit order
  • cancel the limit order

Also, you can play with it by polkadotjs wallet frontend with:

git clone https://github.com/polkadot-js/apps
cd apps
yarn
yarn start

Then open the link http://localhost:3000/#/?rpc=ws://127.0.0.1:9944

How to test

Test all the test cases by:

cargo test -p substrate-dex-runtime -- --test-threads=1 --nocapture

Or you can just run one of the test cases by:

cargo test [TEST_CASE_NAME] -p substrate-dex-runtime -- --test-threads=1 --nocapture

About next step

  • Will provide a full-feature dex front-end build with polkadotjs
  • Will upgrade to substrate 2.0 whenever it released

substrate-dex's People

Contributors

alexxuyang avatar holaaworld avatar tripleight avatar btspoony avatar phpmaple avatar

Stargazers

Meharab avatar tzxyz avatar  avatar  avatar  avatar  avatar Cong Tu Le avatar  avatar Lester Wang avatar FengFeng avatar ben2077 avatar David barinas avatar Vasiliy Yorkin avatar Ned Aron avatar  avatar Ludicolo avatar DeGatchi avatar Buns Enchantress avatar RideWindX avatar  avatar  avatar xxb avatar  avatar HAOYUatHZ avatar Lucid avatar Caos avatar  avatar  avatar Cloud avatar Vitaliy Yermolenko avatar Danny avatar NA SA avatar Clayon avatar foxgem avatar  avatar Matej yangwao avatar Deli Gong avatar Dhruvin GBC avatar fisher avatar  avatar Chester Lee avatar skyh24 avatar  avatar Jason Chen avatar antain avatar JZ avatar Edwin avatar 0xihucuyu avatar duanjian avatar Jet Li avatar Wei Zhong avatar

Watchers

James Cloos avatar Gavin Zheng avatar inrust avatar  avatar NA SA avatar  avatar  avatar Dhruvin GBC avatar Gokul Alex avatar

substrate-dex's Issues

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.