Re: Calculation of chaincode package ID in v2.2.x #fabric-questions #externalbuilders #fabric


Brett T Logan <brett.t.logan@...>
 

The unique identifier on the package ID is the sha256 of the chaincode "package" bytes. When you package the chaincode a metadata file is added that contains the path to the chaincode, its language, and its label. Is there any variation in these? In 2.0 and later the chaincode package is simply a tarball, you can untar it as you would any other tarball and inspect the contents to see what might be different between them.
 
Brett Logan
Software Engineer, IBM Blockchain
Phone: 1-984-242-6890
 
 
 

----- Original message -----
From: chintanr97@...
Sent by: fabric@...
To: fabric@...
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] Calculation of chaincode package ID in v2.2.x #fabric-questions #externalbuilders #fabric
Date: Sat, Nov 7, 2020 12:00 PM
 
Hi Team, I was trying to identify how is the chaincode package id calculated in HLF v2.2.x. More specifically, I understand that when dependencies change, the package ID would change too, for same package label.

However, I was facing an issue while following this guide to generate a package for "external chaincode service". If we see, the contents of package in this case are not likely to change for given "chaincode package label". Given that, I am not using CouchDB indexes in the package for now, whenever I delete and recreate the package, ideally the installation should be give me "same package id" on different peers. I am confused, because installing the package in this case (on re-creating package for different peers) is giving me different package IDs.

Given that I might not want to install chaincode package on all the peers I am running (at the same time), and I would also not like to store the packages in a place, given I can dynamically generate it before running `peer lifecycle chaincode install` command - I expect that because the contents are not going to change for a particular chaincode package label (or neither the environment is changing), why would the package ID be different?
 

Join fabric@lists.hyperledger.org to automatically receive all group messages.