Question regarding Private Data Collection

时间:2019-01-07 13:41:14

标签: hyperledger-fabric hyperledger

I am currently working on hyper ledger fabric version 1.3 and using private data collections in one of my projects.

I have one scenario in which I need to find out the history of all txns done on a particular asset and not able to do that. We have the below chain code API available to get a history of a key which gets committed in world state :

stub.GetHistoryForKey(key)

Do we have something like this available for private assets also ?? I would really appreciate if someone could guide me for achieving this functionality.

Thanks!

2 个答案:

答案 0 :(得分:0)

我找到了这个History For Private Data In Hyperledger Fabric ,因此,我认为1.3中没有实现它。

答案 1 :(得分:0)

获取私有数据历史记录的API尚未实现,但计划在Hyperledger Fabric的未来版本中使用。

在此期间,您可以向同一事务中的公钥添加一些最少的信息以进行历史跟踪。那可以是逻辑密钥,或者如果密钥本身是敏感的,则可以对逻辑密钥进行哈希处理并将其另存为公共密钥。然后使用公用密钥上的GetHistoryForKey查找私有数据的事务。