gpt4 book ai didi

java - HyperLedger Fabric 网络 Chaincode 实例化错误

转载 作者:行者123 更新时间:2023-12-05 07:14:16 25 4
gpt4 key购买 nike

我正在做来自 hyperledger fabric 网站的 fabcar 教程,它将引导您构建您的第一个应用程序: https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html 。智能合约有 3 种实现,Java、Javascript 和 TypeScript。当我运行 javascript 版本时,一切正常。但是我想运行 Java 版本,但是当我构建脚本时出现以下错误:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

这可能是我的 java (13) 版本有问题还是其他问题?

这里有更多日志,在最后一步之前一切似乎都正常。

echo 'Instantiating smart contract on mychannel' Instantiating smart contract on mychannel + docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l java -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt 2020-01-28 19:24:23.402 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc 2020-01-28 19:24:23.402 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

更新peer0.org1.example.com 故障点的docker日志:

2020-01-29 13:05:01.124 UTC [endorser] callChaincode -> INFO 068 [mychannel][3d08b962] Entry chaincode: name:"lscc" 2020-01-29 13:05:59.950 UTC [endorser] callChaincode -> INFO 069 [mychannel][3d08b962] Exit chaincode: name:"lscc" (58894ms) 2020-01-29 13:05:59.952 UTC [endorser] SimulateProposal -> ERRO 06a [mychannel][3d08b962] failed to invoke chaincode name:"lscc" , error: container exited with 1 github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1 /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63 runtime.goexit /opt/go/src/runtime/asm_amd64.s:1337 chaincode registration failed 2020-01-29 13:05:59.953 UTC [comm.grpc.server] 1 -> INFO 06b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=192.168.192.13:53690 grpc.code=OK grpc.call_duration=58.8992206s

最佳答案

如果您已经使用 Javascript 版本完成本教程(如上所述),您必须首先关闭现有网络并删除所有 Activity 容器。

./byfn.sh down
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk '{print $3}')

现在使用 ./startFabric.sh java 运行 Java 版本的启动脚本

关于java - HyperLedger Fabric 网络 Chaincode 实例化错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59955865/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com