文档类别 技术文档
文档名称 [单机 caliper 安装]
关键词 [caliper]
修改历史
日期
2020.01.08
版本
1.0
作者
廖驷
修改内容
评审号
变更控制号
新建
1
1.概述
单机 caliper 安装。
2.正文
Ubuntu 系统:18.02
环境:fabric1.4.1
安装步骤:
1. 先在 ubuntu 系统中安装 fabric 环境 1.4.1
2. 安装所需要的工具:make,g++,Python-pip,git,node-gyp
3. node-js v8.X LTS (用于运行 Capliper)
make 及 g++安装命令:sudo apt-get install make g++
Python-pip 安装命令:sudo apt install python-pip
git 安装命令: sudo apt-get install git
安装 nodejs 8.11.4 环境安装
1. 先安装 nvm
curl
-o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
安装后重启该会话或重新开一个会话即可生效
查看当前支持的版本:nvm ls-remote
2.安装(同时安装 npm):nvm install 8.11.4
2
检查 node.js 安装版本:node -v
检查 npm 的安装版本:npm -v
切换源:npm install -g nrm;nrm ls;nrm use taobao
安装 node-gyp:sudo npm install -g node-gyp
注:在安装 node-gyp 之前,使用 nvm 将 node 版本转为 10.15.0,然后再安装
就不会报 warn 警告(命令:nvm install 10.15.0)
caliper 安装
首先下载再 GitHub 上 caliper-benchmarks-master.zip(地址:
https://github.com/hyperledger/caliper-benchmarks)然后解压在该文件目录下
打开终端输入
全局 npm 安装:
user@ubuntu:~/caliper-benchmarks$ npm init
-yuser@ubuntu:~/caliper-benchmarks$ npm install --only=prod
@hyperledger/caliper-cliuser@ubuntu:~/caliper-benchmarks$ npx caliper bind
--caliper-bind-sut fabric --caliper-bind-sdk 1.4.1
user@ubuntu:~/caliper-benchmarks$ npx caliper benchmark run
--caliper-workspace . --caliper-benchconfig
benchmarks/scenario/simple/config.yaml --caliper-networkconfig
networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml
执行完上述命令后,会在文件夹生成一个 report.html 的文件
3
4
Summary
Name
Succ
Fail
Send Rate
Max
(TPS)
Latency (s)
open
100
query
100
0
0
50.1
101.1
transfer
78
22
50.5
0.43
0.02
0.40
Min
Latency
(s)
0.11
0.01
0.12
Avg
Throughput
Latency (s)
(TPS)
0.26
0.01
0.22
46.0
100.5
34.9
open
Test description for the opening of an account through the
deployed chaincode
round 0
Performance metrics
Name
Succ
Fail
Send Rate
Max
Min
Avg
Throughput
(TPS)
Latency (s)
Latency (s)
Latency (s)
(TPS)
open
100
0
50.1
0.43
0.11
0.26
46.0
Resource consumption
Typ
e
Doc
ker
Doc
ker
Name
Memory
(max)
Memor
y(avg)
dev-peer0.org2.example.
com-smallbank-v0
6.0MB
6.0MB
dev-peer0.org1.example.
com-smallbank-v0
6.5MB
6.5MB
CP
U
%
(m
ax)
0.0
0
0.0
0
CP
U
%
(av
g)
0.0
0
0.0
0
Traf
fic
In
Traf
fic
Out
Disc
Rea
d
Disc
Writ
e
273
B
273
B
0B
0B
0B
0B
0B
0B
5
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
dev-peer0.org1.example.
com-simple-v0
5.8MB
5.7MB
dev-peer0.org2.example.
com-simple-v0
6.0MB
5.8MB
dev-peer0.org1.example.
com-drm-v0
5.0MB
5.0MB
dev-peer0.org2.example.
com-drm-v0
4.7MB
4.7MB
dev-peer0.org1.example.
com-marbles-v0
5.5MB
4.7MB
dev-peer0.org2.example.
com-marbles-v0
7.1MB
5.3MB
peer0.org1.example.com 167.7MB
147.2MB
peer0.org2.example.com 187.6MB
186.1MB
orderer.example.com
28.2MB
25.4MB
ca.org2.example.com
6.9MB
6.9MB
ca.org1.example.com
9.8MB
9.8MB
2.9
5
3.5
0
0.0
0
0.0
0
0.4
8
0.7
6
16.
71
16.
45
5.8
2
0.0
0
0.0
0
0.9
8
1.1
7
0.0
0
0.0
0
0.1
6
0.2
5
6.2
9
5.9
3
1.9
4
0.0
0
0.0
0
184.
3KB
182.
4KB
81.7
KB
79.8
KB
408.
0KB
560.
0KB
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
149
B
149
B
610.
7KB
603.
8KB
425.
5KB
149
B
149
B
449.
7KB
319.
9KB
807.
4KB
2.3M
B
5.4M
B
0B
0B
2.0M
B
1.1M
B
2.4M
B
1.1M
B
7.1M
B
912.
0KB
0B
0B
0B
0B
0B
0B
0B
0B
query
Test description for the query performance of the deployed
chaincode
round 0
Performance metrics
6
Name
Succ
Fail
Send Rate
Max
Min
Avg
Throughput
(TPS)
Latency (s)
Latency (s)
Latency (s)
(TPS)
query
100
0
101.1
0.02
0.01
0.01
100.5
Resource consumption
Name
Memory
(max)
Memory
(avg)
CP
U%
(m
ax)
CP
U%
(av
g)
Tra
ffic
In
Tra
ffic
Out
Di
sc
Re
ad
Dis
c
Wr
ite
dev-peer0.org2.example.c
om-smallbank-v0
6.0MB
6.0MB
dev-peer0.org1.example.c
om-smallbank-v0
6.5MB
6.5MB
dev-peer0.org1.example.c
om-simple-v0
5.9MB
5.9MB
dev-peer0.org2.example.c
om-simple-v0
6.3MB
6.3MB
dev-peer0.org1.example.c
om-drm-v0
5.0MB
5.0MB
dev-peer0.org2.example.c
om-drm-v0
4.7MB
4.7MB
dev-peer0.org1.example.c
om-marbles-v0
5.5MB
5.5MB
dev-peer0.org2.example.c
om-marbles-v0
7.1MB
7.1MB
peer0.org1.example.com
174.8MB
174.8MB
peer0.org2.example.com
187.9MB
187.9MB
orderer.example.com
28.2MB
28.2MB
0.0
1
0.0
1
3.3
8
3.3
9
0.0
0
0.0
0
0.0
0
0.0
0
11.
96
11.
55
0.0
1
0.0
1
0.0
1
3.3
8
3.3
9
0.0
0
0.0
0
0.0
0
0.0
0
11.
96
11.
55
0.0
1
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
Typ
e
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ca.org2.example.com
6.9MB
6.9MB
0.0
0.0
0B
0B
0B
0B
7
ker
Doc
ker
ca.org1.example.com
9.8MB
9.8MB
0
0
0.0
0
0.0
0
0B
0B
0B
0B
transfer
Test description for transfering money between accounts
round 0
Performance metrics
Name
Succ
Fail
Send Rate
Max
(TPS)
Latency (s)
Min
Latency
(s)
Avg
Throughput
Latency (s)
(TPS)
transfer
78
22
50.5
0.40
0.12
0.22
34.9
Resource consumption
Typ
e
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Doc
ker
Name
Memory
(max)
Memory
(avg)
dev-peer0.org2.example.c
om-smallbank-v0
6.0MB
6.0MB
dev-peer0.org1.example.c
om-smallbank-v0
6.5MB
6.5MB
dev-peer0.org1.example.c
om-simple-v0
5.9MB
5.9MB
dev-peer0.org2.example.c
om-simple-v0
6.2MB
6.2MB
dev-peer0.org1.example.c
om-drm-v0
5.0MB
5.0MB
CP
U%
(m
ax)
CP
U%
(av
g)
Tra
ffic
In
Tra
ffic
Out
Di
sc
Re
ad
Dis
c
Wr
ite
0.0
0
0.0
0
1.9
9
2.5
7
0.0
0
0.0
0
0.0
0
1.9
9
2.5
7
0.0
0
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
0B
Doc
dev-peer0.org2.example.c
4.7MB
4.7MB
0.0
0.0
0B
0B
0B
0B
8