Details
-
Story
-
Status: Closed
-
Medium
-
Resolution: Done
-
None
-
None
-
Unset
-
Unset
Description
Gerrit CR https://gerrit.hyperledger.org/r/#/c/22091/
Java SDK - Pass private data collection definitions during chaincode instantiation.
When using CLI, this is done by passing a JSON file which includes collection definition:
--collections-config collections.json
Where a sample JSON file content is:
[
{
"name": "collectionMarbles",
"policy": "OR('Org1MSP.member', 'Org2MSP.member')",
"requiredPeerCount": 1,
"maxPeerCount": 2,
"blockToLive":1000000
},
{
"name": "collectionMarblePrivateDetails",
"policy": "OR('Org1MSP.member')",
"requiredPeerCount": 1,
"maxPeerCount": 1,
"blockToLive":3
}
]
CLI passes collection config upon chaincode instantiate, see: https://gerrit.hyperledger.org/r/#/c/14371/
In CLI, collection JSON is converted to CollectionConfigPackage proto:
https://github.com/hyperledger/fabric/blob/release-1.1/protos/common/collection.proto#L16-L50
and then marshaled and passed to LSCC as an argument.
LSCC accepts collection config as an argument and stores it, see: https://gerrit.hyperledger.org/r/#/c/14291/