Skip to content

Commit

Permalink
Correct the private data collection information
Browse files Browse the repository at this point in the history
For the asset transfer example (https://hyperledger-fabric.readthedocs.io/en/release-2.5/private_data_tutorial.html#pd-use-case)
the are three private data collections, one per org and one shared between the orgs.

The shared collection didn't have an endorsement policy so inheritted the chaincodes; this was specifically set away from the default
to be OR(Org1MSP,Org2MSP).   The documentation says this is to ensure that either organization can create and asset.

However this isn't really necassary, the endorsement policy should be lowest level; so this PR moves the endorsement policy to
the collection.  The documentation does I believe lead to a false understanding

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
  • Loading branch information
mbwhite authored and denyeart committed Mar 22, 2023
1 parent 75b8419 commit 67ae2c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Expand Up @@ -6,7 +6,10 @@
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": true,
"memberOnlyWrite": true
"memberOnlyWrite": true,
"endorsementPolicy": {
"signaturePolicy":"OR('Org1MSP.member','Org2MSP.member')"
}
},
{
"name": "Org1MSPPrivateCollection",
Expand Down
Expand Up @@ -6,7 +6,10 @@
"maxPeerCount": 1,
"blockToLive":1000000,
"memberOnlyRead": true,
"memberOnlyWrite": true
"memberOnlyWrite": true,
"endorsementPolicy": {
"signaturePolicy":"OR('Org1MSP.member','Org2MSP.member')"
}
},
{
"name": "Org1MSPPrivateCollection",
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/run-test-network-private.sh
Expand Up @@ -15,7 +15,7 @@ function createNetwork() {
print "Creating network"
./network.sh up createChannel -ca -s couchdb
print "Deploying ${CHAINCODE_NAME} chaincode"
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
}

function stopNetwork() {
Expand Down

0 comments on commit 67ae2c9

Please sign in to comment.