IBM BLUEMIX BLOCKCHAIN SDK-DEMO失败 [英] IBM BLUEMIX BLOCKCHAIN SDK-DEMO failing

查看:42
本文介绍了IBM BLUEMIX BLOCKCHAIN SDK-DEMO失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用HFC SDK for Node.js,它曾经可以工作,但是从昨晚开始,我遇到了一些问题.

I have been working with HFC SDK for Node.js and it used to work, but since last night I am having some problems.

在运行helloblockchain.js时,只有几次有效,大多数情况下,当我尝试注册新用户时,都会出现此错误:

When running helloblockchain.js only few times works, most time I get this error when it tries to enroll a new user:

E0113 11:56:05.983919636    5288 handshake.c:128]            Security handshake failed: {"created":"@1484304965.983872199","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484304965.983866102","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

Error:  Failed to register and enroll JohnDoe: Error

其他时候,注册有效,并且部署链码时失败:

Other times, the enroll works and the failure appears deploying the chaincode:

Enrolled and registered JohnDoe successfully

Deploying chaincode ...
E0113 12:14:27.341527043    5455 handshake.c:128]            Security handshake failed: {"created":"@1484306067.341430168","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306067.341421859","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

Failed to deploy chaincode: request={"fcn":"init","args":["a","100","b","200"],"chaincodePath":"chaincode","certificatePath":"/certs/peer/cert.pem"}, error={"error":{"code":14,"metadata":{"_internal_repr":{}}},"msg":"Error"}

或者:

Enrolled and registered JohnDoe successfully

Deploying chaincode ...
E0113 12:15:27.448867739    5483 handshake.c:128]            Security handshake failed: {"created":"@1484306127.448692244","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306127.448668047","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
events.js:160
  throw er; // Unhandled 'error' event
  ^

Error
at ClientDuplexStream._emitStatusIfDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:217:12)
E0113 12:15:27.563487641    5483 handshake.c:128]            Security handshake failed: {"created":"@1484306127.563437122","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306127.563429661","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

该代码昨天有效,所以我不知道会发生什么.

This code worked yesterday, so I don't know what could be happening.

有人知道我该如何解决吗?

Does anybody know how can I fix it?

谢谢, 哈维尔.

推荐答案

这些间歇性问题通常与GRPC有关.最初的建议是确保您至少使用GRPC版本1.0.0.

These types of intermittent issues are usually related to GRPC. An initial suggestion is to ensure that you are using at least GRPC version 1.0.0.

如果使用的是Mac,则应检查打开文件描述符的最大数量(使用ulimit -n).有时最初将其设置为一个较低的值,例如256,所以增加该值可能会有所帮助.

If you are using a Mac, then the maximum number of open file descriptors should be checked (using ulimit -n). Sometimes this is initially set to a low value such as 256, so increasing the value could help.

有一些GRPC问题具有类似的症状.

There are a couple of GRPC issues with similar symptoms.

  • https://github.com/grpc/grpc/issues/8732
  • https://github.com/grpc/grpc/issues/8839
  • https://github.com/grpc/grpc/issues/8382

在某些问题中提到了grpc.initial_reconnect_backoff_ms属性.将值增加到1000 ms级别以上可能有助于减少问题的发生频率.以下是有关如何修改helloblockchain.js文件以将此属性设置为更高值的说明.

There is a grpc.initial_reconnect_backoff_ms property that is mentioned in some of these issues. Increasing the value past the 1000 ms level might help reduce the frequency of issues. Below are instructions for how the helloblockchain.js file can be modified to set this property to a higher value.

  1. 在Hyperledger Fabric Client示例中打开helloblockchain.js文件,然后找到enrollAndRegisterUsers函数.
  2. grpc.initial_reconnect_backoff_ms": 5000添加到setMemberServicesUrl调用中.

  1. Open the helloblockchain.js file in the Hyperledger Fabric Client example and find the enrollAndRegisterUsers function.
  2. Add "grpc.initial_reconnect_backoff_ms": 5000 to the setMemberServicesUrl call.

chain.setMemberServicesUrl(ca_url, {
        pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
});

  • grpc.initial_reconnect_backoff_ms": 5000添加到addPeer调用中.

  • Add "grpc.initial_reconnect_backoff_ms": 5000 to the addPeer call.

    chain.addPeer("grpcs://" + peers[i].discovery_host + ":" + peers[i].discovery_port, 
    {pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
    });       
    

  • 请注意,设置grpc.initial_reconnect_backoff_ms属性可以减少出现问题的频率,但不一定消除所有问题.

    Note that setting the grpc.initial_reconnect_backoff_ms property may reduce the frequency of issues, but it will not necessarily eliminate all issues.

    helloblockchain.js文件中与eventhub的连接也可能是一个因素. Hyperledger Fabric客户端有一个较早的版本,没有使用eventhub.可以尝试使用此早期版本来确定是否有所作为.运行git clone https://github.com/IBM-Blockchain/SDK-Demo.git后,运行git checkout b7d5195以使用此先前级别.从Node.js命令窗口运行node helloblockchain.js之前,可以使用git status命令检查正在使用的代码级别.

    The connection to the eventhub that is made in the helloblockchain.js file can also be a factor. There is an earlier version of the Hyperledger Fabric Client that does not utilize the eventhub. This earlier version could be tried to determine if this makes a difference. After running git clone https://github.com/IBM-Blockchain/SDK-Demo.git, run git checkout b7d5195 to use this prior level. Before running node helloblockchain.js from a Node.js command window, the git status command can be used to check the code level that is being used.

    这篇关于IBM BLUEMIX BLOCKCHAIN SDK-DEMO失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆