<commit_before>Private Data
============

.. note:: This topic assumes an understand of the conceptual material in the
          `documentation on private data <private-data/private-data.html>`_.

Private data collection definition
----------------------------------

A collection definition contains one or more collections, each having a policy
definition listing the organizations in the collection, as well as properties
used to control endorsement and, optionally, whether the data will be purged.

The collection definition gets deployed to the channel at the time of chaincode
instantiation. If using the peer CLI to instantiate the chaincode, the
collection definition file is passed to the chaincode instantiation
using the ``--collections-config`` flag. If using a client SDK, check the `SDK
documentation <https://fabric-sdk-node.github.io/>`_ for information on providing the collection
definition.

Collection definitions are composed of five properties:

* ``name``: Name of the collection.

* ``policy``: Defines the organization peers allowed to persist the collection
  data expressed using the ``Signature`` policy syntax, with each member being
  included in an ``OR`` signature policy list.

* ``requiredPeerCount``: Minimum number of peers that the endorsing peer must
  successfully disseminate private data to before the peer signs the
  endorsement and returns the proposal response back to the client. When
  ``requiredPeerCount`` is ``0``, it means that no distribution is **required**,
  but there may be some distribution if ``maxPeerCount`` is greater than zero. A
  ``requiredPeerCount`` of ``0`` would typically not be recommended, as it could
  lead to loss of private data. Typically you would want to require at least some
  distribution of the private data at endorsement time to ensure redundancy of the
  private data on multiple peers in the network.

* ``maxPeerCount``: For data redundancy purposes, the number of other peers<commit_msg>[FAB-12454] Document collection policy details<commit_after>Private Data
============

.. note:: This topic assumes an understand of the conceptual material in the
          `documentation on private data <private-data/private-data.html>`_.

Private data collection definition
----------------------------------

A collection definition contains one or more collections, each having a policy
definition listing the organizations in the collection, as well as properties
used to control endorsement and, optionally, whether the data will be purged.

The collection definition gets deployed to the channel at the time of chaincode
instantiation. If using the peer CLI to instantiate the chaincode, the
collection definition file is passed to the chaincode instantiation
using the ``--collections-config`` flag. If using a client SDK, check the `SDK
documentation <https://fabric-sdk-node.github.io/>`_ for information on providing the collection
definition.

Collection definitions are composed of five properties:

* ``name``: Name of the collection.

* ``policy``: The private data collection distribution policy defines which
  organizations' peers are allowed to persist the collection data expressed using
  the ``Signature`` policy syntax, with each member being included in an ``OR``
  signature policy list. To support read/write transactions, the private data
  distribution policy must define a broader set of organizations than the chaincode
  endorsement policy, as peers must have the private data in order to endorse
  proposed transactions. For example, in a channel with ten organizations,
  five of the organizations might be included in a private data collection
  distribution policy, but the endorsement policy might call for any three
  of the organizations to endorse.

* ``requiredPeerCount``: Minimum number of peers that the endorsing peer must
  successfully disseminate private data to before the peer signs the
  endorsement and returns the proposal response back to the client. When
  ``requiredPeerCount`` is ``0``, it means that no distribution is **required**,
  but there may be some distribution if ``maxPeerCount`` is greater than zero. A
  ``requiredPeerCount`` of ``0`` would typically not be recommended, as it could
  lead to loss of private data. Typically you would want to require at least some
  distribution of the private data at endorsement time to ensure redundancy of the
  private data on multiple peers in the network.

* ``maxPeerCount``: For data redundancy purposes, the number of other peers
{'fraction_non_alphanumeric': 0.07300884955752213, 'fraction_numerical': 0.001991150442477876, 'mean_word_length': 4.394988066825776, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2115920', 'n_tokens_mistral': 1023, 'n_tokens_neox': 980, 'n_words': 606}