当我按照fabric(v1.2)(link here)教程执行调用以下命令时
peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc --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 --peerAddresses peer0.org2.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","10"]
我得到一个错误。
root@3e241e56114d:/opt/gopath/src/github.com/hyperledger/fabric/peer#
Error: could not assemble transaction: ProposalResponsePayloads do not match - proposal response: version:1 response:<status:200 > payload:"\n \310\335\t\270\014\205Ie\022\0334R\237\025{\0107\230\317c\247\250\206&\242\306n\326\340\263\214\365\022Y\nE\022\024\n\004lscc\022\014\n\n\n\004mycc\022\002\010\003\022-\n\004mycc\022%\n\007\n\001a\022\002\010\003\n\007\n\001b\022\002\010\003\032\007\n\001a\032\00290\032\010\n\001b\032\003210\032\003\010\310\001\"\013\022\004mycc\032\0031.0" endorsement:<endorser:"\n\007Org1MSP\022\252\006-----BEGIN CERTIFICATE-----\nMIICKDCCAc6gAwIBAgIQBRhp5NBFLjyIpZGuVWWRyjAKBggqhkjOPQQDAjBzMQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu\nb3JnMS5leGFtcGxlLmNvbTAeFw0xODA3MjQwMjU1MTJaFw0yODA3MjEwMjU1MTJa\nMGoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T\nYW4gRnJhbmNpc2NvMQ0wCwYDVQQLEwRwZWVyMR8wHQYDVQQDExZwZWVyMC5vcmcx\nLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBuEO2QW6RHxg\nX7t6yFWz+P+7+oGlo29oqeJ5FElI2UiSrXFIOZPlZva/XmVZRlEs1ApIRG5/6C6a\n/yej1AEFEaNNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0j\nBCQwIoAgiTLQaCWgadDTWC+Hg5sK2dgqyLfssOp3ICw6Nc+JedIwCgYIKoZIzj0E\nAwIDSAAwRQIhAJYGk42WKfaJ9PeGlynVs58EAykvo/ct7JKGXBbCpqYAAiBj68QP\nHmrLnqRDUMaRoBxPHDaJwIi3wO+LuKBAa2kDSw==\n-----END CERTIFICATE-----\n" signature:"0D\002 \036\031lf\322l\331\0018c)\263a\334V\204\210\366\006\320NU\265\326\205)\306\210\2757\231\022\002 U\"\022&e</)\036\254qC\353H\377\377\322R\215\334I\003\362\301\277R\310p'\rn\303" >
订单容器还按以下方式打印日志消息:
2018-07-24 03:26:59.429 UTC [orderer/common/broadcast] Handle -> WARN 020 Error reading from 172.18.0.7:35366: rpc error: code = Canceled desc = context cancele
最佳答案
使用此“构建您的第一个网络教程”时,我遇到了类似的问题(在Fabric v1.2中使用Invoke)。
在运行查询和调用命令之前,还要在org2上安装mycc链代码,从而为我解决了这个问题。
因此,您可以尝试将环境变量更改为org2,然后再次运行peer chaincode install
命令(这次将用于org2)。之后,您应该能够运行查询并调用命令。
简而言之,尝试使用这种单线并再次执行以下操作:CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp CORE_PEER_ADDRESS=peer0.org2.example.com:7051 CORE_PEER_LOCALMSPID="Org2MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt peer chaincode install -n mycc -v 1.0 -p github.com/chaincode/chaincode_example02/go/
关于docker - 无法在Fabric v1.2教程:build your first network中调用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51490272/