Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid importing core Fabric as a library in Go implementation #44

Closed
bestbeforetoday opened this issue Nov 9, 2022 · 2 comments
Closed
Labels

Comments

@bestbeforetoday
Copy link
Member

github.com/hyperledger/fabric is not intended to be consumed as a library. Doing so has the following problems:

  • Risks breakage as Fabric implementation code may change at any time.
  • Pulls in a huge number of largely unnecessary indirect dependencies.
  • Causes compatibility issues due to ties to Fabric version, and its dependencies and their versions.

The primary reason Fabric is being used as a library seems to be for the protocol buffer utilities within Fabric. Unlike the utilities within Fabric, the protocol buffer message formats are well defined (if complicated) and versioned as public API. The protobuf message construction and manipulation required by the admin API as actually not too difficult and should remain stable.

A good alternative to importing Fabric internals might be to:

  1. Include code in this admin API implementation to build and manipulate protocol buffer messages.
  2. Where there is significant commonality between the code implemented in within this API, Fabric itself, and possibly other packages, extract those common pieces of code to a library module (such as hyperledger/fabric-lib-go) and make use of is in all relevant packages.
@stale
Copy link

stale bot commented Dec 20, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 20, 2022
@SamYuan1990 SamYuan1990 removed the stale label Dec 21, 2022
@SamYuan1990
Copy link
Contributor

@bestbeforetoday , do you have any idea as a major dependency for now is bccsp.
do you think we create a new repo with bccsp?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants