MOV测试网教程(Windows)

比原链Bytom版主发布在 BTM/比原链
 28457  17
MOV交易逻辑测试网开放啦!
比原链团队于今日公布MOV协议下部分交易逻辑源码,开放测试通道以供开发者进行测试。
MOV是基于Bystack主侧链架构的去中心化跨链价值交换协议,磁力合约作为MOV协议下的价值交换引擎,通过vapor侧链链底层响应全链用户的交易请求,从而在保证高TPS的同时实现多资产并发撮合,极大扩展交易深度和撮合效率,实现转账即交易。
此次公开测试的模块主要包括MOV协议下的核心交易逻辑。我们将开放交易功能相关的部分API,开发者可以通过调用API向vapor提交交易请求,所有来自用户的交易将通过磁力合约进行链上撮合。
为了能让广大用户更加便捷地体验测试网的基本交易功能,我们定制开发了适应于全平台CLI环境下的客户端。

此次开放的API接口文档如下:
"init"
"list-addresses"
"cancel-order <orderID>"
"faucet <asset> <address>"
"list-assets"
"list-user-orders <fromAsset> <toAsset> <orderTypes>"
"market-depth <fromAsset> <toAsset>"
"market-price <fromAsset> <toAsset>"
"market-volume <fromAsset> <toAsset>"
"payment <address> <amount>"
"place-order <fromAsset> <toAsset> <price> <amount>"   
本次测试网将通过水龙头向各位用户投放BTC、BTM、ETH、USDT四种测试资产,测试资产的资产ID如下: 
BTC id:d50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d492 
BTM id:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ETH id:a0889e1080999e59ed552865a1d3ee677202796222141ccc3552041708aad76c
USDT id:4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703
详情请添加客服微信咨询:  Bytom666
以下为推荐测试流程:

另附CLI格式下API响应结果以供参考:

step1:下载安装bycoincli客户端
下载地址:https://url.cn/5deYup7

step2:生成地址
键入:\bycoincli.exe init
返回:time="XXX" level=info msg="init bycoin account successfully."

step3:查看地址
键入:\bycoincli.exe list-addresses
返回:
[
{
"guid": "4e320c5d-f41d-4a49-9fcb-3e8de8c60369",
"address": "tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq", #您创建的地址
"label": "",
"balances": []
}
]
time="XXX" level=info msg="list-addresses successfully."

step4:水龙头领资产
键入:\bycoincli.exe faucet usdt tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq #向您的地址领取usdt
返回:
time="XXX" level=info msg="Get test coins successfully." address=tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq asset=usdt module=commands txID=3b4c41395d14dc7f73e632ded7e7e6c172baf7cf58f1909a44e29166f74fb012
键入:\bycoincli.exe faucet btc tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq #向您的地址领取btc
返回:
time="XXX" level=info msg="Get test coins successfully." address=tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq asset=btc module=commands txID=e7f8d0c92b6277605012e1d1486cf1f33326224ee7e823e0ac7ab13ddbc3798b
键入:\bycoincli.exe faucet eth tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq #向您的地址领取eth
返回:
time="XXX" level=info msg="Get test coins successfully." address=tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq asset=eth module=commands txID=b6d4702062ff20ee4b1ac331f0b5bdc88f5b4b1b1ff01071e4a63f71a534e6f7
键入:\bycoincli.exe faucet btm tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq #向您的地址领取btm
返回:
time="XXX" level=info msg="Get test coins successfully." address=tp1q9q6tqjut25nd4lgk2u5298jm990h5udgs207cq asset=btm module=commands txID=497a7728772b88e97c456609bdbe18b81006c4fc9a48f3398ca208604846ded3

step5:查看资产
键入:\bycoincli.exe list-assets
返回:
{
"code": 200,
"msg": "",
"result": {
"data": [
{
"alias": "USDT", #资产名
"asset_id": "4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703", #资产id
"btc_price": 0,
"cny_price": 0,
"decimals": 8,
"description": "",
"icon": "",
"mov_privilege": 1,
"total_supply": "9223372036854775807",
"usd_price": 0
},
{
"alias": "ETH", #资产名
"asset_id": "a0889e1080999e59ed552865a1d3ee677202796222141ccc3552041708aad76c", #资产id
"btc_price": 0,
"cny_price": 0,
"decimals": 8,
"description": "",
"icon": "",
"mov_privilege": 1,
"total_supply": "9223372036854775807",
"usd_price": 0
},
{
"alias": "BTC", #资产名
"asset_id": "d50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d492", #资产id
"btc_price": 0,
"cny_price": 0,
"decimals": 8,
"description": "",
"icon": "",
"mov_privilege": 1,
"total_supply": "9223372136854775601",
"usd_price": 0
},
{
"alias": "BTM", #资产名
"asset_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", #资产id
"btc_price": 0.00001018,
"cny_price": 0.516765,
"decimals": 8,
"description": "Bytom Official Issue",
"icon": "",
"mov_privilege": 1,
"total_supply": "1349979999975",
"usd_price": 0.0733
}
]
}
}
time="XXX" level=info msg="list-assets successfully."

step6:挂单 (注意:挂单数量必须为整数,正式网将再做调整)
键入:\bycoincli.exe place-order btc usdt 7200 1 #用btc/usdt=7200的价格,发起购买一个btc的挂单
返回:
time="XXX" level=info msg="place-order successfully."

step7:查询挂单
键入:
\bycoincli.exe list-user-orders btc usdt current(or history) #查看您挂出的btc/usdt方向的订单,current为查询目前挂起的订单,history为查询已经成交的订单)
返回:
[
{
"order_id": 16, #订单号
"guid": "4e320c5d-f41d-4a49-9fcb-3e8de8c60369",
"from_asset": {
"asset_id": "d50a426bdaaf1458d161aba4d8c3ebdd095eac7e1bbeb4a0252a3737ccf2d492",
"alias": "BTC",
"description": "",
"decimals": 8,
"usd_price": 0,
"cny_price": 0,
"btc_price": 0,
"icon": ""
},
"to_asset": {
"asset_id": "4483893ef7d9aac788c0e9e49a12398c1d35a2172adb1c8dc551fd169a6f5703",
"alias": "USDT",
"description": "",
"decimals": 8,
"usd_price": 0,
"cny_price": 0,
"btc_price": 0,
"icon": ""
},
"open_price": 7200, #挂单价格
"deal_price": 0, #成交价格
"amount": 1, #挂单数量
"filled_amount": 0,
"status": "open",
"order_timestamp": 1574586136,
"update_timestamp": 1574586136
}
]
time="XXX" level=info msg="list-user-orders successfully."

step8:取消挂单
键入:\bycoincli.exe cancel-order 16 #取消该编号的挂单
返回:time="XXX" level=info msg="cancel order successfully ."

step9:查询交易对深度
键入:\bycoincli.exe market-depth btc usdt #查询btc/usdt方向的交易对深度
返回:
{
"code": 200,
"msg": "",
"result": {
"data": {
"orders": [
{
"amount": 1, #挂单交易量(示例仅显示深度为1,实际测试会返回该交易方向所有挂单)
"price": 7200 #挂单价格
}
],
"trade_pair": "btc-usdt"
}
}
}
time="XXX" level=info msg="market-depth successfully."

step10:查询交易对市价
键入:\bycoincli.exe market-price btc usdt #查询btc/usdt交易对市价
返回:
{
"code": 200,
"msg": "",
"result": {
"data": {
"high": "0.2500000000",#最高成交价
"low": "0.2500000000",#最低成交价
"start_time": 1574508193,
"trade_pair": "btc-usdt"
}
}
}
time="XXX" level=info msg="market-price successfully."

step11:查询交易对交易量
键入:\bycoincli.exe market-volume btc usdt #查询btc/usdt交易对交易量
返回:
{
"code": 200,
"msg": "",
"result": {
"data": {
"amount": "200",#交易量
"start_time": 1574499098,
"trade_pair": "btc-usdt"
}
}
}
time="XXX" level=info msg="market-volume successfully."


查看链上交易:

http://52.82.24.162:8081/mov 

  

  • 正序
  • 最新
只看帖主楼层直达
  • 1
  • 2
登录 账号发表你的看法,还没有账号?立即免费 注册