Hyperledger Fabric-无法根据MagnetoCorp示例实例化合同

时间:2019-03-06 14:33:44

标签: hyperledger-fabric hyperledger hyperledger-chaincode

每当我尝试根据MagnetoCorp example实例化合同时,都会收到以下错误。 在终端中:

commit

2019-03-06 14:18:49.695 UTC [chaincodeCmd] InitCmdFactory -> INFO 001 Retrieved channel (mychannel) orderer endpoint: orderer.example.com:7050 2019-03-06 14:18:49.697 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default escc 2019-03-06 14:18:49.697 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default vscc Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (papercontract:0) 输出:

monitordocker

对我来说唯一有意义的一行是:

peer0.org1.example.com|2019-03-06 14:26:51.556 UTC [endorser] callChaincode -> INFO 04e [][9f290f94] Entry chaincode: name:"cscc" 
peer0.org1.example.com|2019-03-06 14:26:51.557 UTC [endorser] callChaincode -> INFO 04f [][9f290f94] Exit chaincode: name:"cscc"  (1ms)
peer0.org1.example.com|2019-03-06 14:26:51.557 UTC [comm.grpc.server] 1 -> INFO 050 unary call completed {"grpc.start_time": "2019-03-06T14:26:51.555Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "172.21.0.7:35966", "grpc.code": "OK", "grpc.call_duration": "1.572108ms"}
peer0.org1.example.com|2019-03-06 14:26:51.566 UTC [endorser] callChaincode -> INFO 051 [mychannel][ffd5a8c0] Entry chaincode: name:"lscc" 
peer0.org1.example.com|2019-03-06 14:26:51.566 UTC [lscc] executeDeployOrUpgrade -> ERRO 052 cannot get package for chaincode (papercontract:0)-err:open /var/hyperledger/production/chaincodes/papercontract.0: no such file or directory
peer0.org1.example.com|2019-03-06 14:26:51.566 UTC [endorser] callChaincode -> INFO 053 [mychannel][ffd5a8c0] Exit chaincode: name:"lscc"  (0ms)
peer0.org1.example.com|2019-03-06 14:26:51.566 UTC [endorser] ProcessProposal -> ERRO 054 [mychannel][ffd5a8c0] simulateProposal() resulted in chaincode name:"lscc"  response status 500 for txid: ffd5a8c09f7f5bc101b8caf0631a28ff222be0df90a94ac9c41b939dba7bd208
peer0.org1.example.com|2019-03-06 14:26:51.566 UTC [comm.grpc.server] 1 -> INFO 055 unary call completed {"grpc.start_time": "2019-03-06T14:26:51.565Z", "grpc.service": "protos.Endorser", "grpc.method": "ProcessProposal", "grpc.peer_address": "172.21.0.7:35966", "grpc.code": "OK", "grpc.call_duration": "988.672µs"}
orderer.example.com|2019-03-06 14:26:51.570 UTC [orderer.common.broadcast] Handle -> WARN 00f Error reading from 172.21.0.7:47540: rpc error: code = Canceled desc = context canceled
orderer.example.com|2019-03-06 14:26:51.570 UTC [comm.grpc.server] 1 -> INFO 010 streaming call completed {"grpc.start_time": "2019-03-06T14:26:51.566Z", "grpc.service": "orderer.AtomicBroadcast", "grpc.method": "Broadcast", "grpc.peer_address": "172.21.0.7:47540", "error": "rpc error: code = Canceled desc = context canceled", "grpc.code": "Canceled", "grpc.call_duration": "4.646613ms"}

因为我的系统中不存在executeDeployOrUpgrade -> ERRO 052 cannot get package for chaincode (papercontract:0)-err:open /var/hyperledger/production/chaincodes/papercontract.0: no such file or directory 目录。

1 个答案:

答案 0 :(得分:1)

/var/hyperledger/production/chaincodes文件夹位于Peer容器的文件系统上,而不是本地系统。

假设您正在使用本地样本结构,则可以使用类似于以下命令的命令检查文件夹的内容:

  

docker exec -it peer0.org1.example.com ls / var / hyperledger / production / chaincodes

这应该向您显示已安装的链码。希望输出将显示您已安装并需要实例化的确切名称和版本,但如果没有,则需要返回上一步的peer chaincode install命令。