错误:查询期间背书失败。找不到链码(尽管已实例化链码)

时间:2019-05-02 10:45:45

标签: hyperledger-fabric blockchain

当我从cli查询链码时,出现以下错误:

Error: endorsement failure during query. response: status:500 message:"make sure the chaincode SimpleChaincode has been successfully instantiated and try again: chaincode SimpleChaincode not found" 

尽管如此,我看到链码已实例化。如果我检查docker ps,我可以看到chaincode的docker正在运行,并且其日志向我显示了chaincode的init函数消息正确显示。

cli在实例化链码的同级中运行。我不知道这是否有问题。

这是无法执行的query.sh:

ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/motogp.com/orderers/orderer.motogp.com/msp/tlscacerts/tlsca.motogp.com-cert.pem
CORE_PEER_LOCALMSPID="hondaMSP"
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/honda.motogp.com/peers/peer0.honda.motogp.com/tls/ca.crt
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/honda.motogp.com/users/Admin@honda.motogp.com/msp
CORE_PEER_ADDRESS=peer0.honda.motogp.com:7051
CHANNEL_NAME=motogpchannel
CORE_PEER_TLS_ENABLED=true

queryChaincode () {
    peer chaincode query -C $CHANNEL_NAME -n SimpleChaincode -c '{"Args":["query","a"]}' >&log.txt
    res=$?
    cat log.txt
}

queryChaincode

0 个答案:

没有答案