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


chintanr97@...
 

I am using "chaincode as an external service". So likely my package does not have any chaincode related dependencies. My package mycc.tgz contains following contents:
1. code.tar.gz
  1. This contains `connection.json` file whose content is constant for the given package label:

```
{
  "address": "mycc:9999",
  "dial_timeout": "10s",
  "tls_required": true
}
```

2. `metadata.json`:
  1. `{"path":"","type":"external","label":"mycc"}`

Now, as we see the package label `mycc` is not going to change and so are the contents going to be constant. When I create package for first time, I install only on `peer1` and `peer2`. Given that I know the contents are exactly the same, I will not persist the package. Later after some period I decide to install package on `peer3`. Again I create the same tarball `mycc.tgz` with exactly the same content. However, on installing on `peer3` the `packageID` turns out to be different than what it was on `peer1` or `peer2`. I do not understand this difference in hash calculations. Ideally, content is exactly same, creating packages at different timestamps, should not affect the hash right? In my case the environment and the script I am running are also the same always. 

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