Caliper测试1.4.1性能报错Error: Invalid endorsement for marbles@v0 in mychannel from peer0.org1.example.com

测试Fabric1.4.1Go语言智能合约性能执行以下指令

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

以上问题已经解决
在这里插入图片描述
欢迎小伙伴讨论,如有错误请在评论区评论或发私聊消息,谢谢你。

猜你喜欢

转载自blog.csdn.net/bean_business/article/details/108890260