[Robust Fabric Config] Refactor chaincode configuration #594
Labels
component/fabric
Related to the HL Fabric adapter
enhancement
New feature or request
locked
Someone is already working on it
Milestone
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 theid
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: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
The text was updated successfully, but these errors were encountered: