Re: how to reference fabric 2.2 in application go.mod? #fabric #fabric-chaincode


Matthew Sykes
 

As of v2 of Fabric, the packages we expect applications and chaincode to build and link against have been extracted to `hyperledger/fabric-chaincode-go` and `hyperledger/fabric-protos-go`. Fabric is not structured as a set of libraries and attempts to reuse packages from the fabric repository will inevitably lead to sadness.

With that being said, if you need to pull in bits of Fabric, use commit hashes in `go.mod` and make no assumptions about API stability.


On Sat, Jan 16, 2021 at 1:26 PM Yueming Xu <yxucolo@...> wrote:
when my GO chaincode has reference to fabric code, the go.mod would pick the following version reference:
github.com/hyperledger/fabric v2.1.1+incompatible

I cannot change the version to v2.2.1, because go module requires a v2/go.mod.  What would you have to do if the application code have reference to code in fabric v2.2 or later?

In my case, I am trying to call the `fabric/common/policydsl.FromString()` to parse an endorsement policy string, so it does not matter to compile it with an older version of fabric, but I am curious how it work work if v2.2 code is required.



--
Matthew Sykes
matthew.sykes@...

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