如何查询Hyperledger Fabric交易的详细信息

时间:2019-03-21 20:46:18

标签: hyperledger-fabric hyperledger hyperledger-composer hyperledger-explorer

如果您在作曲家游乐场中部署网络,则可以访问“所有交易”

enter image description here

我认为与实现

相同

“ SELECT org.hyperledger.composer.system.HistorianRecord”

但是在操场上有一个“查看记录”按钮

提供交易详细信息:

{
 "$class": "org.ACME.OwnershipChange",
 "PreviousOwner": "WHF_123",
 "NewOwner": "HFS_456",
 "debtID": "123123126",
 "transactionId": "4e04116f-5788-48ac-9930-e0bf3beb74e3",
 "timestamp": "2019-03-20T19:53:42.796Z"
}

当尝试通过Composer REST实现Historian Record查询时,我获得了Record的所有详细信息,但没有获得交易的详细信息,如上述“查看记录”

{
    "$class": "org.hyperledger.composer.system.HistorianRecord",
    "transactionId": "2c80fd8b89cef32fb9dff6864d76b9fecd2194cd447266161fc9d1fb1a32aed9",
    "transactionType": "org.ACME.OwnershipChange",
    "transactionInvoked": "resource:org.ACME.OwnershipChange#2c80fd8b89cef32fb9dff6864d76b9fecd2194cd447266161fc9d1fb1a32aed9",
    "participantInvoking": "resource:org.hyperledger.composer.system.NetworkAdmin#admin",
    "identityUsed": "resource:org.hyperledger.composer.system.Identity#d258882fc3c452601433a729958ba3c592bd31e95fc43fbf493f5be3dc566dd1",
    "eventsEmitted": [],
    "transactionTimestamp": "2019-03-21T20:05:49.504Z"
  },

如何查询视图记录详细信息?

1 个答案:

答案 0 :(得分:0)

在此线程中找到了解决方案。

代替查询SELECT org.hyperledger.composer.system.HistorianRecord 尝试查询SELECT org.ACME.OwnershipChange

How to show transaction input data in a Hyperledger Composer query