hyperledger

IBM 超级账本Fabric 性能测试

半腔热情 提交于 2019-11-30 14:06:03
用first-network来做压测 这里包含了渠道创建的时间。吞吐量大概在每秒10笔,看区块最大就10笔交易 如果改为批次5秒最大100个,显著提升了cpu的吞吐 看如上图形,基本是满负荷了 从cpu看,签名加密还是很耗时间的 看看改大参数能否改善性能?答案目前看是否定的,fabric很重量级,看来要将不同的docker部署到不同的服务器上。 另外我怀疑是发起测试的shell效率不高,但是我用echo语句填充时,哪怕几百个动作也是瞬间完成。可见Fabric是太重量级了。 -------------------------------------------------------------- 还有一个是稳定性问题 用参数默认2s,一个区块最大10个交易,跑了次800笔交易,最终交易量是778 但是如果参数优化,比如批次5秒,100个最大区块中交易数,则最终交易量是805个,这个是正确的交易数 -------------------------------------------------------------- Hyperledger性能工作组的官方测试 [超级账本性能和规模工作组](https://chat.hyperledger.org/channel/performance-and-scale-wg) [超级账本的性能测试工具PTE](https://github

Hyperledger caliper 安装记录

旧街凉风 提交于 2019-11-30 14:03:35
更多精彩内容请访问我的新博客站点 文章目录 Pre-requisites 1. 安装 make,g++ 编译工具 2. 安装node.js 3. 安装 node-gyp 4. 安装 Docker 5. 安装 Docker-compose Clone caliper repository Install fabric SDKs Run benchmark Bugs 运行测试遇到 `REQUEST_TIMEOUT` 的问题: Pre-requisites 需要安装的基础环境如下: make,g++ NodeJS 8.X node-gyp Docker Docker-compose 1. 安装 make,g++ 编译工具 sudo apt-get install make g++ 2. 安装node.js ubuntu 支持 nodesouce 的二进制安装脚本,命令如下: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs 安装完成后查看 node 与 npm 的版本: $ node -v v8.12.0 $ npm -v 6.4.1 3. 安装 node-gyp npm 全局安装 node-gyp: sudo npm install -g node

【爬坑记录】hyperledger caliper 性能测试工具使用的一些问题记录

人盡茶涼 提交于 2019-11-30 14:03:18
安装方法详见: 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

Hyperledger fabric性能测试及分析

旧城冷巷雨未停 提交于 2019-11-30 14:03:05
1 Go语言性能测试 写性能测试在Go语言中是很便捷的,go自带的标准工具链就有完善的支持。 1.1 benchmark 写benchmark测试有如下约定: benchmark也是测试,因此也是以 _test.go 结尾的文件; 需要 import testing ; 测试方法以 Benchmark 开始,并且拥有一个 *testing.B 参数。 *testing.B 参数提供了大多数和 *testing.T 类似的方法,同时也额外增加了一些性能测试相关的方法。此外,还提供了一个整型成员 N ,用来指定被检测操作的执行次数。 举个例子,下边是一个连接字符串的操作: bench_test.go : package main import "testing" import "strings" func BenchmarkStringJoin1(b *testing.B) { input := [] string { "Hello" , "World" } for i := 0 ; i < b.N; i++ { result := strings.Join(input, " " ) if result != "Hello World" { b.Error( "Unexpected result: " + result) } } } 然后执行benchmark测试: $ go test

Fabric-sdk-java链码访问快速上手【无痛】

假如想象 提交于 2019-11-30 11:43:47
在超级账本Fabric区块链中,应用通过节点的RPC协议接口访问链码。Java应用可以使用官方提供的Fabric-sdk-java开发包来实现对链码的访问,开发包封装了Fabric区块链的GRPC链码访问协议,有利于开发人员聚焦于业务逻辑。不过Fabric-sdk-java的文档质量保持了Hyperledger Fabric产品一贯的不知所云,看起来实在是令人捉急。本文将尝试编写一个最简单的可以访问Fabric链码的Java应用,来帮助你快速上手Farbic区块链的Java应用开发。 如果希望快速掌握Fabric区块链的链码及应用开发,建议访问汇智网的在线互动课程: Fabric区块链Java开发详解 Fabric区块链NodeJs开发详解 基本原理 在Fabric区块链中,应用通过节点的RPC协议接口访问链码: 类似于Shim API对链码通信协议的封装,Fabric Java SDK提供了 对节点RPC协议 接口的封装,其入口类为HFClient,对链码的查询和交易操作则 封装在Channel类中: 由于Fabric是许可制区块链,因此应用也需要持有证书和私钥以表征自己的身份,HFClient实例 依赖于User接口的实现对象 来访问一个特定身份的证书和私钥,因此在访问 链码之前,我们需要首先定义一个简单的User接口实现类。 实现User接口 HFClient

Fabric-sdk-java快速上手

安稳与你 提交于 2019-11-30 11:43:36
在超级账本Fabric区块链中,应用通过节点的RPC协议接口访问链码。Java应用可以使用官方提供的Fabric-sdk-java开发包来实现对链码的访问,java开发包封装了Fabric区块链的GRPC链码访问协议,有利于开发人员聚焦于业务逻辑。本文将通过编写一个最简单的可以访问Fabric链码的Java应用,来帮助你快速上手Fabric区块链的Java应用开发。 如果希望快速掌握Fabric区块链的链码及应用开发,建议访问汇智网的在线互动课程: Fabric区块链Java开发详解 Fabric区块链NodeJs开发详解 基本原理 在Fabric区块链中,应用通过节点的RPC协议接口访问链码: 类似于Shim API对链码通信协议的封装,Fabric Java SDK提供了 对节点RPC协议 接口的封装,其入口类为HFClient,对链码的查询和交易操作则 封装在Channel类中: 由于Fabric是许可制区块链,因此应用也需要持有证书和私钥以表征自己的身份,HFClient实例 依赖于User接口的实现对象 来访问一个特定身份的证书和私钥,因此在访问 链码之前,我们需要首先定义一个简单的User接口实现类。 实现User接口 HFClient 实例访问Fabric网络的身份使用 User 接口实现对象来表征,因此我们需要定义一个简单的 User接口实现类 LocalUser

Unable to enroll user in new org added to balance transfer sample

廉价感情. 提交于 2019-11-30 10:51:13
I am following Balance transfer from Hyperledger Fabric samples from this link . I have modified it a bit, now I have 3 Orgs with 1 Peer each. All goes fine till I enroll users to Org1 and Org2 but, when I try to enroll a user to my 3rd Org I get following error Failed to get registered user: xyz with error: Error: fabric-ca request register failed with errors [[{"code":63,"message":"Failed to get Affiliation: sql: no rows in result set"}]] My Binaries of Hyperledger Fabric are from version 1.1.0 Alfa The issue is that the fabric-ca being used in the sample does not know about the affiliation.

Using endorsements in Hyperledger Composer to design a process

旧巷老猫 提交于 2019-11-30 10:38:35
NB: I am seeking to understand how endorsements works in general. This will help me determine how to design applications when using Hyperledger Composer. When I read the links here and here , I came across this statement: "Transactions have to be “endorsed” and only endorsed transactions may be committed and have an effect on the state". The statement is clear. However, let's consider the composer developer tutorial here . We have a commodity that is currently owned by an owner(Trader1) who could sell it to somebody else(Trader 2). Currently, how many endorsements are needed for the

Hyperledger Fabric GOSSIP_BOOTSTRAP & GOSSIP_EXTERNALENDPOINTS

送分小仙女□ 提交于 2019-11-30 10:37:30
I was looking into the docker configuration files and found two parameters in peer environment as shown below: environment: - CORE_PEER_ID=peer0.org1.example.com - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 - CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 - CORE_PEER_LOCALMSPID=Org1MSP Can anyone explain what there two variables CORE_PEER_GOSSIP_BOOTSTRAP & CORE_PEER_GOSSIP_EXTERNALENDPOINT works. How they can be configured in case of odd number of peers. A detailed explanation would be really appreciated. Gari Singh

Best practice to save files in blockchain

穿精又带淫゛_ 提交于 2019-11-30 09:42:28
What is the best practice to save files as part of a blockchain's data? I have tremendously large files to be saved. Can't we save these file on cloud storage (centralized solution like dropbox), and link them with blockchain data using a file hash? Or is it better to use a distributed file storage like IPFS? Or is there any better solution in term of security, volume, performance, and fault tolerance. Lucas Hendren You do not want to directly use a traditional blockchain. Blockchains are good for transactional information/state changes, large data storage is generally a bad idea. This is due