Chaincode 事件在 hyperledger fabric 中被窃听

Chaincode events are bugged in hyperledger fabric

目前 hyperledger 中的链码事件只会引发 n 次重复事件,其中 n 是块中链码事件的数量,引发的事件是块中的第一个事件。

  const profileRegId = this.event_hub.registerChaincodeEvent(request.chaincodeId, "Profile Added", event => {
    this.event_hub.unregisterChaincodeEvent(profileRegId);
    em.emit(event.payload);
  });

以上是我们如何在节点应用程序中调用 registerChaincodeEvent 函数。

createEvent(APIstub, "Profile Added", profile)

以上是我们在链码中的实现方式。

有没有办法自己将其作为 hyperledger 的错误提出来?

打开新错误或向 Hyperledger Fabric 提交问题的过程相当简单,您需要注册您的 linux 基金会 ID(read here the details) and login into https://jira.hyperledger.org/,完成后您可以打开问题。

虽然根据您的描述,这并不是 clear/obvious 确实存在问题,但如果您有 n 个有效交易,每个交易都会创建一个事件,不确定何时预计只有一个通知。另请注意,自 Fabric v1.1.0 发布以来,有一个新的事件传递服务:FAB-7069 and here some docs 关于它。

但是,如果您仍然认为存在错误或可能的改进,请提交 JIRA