|
| 1 | +// Copyright the Hyperledger Fabric contributors. All rights reserved. |
| 2 | +// |
| 3 | +// SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +syntax = "proto3"; |
| 6 | + |
| 7 | +option go_package = "github.com/hyperledger/fabric-protos-go/peer"; |
| 8 | +option java_package = "org.hyperledger.fabric.protos.peer"; |
| 9 | + |
| 10 | +package protos; |
| 11 | + |
| 12 | +import "common/policies.proto"; |
| 13 | +import "peer/policy.proto"; |
| 14 | + |
| 15 | +// CollectionConfigPackage represents an array of CollectionConfig |
| 16 | +// messages; the extra struct is required because repeated oneof is |
| 17 | +// forbidden by the protobuf syntax |
| 18 | +message CollectionConfigPackage { |
| 19 | + repeated CollectionConfig config = 1; |
| 20 | +} |
| 21 | + |
| 22 | +// CollectionConfig defines the configuration of a collection object; |
| 23 | +// it currently contains a single, static type. |
| 24 | +// Dynamic collections are deferred. |
| 25 | +message CollectionConfig { |
| 26 | + oneof payload { |
| 27 | + StaticCollectionConfig static_collection_config = 1; |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | + |
| 32 | +// StaticCollectionConfig constitutes the configuration parameters of a |
| 33 | +// static collection object. Static collections are collections that are |
| 34 | +// known at chaincode instantiation time, and that cannot be changed. |
| 35 | +// Dynamic collections are deferred. |
| 36 | +message StaticCollectionConfig { |
| 37 | + // the name of the collection inside the denoted chaincode |
| 38 | + string name = 1; |
| 39 | + // a reference to a policy residing / managed in the config block |
| 40 | + // to define which orgs have access to this collection’s private data |
| 41 | + CollectionPolicyConfig member_orgs_policy = 2; |
| 42 | + // The minimum number of peers private data will be sent to upon |
| 43 | + // endorsement. The endorsement would fail if dissemination to at least |
| 44 | + // this number of peers is not achieved. |
| 45 | + int32 required_peer_count = 3; |
| 46 | + // The maximum number of peers that private data will be sent to |
| 47 | + // upon endorsement. This number has to be bigger than required_peer_count. |
| 48 | + int32 maximum_peer_count = 4; |
| 49 | + // The number of blocks after which the collection data expires. |
| 50 | + // For instance if the value is set to 10, a key last modified by block number 100 |
| 51 | + // will be purged at block number 111. A zero value is treated same as MaxUint64 |
| 52 | + uint64 block_to_live = 5; |
| 53 | + // The member only read access denotes whether only collection member clients |
| 54 | + // can read the private data (if set to true), or even non members can |
| 55 | + // read the data (if set to false, for example if you want to implement more granular |
| 56 | + // access logic in the chaincode) |
| 57 | + bool member_only_read = 6; |
| 58 | + // The member only write access denotes whether only collection member clients |
| 59 | + // can write the private data (if set to true), or even non members can |
| 60 | + // write the data (if set to false, for example if you want to implement more granular |
| 61 | + // access logic in the chaincode) |
| 62 | + bool member_only_write = 7; |
| 63 | + // a reference to a policy residing / managed in the config block |
| 64 | + // to define the endorsement policy for this collection |
| 65 | + ApplicationPolicy endorsement_policy= 8; |
| 66 | +} |
| 67 | + |
| 68 | + |
| 69 | +// Collection policy configuration. Initially, the configuration can only |
| 70 | +// contain a SignaturePolicy. In the future, the SignaturePolicy may be a |
| 71 | +// more general Policy. Instead of containing the actual policy, the |
| 72 | +// configuration may in the future contain a string reference to a policy. |
| 73 | +message CollectionPolicyConfig { |
| 74 | + oneof payload { |
| 75 | + // Initially, only a signature policy is supported. |
| 76 | + common.SignaturePolicyEnvelope signature_policy = 1; |
| 77 | + // Later, the SignaturePolicy will be replaced by a Policy. |
| 78 | + // Policy policy = 1; |
| 79 | + // A reference to a Policy is planned to be added later. |
| 80 | +// string reference = 2; |
| 81 | + } |
| 82 | +} |
0 commit comments