I am trying to create private data on Fabric version 1.2.0.
I have created the collections configuration file for storing private data.
[
{
"name": "collectionData",
"policy": "OR('Org1MSP.member','Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 3,
"blockToLive":1000000,
"memberOnlyRead": true
}
]
I have instantiated the chaincode using --collections-config
flag.I have provided the configuration file correctly and successfully created the network.
I have developed the chaincode using nodejs.
console.log("************************************");
console.log("Private Data Testing");
let sample = "test";
await stub.putPrivateData("collectionData",transactionId,sample.toString());
let response = await stub.getPrivateData("collectionData",transactionId);
console.log("Response",response.toString());
I am doing the operations on behalf of Org1MSP
.But I didn't get any response.It returns null while fetching the private details.
Could someone help me to resolve the issue?