0

I'm following this tutorial — https://kctheservant.medium.com/multi-host-deployment-for-first-network-hyperledger-fabric-v2-273b794ff3d.

I've successfully installed, approved and committed chaincode on both peers.

These are installed chaincodes on host1 and host2 respectively:

Installed chaincodes on peer:
Package ID: fabcar_1:7ed63d49b5b7ff8f8f17cf3106975e1b731b3d1f7c417ef050a24315ef828085, Label: fabcar_1
Package ID: fabcar_1:a8fdf3e70eaa79c8481356484661fe3c763b5fc744ca82c8c564ece77a83cf8b, Label: fabcar_1
Package ID: fabcar_1:cd4f25953c7b04623652da137067c386062bf1b9a6de0e710c72f11e81c7ea0c, Label: fabcar_1
Installed chaincodes on peer:
Package ID: fabcar_1:7ed63d49b5b7ff8f8f17cf3106975e1b731b3d1f7c417ef050a24315ef828085, Label: fabcar_1

Also commit status of peers:

Committed chaincode definition for chaincode 'fabcar' on channel 'mychannel':
Version: 1, Sequence: 2, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]

And so when I try to invoke chaincode with

docker exec cli peer chaincode invoke -o orderer3.example.com:9050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer3.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n fabcar --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:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["initLedger"]}'

I get such error:

Error: endorsement failure during invoke. response: status:500 message:"make sure the chaincode fabcar has been successfully defined on channel mychannel and try again: chaincode definition for 'fabcar' exists, but chaincode is not installed"

CORE_PEER_GOSSIP_USELEADERELECTION is set to true if it'll help. Nodes are running in docker. Any help would be greatly appreciated.

adite
  • 3
  • 3

2 Answers2

0

I've experience the same issue and it was due to using the wrong --package-id when approving the chain-code.

More info here

Matias Salimbene
  • 510
  • 6
  • 19
0

Just write docker ps -a. and check the chaincode logs. clean solution

newUser
  • 386
  • 5
  • 17