Hyperledger fabric 如何访问';事件发出';hyperledger composer的ACL文件中的historian记录中的字段?
我正在使用Hyperledger Composer,我想访问历史记录中“eventsEmitted”数组中的“to”字段:Hyperledger fabric 如何访问';事件发出';hyperledger composer的ACL文件中的historian记录中的字段?,hyperledger-fabric,hyperledger,hyperledger-composer,Hyperledger Fabric,Hyperledger,Hyperledger Composer,我正在使用Hyperledger Composer,我想访问历史记录中“eventsEmitted”数组中的“to”字段: "eventsEmitted": [ { "$class": "org.poc.wallet.WalletTransferEvent", "from": "resource:org.poc.wallet.Wallet#wallet2", "to": "resource:org.poc.wallet.Wallet#wallet3", "am
"eventsEmitted": [
{
"$class": "org.poc.wallet.WalletTransferEvent",
"from": "resource:org.poc.wallet.Wallet#wallet2",
"to": "resource:org.poc.wallet.Wallet#wallet3",
"amount": 100,
"eventId": "7c180da643f418f4bfb40187ccecef7dddd2d3f4ff952ab16fd913bcccedeac2#0",
"timestamp": "2018-06-05T08:04:38.857Z"
}
]
我已在ACL文件中尝试过,但未触发规则:
rule CustomersSeeHistoryForWalletTransaction {
description: "Customers should be able to see the history of their own transactions only"
participant(p): "org.poc.wallet.Customer"
operation: READ
resource(r): "org.hyperledger.composer.system.HistorianRecord"
condition: (r.eventsEmitted[0].to.owner.getIdentifier() === p.getIdentifier())
action: ALLOW
}
请参见此处的答案->(基于使用交易网络中的事件)
示例网络)-以及此处描述的事件类->-
请注意,目前还存在一个为Composer查询创建的问题-即能够根据事件定义中的自定义事件查询Historian,并在Historian中的eventsEmitted
数组中具有自定义事件字段以进行搜索-请参阅