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

[Robust Fabric Config] Refactor chaincode configuration #594

Closed
aklenik opened this issue Sep 27, 2019 · 1 comment
Closed

[Robust Fabric Config] Refactor chaincode configuration #594

aklenik opened this issue Sep 27, 2019 · 1 comment
Assignees
Labels
component/fabric Related to the HL Fabric adapter enhancement New feature or request locked Someone is already working on it

Comments

@aklenik
Copy link
Contributor

aklenik commented Sep 27, 2019

Context

This issue is part of the Fabric network configuration schema refactoring task.

Currently, chaincodes of a channel are configured with array notation. Moreover, there is a constraint, that the contractID must be unique on a network level, since it's referenced in the user callback, identifying the channel and CC at the same time.

First, the contractID is optional, it defaults to the id of the CC. This can be confusing, and it's easy to forget. Second, the array notation makes it harder to look up CCs.

Possible fix

Since the channels.mychannel.chaincodes property is not part of the CCP of the SDK, we can refactor it the following way:

channels:
  mychannel:
    chaincodes:
      simpleContract:  # This is the now mandatory contractID
        id: ... # The rest is the same

Benefits

The unique contract ID is now explicit and mandatory. And it's unique on the channel level due to object key uniqueness. Checking the network-level uniqueness is easier now.
Plus, it's easier to check whether a given contractID exists, no need to iterate through everything.

Environment

  • Version: 0.1.0
@aklenik aklenik added enhancement New feature or request locked Someone is already working on it component/fabric Related to the HL Fabric adapter labels Sep 27, 2019
@aklenik aklenik added this to the v0.2.0 milestone Sep 27, 2019
@aklenik aklenik self-assigned this Sep 27, 2019
@aklenik aklenik modified the milestones: v0.2.0, v0.3.0 Oct 7, 2019
@aklenik aklenik modified the milestones: v0.3.0, Future release Nov 7, 2019
@nklincoln
Copy link
Contributor

Replaced with #940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/fabric Related to the HL Fabric adapter enhancement New feature or request locked Someone is already working on it
Projects
None yet
Development

No branches or pull requests

2 participants