【发布时间】:2018-10-21 20:59:51
【问题描述】:
我正在尝试通过 node-sdk API 在 Hyperledger 结构中使用自定义链码事件
registerChaincodeEvent(ccid, eventname, onEvent, onError)
我收到错误 Timeout-Failed to receive the chaincode 事件。不过
registerTxEvent(txid, onEvent, onError)
工作正常,但我需要听一些自定义链码事件。我正在附加链码函数,它发出事件并调用chaincode.js、日志和network-config.yaml 文件。
【问题讨论】:
-
invokechaincode.js - hastebin.com/izozunocir.js 链码函数 - hastebin.com/ajerilutoh.go 日志 - hastebin.com/dufaqaleni.vbs network-config.yaml - hastebin.com/tagotubuho.php
-
我获得了一些成功。然而,它仍然没有返回 block_num、txnid 和它应该根据链码事件的节点 SDK 事件文档提供的状态。对我来说,它仍然显示在日志调用链代码下方 - 成功获得了一个链代码事件,其中 transid:undefined with status:undefined with event:{ "PropertyNumber" : "Property2", "message" : "This account already exists", "code" : "503"}
-
看不到你的链码。
-
评论里的文件已经没有了,能再更新一下吗?我无法成功使用 registerChaincodeEvent()。