测试Fabric1.4.1
中Go
语言智能合约性能执行以下指令
npx caliper launch master --caliper-workspace . --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-networkconfig networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml
报错内容如下:
Error while performing "install" step: Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1
"/chaincode/input/src/fabric/samples/marbles/go/marbles.go:110:2: cannot find package
"github.com/hyperledger/fabric/core/chaincode/shim" in any of:
/usr/local/go/src/github.com/hyperledger/fabric/core/chaincode/shim (from $GOROOT)
/chaincode/input/src/github.com/hyperledger/fabric/core/chaincode/shim (from $GOPATH)
/go/src/github.com/hyperledger/fabric/core/chaincode/shim
/chaincode/input/src/fabric/samples/marbles/go/marbles.go:111:2: cannot find package "github.com/hyperledger/fabric/protos/peer" in any of:
/usr/local/go/src/github.com/hyperledger/fabric/protos/peer (from $GOROOT)
/chaincode/input/src/github.com/hyperledger/fabric/protos/peer (from $GOPATH)
/go/src/github.com/hyperledger/fabric/protos/peer"
如图所示:
这是由于Fabric发布镜像的方式发生更改而导致的错误,这导致旧版Fabric(1.4.x
)无法正确生成链码,因为它们无法在docker hub中找到正确的镜像。
查看docker镜像
docker images
我测试的是Fabric1.4.1
的性能,所以执行,其他版本的小伙伴可以更改1.4.1
这个参数
docker image tag hyperledger/fabric-ccenv:1.4.1 hyperledger/fabric-ccenv:latest
再次查看docker镜像,已成功标记为latest
docker images
再次执行测试网络性能命令
npx caliper launch master --caliper-workspace . --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-networkconfig networks/fabric/fabric-v1.4.1/2org1peergoleveldb/fabric-go.yaml
以上问题已经解决
欢迎小伙伴讨论,如有错误请在评论区评论或发私聊消息,谢谢你。