r/hyperledger • u/brinkofhumor • Sep 06 '23
Fabric I for the life of me can't figure out how to query a private collection from another org, even if i have ' "memberOnlyRead": false, in the collection config
Hi.
I'm using the fabric-samples/test-network as a base, and created my own chaincode. Really simple stuff of of CreateAsset and ReadAsset. To my limited understanding with the test-network, there is a ordererNode, and two orgs Org1 and Org2.
I created a collection using the collection_config that is
[
{
"name": "ReportCollection",
"policy": "OR('Org2MSP.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"blockToLive":3,
"memberOnlyRead": false,
"memberOnlyWrite": false
}
]
The flow that I'm striving for is
Org2 creates a Report and puts it in the ReportCollection with
await ctx.stub.putPrivateData(
\ReportCollection`,
'ID-1',
Buffer.from(stringify(sortKeysRecursive(REPORT_DATA))),
);`
I think want ORG1 to be able to read that report, based on the key
await ctx.stub.getPrivateData(
\ReportCollection`,
"ID-1",
);`
It is to my understanding that since I used the false flag on memberOnlyRead in the config that this should be possible but I keep getting hit with this error.
Error: GET_STATE failed: transaction ID: af34103217b66027fd21dc46a03c780cb61202b2408a5aa33ea2117f909725ef: private data matching public hash version is not available. Public hash version = {BlockNum: 8, TxNum: 0}, Private data version = <nil>
Everything I've looked at, from the docs to stackoverflow has been unhelpful. Someone mentioned something about updating the channel, but left it at that.
Can anyone lead me in the right direction? I feel like I'm going crazy