问题描述
使用Fabric Composer v0.7.0,我已将业务网络部署到Bluemix(v0.6)上的区块链服务.
Using fabric composer v0.7.0 I have deployed a business network to a Blockchain service on Bluemix (v0.6).
应用运行一段时间后,出现以下错误:
After the app runs for a while I get the following error:
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/vcap/app/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._receiveStatus (/home/vcap/app/node_modules/grpc/src/node/src/client.js:169:8)
有时在执行composer network deploy
命令时也会发生这种情况.
This sometimes happens when executing the composer network deploy
command as well.
推荐答案
如何处理:
- 您可能(可能应该)运行您的应用程序的多个实例,因此当一个崩溃时,另一个实例仍在运行以接管工作.
- 在每个链码调用之前调用
BusinessNetworkConnection.connect()
以重新创建事件中心连接. 请注意,这并不是很有效,因为建立连接需要一段时间
- You could (probably should) have multiple instances of your application running so when one crashes another is still running to take over.
- Calling
BusinessNetworkConnection.connect()
before every chaincode invoke to recreate the event hub connection. Please note that this is not very efficient, as making the connection takes a while
如果使用composer-cli
进行部署时发生错误,则可能需要一分钟左右的时间再次尝试执行该命令.
If the error occurs when deploying with the composer-cli
you may want to try executing the command again after a minute or so.
在设定的时间间隔内调用BusinessNetworkConnection.ping()
不会解决此问题,因为该问题是由事件中心引起的,并且事件仅在实际事务中发布. ping()
是只读链码查询,不会创建事务.
Calling BusinessNetworkConnection.ping()
during a set interval will not help with the issue because the problem is caused by the event hub, and events are only published on actual transactions. ping()
is a read-only chaincode query that does not create a transaction.
这篇关于Fabric Composer的Bluemix区块链服务错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!