原文: https://blog.csdn.net/raogeeg/article/details/82752613

安装方法详见:https://github.com/hyperledger/caliper

hyperledger caliper 使用过程的一些坑以及解决办法

not ok 2 Failed to join peers, TypeError: Cannot read property ‘getConnectivityState’ of undefined at EventHub._checkConnection

# create mychannel......
ok 1 created mychannel successfully
# Sleep 5s......
# Join channel......
# join mychannel
not ok 2 Failed to join peers, TypeError: Cannot read property 'getConnectivityState' of undefined at EventHub._checkConnection (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:479:39) at EventHub.registerBlockEvent (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:658:8) at Promise (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:139:20) at new Promise (<anonymous>) at eventhubs.forEach (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:136:29) at Array.forEach (<anonymous>) at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:135:19) at <anonymous>
---
operator: fail
at: channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:215:19)
stack: |-
Error: Failed to join peers, TypeError: Cannot read property 'getConnectivityState' of undefined
at EventHub._checkConnection (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:479:39)
at EventHub.registerBlockEvent (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:658:8)
at Promise (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:139:20)
at new Promise (<anonymous>)
at eventhubs.forEach (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:136:29)
at Array.forEach (<anonymous>)
at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:135:19)
at <anonymous>
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:215:19)
at <anonymous>
...
fabric.init() failed, Error: Fabric: Join channel failed
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:216:31)
at <anonymous>
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: Join channel failed
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:216:31)
at <anonymous>
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)
/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:308
if(self._stream) state = self._stream.call.channel_.getConnectivityState();
^

TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream.<anonymous> (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:308:56)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at ClientDuplexStream.Readable.push (_stream_readable.js:208:10)
at Object.onReceiveMessage (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:1276:19)
at InterceptingListener.recvMessageWithContext (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:603:19)
at /Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:702:14

解决方法:

使用grpc version 1.10.1 代替之前的1.13.1版本
npm install grpc@1.10.1
2:not ok 1 Failed to create channels Error: create status is BAD_REQUEST at channel.organizations.reduce.then.then.then

# create mychannel......
not ok 1 Failed to create channels Error: create status is BAD_REQUEST at channel.organizations.reduce.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:145:43) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
---
operator: fail
at: channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:159:19)
stack: |-
Error: Failed to create channels Error: create status is BAD_REQUEST
at channel.organizations.reduce.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:145:43)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:159:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
...
fabric.init() failed, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:160:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:160:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)```

解决办法:

和之前搭建fabric环境遇到的问题一样,BAD_REQUEST 经常是当前要创建的channel 已经存在所以会出现这个错误,
我们可以通过docker rm -f $(docker ps -q -a)
移除之前的容器,但是如果不是channnel 已存在的问题 ,暂时就不知道怎么解决了
error: [Peer.js]: sendProposal - timed out after:120000

# Instantiate chaincode......
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
not ok 4 Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting... at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:372:19) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) at Client.newDefaultKeyValueStore.then.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:385:15) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
---
operator: fail
at: chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:60:19)
stack: |-
Error: Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:372:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Client.newDefaultKeyValueStore.then.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:385:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:60:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
...
fabric.installSmartContract() failed, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:61:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:61:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)

解决办法:

这个问题算是比较坑的了,在网上找了很久,看到github 有一个一样的问题
https://github.com/hyperledger/caliper/issues/137
有一条评论提到,因为机器性能问题,开启的peer 较多,两分钟不足以在本机上实例化chaincode 但是照着上面的方式修改了
文件:github.com/hyperledger/caliper/src/fabric/e2eUtils.js#211中的request_time 时间
运行后还是没有解决这个问题,经过一天时间,巧合看到一篇文章提到修改文件:github.com/hyperledger/caliper/node_modules/fabric-client/config/default.json
配置文件中的request_time 运行成功
---------------------
作者:PoormaJin
来源:CSDN
原文:https://blog.csdn.net/raogeeg/article/details/82752613
版权声明:本文为博主原创文章,转载请附上博文链接!

【转载】【爬坑记录】hyperledger caliper 性能测试工具使用的一些问题记录的更多相关文章

  1. 【转载】8.2.1 CPU性能测试工具

    (KVM连载) 8.2.1 CPU性能测试工具 01/08/2013master 1 Comment 8.2.1 CPU性能测试工具 CPU是计算机系统中最核心的部件,CPU的性能直接决定了系统的计算 ...

  2. mybatis-generator 详细配置及使用,爬坑记录

    mybatis-generator 详细配置及使用,爬坑记录 提示:如果不成功一定是项目路径和 数据库配置出问题,本篇基于 MySQL 8.0.13,调试没有问题. 如果失败,建议使用相同的项目结构, ...

  3. 03、Swagger2和Springmvc整合详细记录(爬坑记录)

    时间 内容 备注 2018年6月18日 基本使用 spirngmvc整合swagger2 开始之前这个系列博文基本是,在项目的使用中一些模块的内容记录,但是后期逐渐优化,不单单是整合内容. swagg ...

  4. centos7安装Mysql爬坑记录

    centos7安装Mysql爬坑记录   查看是否已安装 使用下列命令查看是否已经安装过mysql/mariadb/PostgreSQL 如果未安装,不返回任何结果(ECS的centos镜像默认未安装 ...

  5. elasticsearch 单节点搭建与爬坑记录

    elasticsearch 单节点搭建与爬坑记录   prepare   虚拟机或者云服务器(这里用的是阿里云ECS) linux---centos7 安装完毕的jdk 相应的安装包(在https:/ ...

  6. [转载]性能测试工具 2 步解决 too many open files 的问题,让服务器支持更多连接数

    [转载]性能测试工具 2 步解决 too many open files 的问题,让服务器支持更多连接数 大话性能 · 2018年10月09日 · 最后由 大话性能 回复于 2018年10月09日 · ...

  7. 网络性能测试工具iperf详细使用图文教程【转载】

    原文:http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ 参考:http://man.linuxde.net/iper ...

  8. Apache性能测试工具ab使用详解~转载

    Apache自带性能测试工具ab使用详解 一. Apache的下载 1. http://www.apache.org/,进入Apache的官网 2. 将页面拖到最下方“Apache Project L ...

  9. 【转载】python3安装scrapy之windows32位爬坑

    python3安装scrapy之windows32位爬坑 原创 2016年11月06日 01:38:08 标签: scrapy / windows / python / 开源框架 / 网络爬虫   早 ...

随机推荐

  1. zTree获取(子)节点

    var ids=[]; ids=getChildren(ids, treeNode);//TreeNode是选中节点,ids是子节点id数组,格式:123,223,4,55 1.获取直接子节点的id ...

  2. C++STL 常用 函数 用法(转)

    http://www.cnblogs.com/duoduo369/archive/2012/04/12/2439118.html 迭代器(iterator) 个人理解就是把所有和迭代有关的东西给抽象出 ...

  3. C++11 右值引用 与 转移语义

    新特性的目的 右值引用(R-value Reference)是C++新标准(C++11, 11代表2011年)中引入的新特性,它实现了转移语义(Move Semantics)和精确传递(Perfect ...

  4. 【原创】C++实现获取本机机器名及外网IP代码

    上代码: #include "stdafx.h" #include <WINSOCK2.H> #include <urlmon.h> #pragma com ...

  5. wcf win7上使用net.tcp出现不支持协议问题解决

    第一:iis绑定 net.tcp 808:* 第二:iis 应用中高级开启协议,添加net.tcp多协议逗号隔开 第三:开启各项服务 第四:执行 ServiceModReg.exe -r

  6. ACM学习历程—HDU 5025 Saving Tang Monk(广州赛区网赛)(bfs)

    Problem Description <Journey to the West>(also <Monkey>) is one of the Four Great Classi ...

  7. bzoj 1006: 神奇的国度 MCS

    题目大意: 弦图的最小染色. 题解: 裸题. #include <vector> #include <cstdio> #include <cstring> #inc ...

  8. HUE,大数据的SQL Shell

    1. HUE需要安装SASL 发现异常: Could not install table: Error creating table sample_07: Could not start SASL: ...

  9. 2006年清华:N的阶乘

    题目描述: 输入一个正整数N,输出N的阶乘. 输入: 正整数N(0<=N<=1000) 输出: 输入可能包括多组数据,对于每一组输入数据,输出N的阶乘 样例输入: 4 5 15 样例输出: ...

  10. 优秀开源项目之三:高性能、高并发、高扩展性和可读性的网络服务器架构State Threads

    译文在后面. State Threads for Internet Applications Introduction State Threads is an application library ...