Giter Site home page Giter Site logo

assetrouter's Introduction

AssetRouter

环境依赖:

.net core 3.1
.net standard 2.0 https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral

配置文件:

Asset.xml 配置资产名与合约哈希

SwapPair.xml 配置合约路径, 每一个Pair表示单向。如需双向, 需要配置两个pair 例:nNEO与pnUSDT可以互换 nNEO pnUSDT pnUSDT nNEO

Api服务启动

windows环境下:

  1. 运行WebApiService.exe, 默认5000端口, 请确保不被占用
  2. 检查配置文件是否存在(Asset.xml, SwapPair.xml, Contract.xml)
  3. 通过本地浏览器访问 http://localhost:5000/swagger/index.html
  4. 点击需要调试的Api(当前仅有AssetQuery), 点击(try it out), 输入参数(StartAsset, EndAsset, amount), 点击Execute
  5. 根据生成的request, response进行调试

使用用例

StartAsset: FLM EndAsset: pnUSDT amount: 1500000

Request URL: http://localhost:5000/AssetQuery?StartAsset=FLM&EndAsset=pnUSDT&amount=1500000 Response body: [{"swapPath":["FLM","nNEO","pnUSDT"],"amount":[1500000,21126,5180]},{"swapPath":["FLM","nNEO","pnWBTC","pnUSDT"],"amount":[1500000,21126,13,4933]}]

向启动的服务发送Request URL后, 会收到相应的Response body 一条swapPath表示路由上所有经过的资产, amount顺序对应所有可以swap出的数量

备注: 目前支持的资产已在配置文件中配置完毕, 包括 (nNEO, pnUSDT, pnWBTC, pnUSDT, FLM, pONT SWTH)

服务状态检查

检查路由: /api/HealthCheck

返回状态值204, 内容为空

assetrouter's People

Contributors

lichen9618 avatar

Stargazers

 avatar

Watchers

 avatar  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.