ping_tx - 连通测试
使用ping_tx
指令测试blockchain.info的websocket服务的连通性,附带反馈最新交易数据。
请求
{
"op":"ping_tx"
}
响应
如果服务正常,将返回utx指令:
{
"op":"utx"
....
}
示例代码
通过websocket连接发送ping_tx指令:
{
"op":"ping_tx"
}
响应结果如下:
{
"op" : "utx",
"x" : {
"lock_time" : 0,
"ver" : 1,
"size" : 256,
"inputs" : [ {
"sequence" : 4294967295,
"prev_out" : {
"spent" : true,
"tx_index" : 445123473,
"type" : 0,
"addr" : "1HckjUpRGcrrRAtFaaCAUaGjsPx9oYmLaZ",
"value" : 710733,
"n" : 0,
"script" : "76a914b64513c1f1b889a556463243cca9c26ee626b9a088ac"
},
"script" : "47304402204c2ccb73d82d70b99d2acc0d8e097126e4055712a0df79cf45cf2ac02a569b79022064fd7af77aa5d6cd2ad4da0c3ed96d2a6306b48d894d988efcd97ddccc015d220121030651e1d15ae9a284ffd712885529d3344db3700be756e6c22c56a6c1b57d359d"
} ],
"time" : 1557717225,
"tx_index" : 446714790,
"vin_sz" : 1,
"hash" : "b0ff4863e6182bbeb8e9240a909f5814187c87bb18a30022f05e4249e8ed09d5",
"vout_sz" : 3,
"relayed_by" : "0.0.0.0",
"out" : [ {
"spent" : false,
"tx_index" : 446714790,
"type" : 0,
"addr" : "1HckjUpRGcrrRAtFaaCAUaGjsPx9oYmLaZ",
"value" : 693987,
"n" : 0,
"script" : "76a914b64513c1f1b889a556463243cca9c26ee626b9a088ac"
}, {
"spent" : false,
"tx_index" : 446714790,
"type" : 0,
"addr" : "1N6eMsUbYPgSwYsEosSeRCrr9rvfjtCtKU",
"value" : 546,
"n" : 1,
"script" : "76a914e76be85e177a3b85c2072d73f29a8824847925c288ac"
}, {
"spent" : false,
"tx_index" : 446714790,
"type" : 0,
"addr" : null,
"value" : 0,
"n" : 2,
"script" : "6a146f6d6e69000000000000001f00000017676cc770"
} ]
}
}