Getting different package ID for a chaincode - Hyperledger Fabric 2.2.0

507 Views Asked by At

I have an hyperledger fabric network (v2.2.0) running in a kubernetes cluster deployed using baf. Initially the network had 5 orgs (Org1, Org2, Org3, Org4 and Org5), later I tried to join an org (Org6) into the network using the baf script. Since using baf script didn't add the org to the channel successfully, I have manually joined the org6 to the network using the configtxlator tool.

Now during Chaincode installation, I am facing an issue. Tested the fabcar chaincode (from the github repo - fabric-samples-2.0.0-beta), this chaincode installation resulted in same package id for all the 6 orgs in the network. But when I tried to deploy my own chaincode, I am getting different package id for the newly added 6th org, and different package id for all the remaining 5 orgs. Can anyone explain the cause of this?

I need to quote a statement that I am using the chaincode that I was using in hyperledger fabric 1.4.2. Would the chaincode written for fabric v1.4.x work against fabric v.2.2.0? Also I am using peer lifecycle chaincode commands to deploy the chaincode.

1

There are 1 best solutions below

0
On BEST ANSWER

It's not impossible to get different package IDs as they are the hash of the chaincode package. With the same code and the same peer version, you've get the same ID it's true.

If, as far as you know, the chaincode package is exactly the same and the peer is exactly the same version - that it's worth double-checking the code is correct.

However, different package ids are permitted. It's used when you are talking to a peer to say "that chaincode I just installed with ID:xxx, please approve it, and then commit"