当前位置:   article > 正文

Hyperledger Fabric v1.4.1 性能测试工具 tape_fabric tape

fabric tape

参考链接
官网
参考
1、环境
搭建成功的fabric1.4.1
2、搭建tape
下载

#进入root目录
sudo i
git clone https://github.com/guoger/tape
  • 1
  • 2
  • 3

设置golang代理

export GO111MODULE=on
export GOPROXY=https://goproxy.cn
  • 1
  • 2

搭建

cd tape
go build ./cmd/tape
  • 1
  • 2

3、测试

vim config.yaml
  • 1

sample文件

endorsers:
  - addr: localhost:7051
    tls_ca_cert: /path/to/peer1/tls/ca/cert
  - addr: localhost:7051
    tls_ca_cert: /path/to/peer2/tls/ca/cert
committer:
  addr: localhost:7051
  tls_ca_cert: /path/to/peer2/tls/ca/cert
orderer:
  addr: localhost:7050
  tls_ca_cert: /path/to/orderer/tls/ca/cert
channel: mychannel
chaincode: basic
args:
  - GetAllAssets
mspid: Org1MSP
private_key: ./organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk
sign_cert: ./organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem
num_of_conn: 10
client_per_conn: 10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

根据自己的网络环境进行修改
这是我的修改后的文件

endorsers:
  - addr: localhost:7051
    tls_ca_cert: /home/node2/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem
  
committer:
  addr: localhost:7051
  tls_ca_cert: /home/node2/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem

orderer:
  addr: localhost:7050
  tls_ca_cert: /home/node2/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem

channel: mychannel
chaincode: mycc
args: ["query", "a"]
mspid: Org1MSP
private_key: /home/node2/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/ccf224f61bbf1106bc791b44f712189dbcd2490aaf92de1400d2d20a89a4385e_sk
sign_cert: /home/node2/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
num_of_conn: 40
client_per_conn: 20
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

此外,还可修改fabric-samples/first-network/configtx.yaml 出块策略部分

Orderer: &OrdererDefaults
    OrdererType: solo
    BatchTimeout: 2s
    BatchSize:
        MaxMessageCount: 10		#(可修改此处)
        AbsoluteMaxBytes: 99 MB
        PreferredMaxBytes: 512 KB
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

进行测试

./tape config.yaml 40000
  • 1

测试结果
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/521718
推荐阅读
相关标签
  

闽ICP备14008679号