Git Product home page Git Product logo

exchange_api_demo's Introduction

使用步骤

  1. 开启私链
geth --networkid 10 --rpc --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3" rpcaddr "0.0.0.0" --rpccorsdomain "*" --nodiscover --dev console
  1. 安装依赖包
 npm i
  1. 配置数据库信息

路径在/src/config下

  1. 启动
npm start

接口文档

  1. 用户登录
    path: /user/login
    method: post
    body: {
        tel,
        password
    }
    result: {
        errcode:0,
        data:{
            token:343aerwew2423423
        }
    }
  1. 用户注册
    path: /user/register
    method: post
    body: {
        tel,
        email,
        password
    }
    result: {
        errcode:0,
        data:{
            insertId:3
        }
    }
  1. 用户ETHER余额
    path: /user/balance
    method: get
    result: {
        errcode:0,
        data:{
            
        }
    }
  1. 用户代币清单
    path: /token/alltoken
    method: get
    result: {
        errcode:0,
        data:{
            ...
        }
    }
  1. 用户购买ether
    path: /token/buycoin
    method: post
    body:{count:个数}
    result: {
        errcode:0,
        data:{
            receipt
        }
    }

exchange_api_demo's People

Contributors

jwlazy avatar

Watchers

James Cloos avatar

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.