赞
踩
参考链接
官网
参考
1、环境
搭建成功的fabric1.4.1
2、搭建tape
下载
#进入root目录
sudo i
git clone https://github.com/guoger/tape
设置golang代理
export GO111MODULE=on
export GOPROXY=https://goproxy.cn
搭建
cd tape
go build ./cmd/tape
3、测试
vim config.yaml
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
根据自己的网络环境进行修改
这是我的修改后的文件
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
此外,还可修改fabric-samples/first-network/configtx.yaml 出块策略部分
Orderer: &OrdererDefaults
OrdererType: solo
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10 #(可修改此处)
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
进行测试
./tape config.yaml 40000
测试结果
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。