无法组装事务,错误的建议响应未成功,错误代码500,味精链码注册失败:容器退出,返回1

时间:2019-11-25 11:42:43

标签: hyperledger-fabric hyperledger-chaincode

  • 我已经创建了链代码包

  • 然后我已经安装了ccpack.out
       peer chaincode install ccpack.out

  • 当我实例化该时间时

  

错误:无法组装交易,错误的提案响应未成功,错误代码500,味精链码注册失败:容器退出并显示为1

CLI查询:

peer chaincode instantiate -o orderer.example.com:7050 -C logistic -n tradecc -l node -v 0 -c '{"Args":[]}' -P 'AND('Org1MSP.member','Org2MSP.member')'

任何人都可以告诉我打包的链码实例化过程

1 个答案:

答案 0 :(得分:0)

最终我从此文档中获得了解决方案

实际上我已经安装了一个对等设备,并且我实例化了所有对等设备,所以我得到了 错误:无法组装交易,错误的提案响应未成功,错误代码500,味精链代码注册失败:容器退出并显示为1

SOLUTON: ########## chaincode软件包命令#########

 docker exec cli peer chaincode package -n tradecc -l node -p /opt/gopath/src/github.com/chaincode/`logistic`1 -v 0 -s -S ccpack.out

####在peer0.org1.example.com上安装链码##########

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_ADDRESS=peer0.org1.example.com:7051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

######在peer1.org1.example.com上安装链码#######

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_ADDRESS=peer1.org1.example.com:8051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

#######在peer0.org2.example.com上安装链码##########

docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer0.org2.example.com:9051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -e 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 cli peer chaincode install ccpack.out -l node

######在peer1.org2.example.com上安装链码#######

docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer1.org2.example.com:10051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -e 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 cli peer chaincode install ccpack.out -l node

####在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 logistic -n tradecc -l node -v 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
#在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 invoke -o orderer.example.com:7050 -C logistic -n tradecc -c '{"function":"invoke","Args":["{\"trade\":{\"Initledger\":{\"exporterName\":\"ex-raiii\",\"exportersBankName\":\"sbi\",\"exportersAccountBalance\":\"100000\",\"importerName\":\"im-ieekfvnor\",\"importersBankName\":\"kotak\",\"importersAccountBalance\":\"200000\",\"carrierName\":\"foredsty\",\"regulatorName\":\"typesgmdslcdd r-eg\"},\"flag\":\"initLedger\",\"tradeId\":\"000000100\"}}"]}' --waitForEvent --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 --peerAddresses peer1.org1.example.com:8051 --peerAddresses peer0.org2.example.com:9051 --peerAddresses peer1.org2.example.com:10051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt