hyperledger / fabric-admin-sdk

Fabric SDK for Admin Capability services
Apache License 2.0
31 stars 19 forks source link

refactor: chaincode pkg #80

Closed SamYuan1990 closed 1 year ago

SamYuan1990 commented 1 year ago

Change detail

Signed-off-by: Sam Yuan yy19902439@126.com

SamYuan1990 commented 1 year ago

This change cover much more than chaincode packaging. Comments inline but on chaincode packaging... I'm not sure how useful or necessary this capability is. For the old lifecycle the packaging to .cds files was pretty intricate and involved Fabric protobufs. The new lifecycle packaging is well defined and can be achieved easily with other tools (like tar) in a build pipeline:

https://hyperledger-fabric.readthedocs.io/en/latest/chaincode_lifecycle.html#step-one-packaging-the-smart-contract

I would be tempted to not provide a chaincode package command, at least for a first iiteration.

in my point of view, I hope by this PR, increasing test coverage and during the enhancement, refactor code as const vars everywhere in this package. for .cds files, we can reference in a new issue. as currently we just have format as tar file for chaincode as service.

SamYuan1990 commented 1 year ago

This change cover much more than chaincode packaging. Comments inline but on chaincode packaging... I'm not sure how useful or necessary this capability is. For the old lifecycle the packaging to .cds files was pretty intricate and involved Fabric protobufs. The new lifecycle packaging is well defined and can be achieved easily with other tools (like tar) in a build pipeline:

https://hyperledger-fabric.readthedocs.io/en/latest/chaincode_lifecycle.html#step-one-packaging-the-smart-contract

I would be tempted to not provide a chaincode package command, at least for a first iiteration.

btw, for .cds file, will it as docker container together with peer or it is able to run with Chaincode as a service?(External chaincode service)

bestbeforetoday commented 1 year ago

@SamYuan1990 I made some minor amendments to your commit for consistency and so that the build passes. I have merged to resolve a build break, and to allow changes to be based on top of your refactor without merge conflicts.