这是一个有趣的情况......
我已经在两台机器上部署了 Fabric 网络,并且能够通过 cli 查询和调用事务。
我还使用 NodeJS 应用程序,通过它我可以查询网络,但无法调用任何事务。
每当我从 NodeJS 应用程序调用时,就会出现此错误:
"Failed to connect before the deadline".
来自 Node 应用程序的日志:
[Remote.js]: Error: Failed to connect before the deadline
error: [Orderer.js]: Orderer grpcs://orderer.test.com:7050 has an error Error: Failed to connect before the deadline
这是我正在使用的 NodeJS 应用程序模板:https://github.com/olegabu/fabric-starter-rest
知道出了什么问题吗?
最佳答案
那么您的 SDK 是在容器内运行吗? 您是否尝试过在 SDK 容器内 curl 排序者?
如果它不起作用,也许您可以在运行容器时(或在 dockerfile 中)添加排序者的主机
--add-host=orderer.test.com:${orderer-ip}
关于node.js - Hyperledger Fabric + NodeJS 应用程序 - 查询但不调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52950900/