測試Fabric1.4.1效能執行以下指令
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
以上問題已經解決
歡迎小夥伴討論,如有錯誤請在評論區評論或發私聊訊息,謝謝你。