Currently, defining collections within chaincode requires manually constructing the peer.CollectionConfigPackage structure, which can be cumbersome and error-prone. This issue proposes the creation of a high-level API function that simplifies this process by accepting a collection configuration string and automatically converting it into the required format for ChaincodeDefinition.Collections.
(Write your answer here.)
Describe the solution you'd like
Introduce a new function, potentially named parseCollectionConfig(configString), which takes a collection configuration string as input and returns a properly formatted peer.CollectionConfigPackage structure. The function should be capable of parsing a variety of string formats, such as JSON, and handle common collection configuration parameters (e.g., name, policy, requiredPeerCount, etc.).
Is your proposal related to a problem?
Currently, defining collections within chaincode requires manually constructing the
peer.CollectionConfigPackage
structure, which can be cumbersome and error-prone. This issue proposes the creation of a high-level API function that simplifies this process by accepting a collection configuration string and automatically converting it into the required format forChaincodeDefinition.Collections
.(Write your answer here.)
Describe the solution you'd like
Introduce a new function, potentially named
parseCollectionConfig(configString)
, which takes a collection configuration string as input and returns a properly formattedpeer.CollectionConfigPackage
structure. The function should be capable of parsing a variety of string formats, such as JSON, and handle common collection configuration parameters (e.g., name, policy, requiredPeerCount, etc.).Describe alternatives you've considered
(Write your answer here.)
Additional context
(Write your answer here.)