Incompatible Chaincode on BYFN Peers

Q

How to list installed and instantiated chaincodes on BYFN Peers?

✍: FYIcenter.com

A

You can follow this tutorial to list and review installed and instantiated chaincodes on peer nodes of your BYFN network.

1. Connect to the BYFN CLI container and check the default peer:

$ docker exec -it cli bash

bash-4.4# echo $CORE_PEER_ADDRESS
peer0.org2.example.com:7051

2. List installed and instantiated chaincode on default peer, peer0.org1:

bash-4.4# peer chaincode list --installed
Get installed chaincodes on peer:
   Name: mycc, 
   Version: 1.0, Path: github.com/chaincode/chaincode_example02/go/, 
   Id: 476fca1a949274001971f1ec2836cb09321f0b71268b3762d68931c93f218134
   
bash-4.4# peer chaincode list --instantiated -C mychannel
Get instantiated chaincodes on channel mychannel:
   Name: mycc, 
   Version: 1.0, 
   Path: github.com/chaincode/chaincode_example02/go/, 
   Escc: escc, 
   Vscc: vscc

3. List installed and instantiated chaincode on peer0.org2, using prefix to specify the target peer:

bash-4.4# CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger\
   /fabric/peer/crypto/peerOrganizations/org2.example.com/users\
   /Admin@org2.example.com/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 list --installed
Get installed chaincodes on peer:
   Name: mycc, Version: 1.0, 
   Path: /opt/gopath/src/github.com/chaincode/chaincode_example02/node/, 
   Id: ade2b277014cd59f9856722c2bee26f274823622ea6f3d6994eb1db968dbd69a
   
bash-4.4# CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger\
   /fabric/peer/crypto/peerOrganizations/org2.example.com/users\
   /Admin@org2.example.com/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 \
   chaincode list --instantiated -C mychannel
Get instantiated chaincodes on channel mychannel:
   Name: mycc, 
   Version: 1.0, 
   Path: /opt/gopath/src/github.com/chaincode/chaincode_example02/node/, 
   Escc: escc, 
   Vscc: vscc

Looks like we have a problem here. 2 anchor peers run the same chaincode instance "mycc" in "mychannel" using difference chaincode source code. One uses the Golang version, and the other uses the Node.js version.

This will cause the "could not assemble transaction: ProposalResponsePayloads do not match" error when running the "peer chaincode invoke" command mentioned the previous tutorial. See next tutorial on how to resolve the issue.

 

BYFN Chaincode Docker Container

BYFN CLI "peer" Command Prefix

BYFN (Build Your First Network)

⇑⇑ Hyperledger Tutorials

2019-04-29, 250👍, 0💬