github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/docs/source/capability_requirements.rst (about) 1 Defining capability requirements 2 ================================ 3 4 As discussed in :doc:`capabilities_concept`, capability requirements are defined 5 per channel in the channel configuration (found in the channel’s most recent 6 configuration block). The channel configuration contains three locations, each 7 of which defines a capability of a different type. 8 9 +------------------+-----------------------------------+----------------------------------------------------+ 10 | Capability Type | Canonical Path | JSON Path | 11 +==================+===================================+====================================================+ 12 | Channel | /Channel/Capabilities | .channel_group.values.Capabilities | 13 +------------------+-----------------------------------+----------------------------------------------------+ 14 | Orderer | /Channel/Orderer/Capabilities | .channel_group.groups.Orderer.values.Capabilities | 15 +------------------+-----------------------------------+----------------------------------------------------+ 16 | Application | /Channel/Application/Capabilities | .channel_group.groups.Application.values. | 17 | | | Capabilities | 18 +------------------+-----------------------------------+----------------------------------------------------+ 19 20 Setting Capabilities 21 -------------------- 22 23 Capabilities are set as part of the channel configuration (either as part of the 24 initial configuration -- which we'll talk about in a moment -- or as part of a 25 reconfiguration). 26 27 .. note:: For a tutorial that shows how to update a channel configuration, check 28 out :doc:`channel_update_tutorial`. For an overview of the different 29 kinds of channel updates that are possible, check out :doc:`config_update`. 30 31 Because new channels copy the configuration of the ordering system channel by 32 default, new channels will automatically be configured to work with the orderer 33 and channel capabilities of the ordering system channel and the application 34 capabilities specified by the channel creation transaction. Channels that already 35 exist, however, must be reconfigured. 36 37 The schema for the Capabilities value is defined in the protobuf as: 38 39 .. code:: bash 40 41 message Capabilities { 42 map<string, Capability> capabilities = 1; 43 } 44 45 message Capability { } 46 47 As an example, rendered in JSON: 48 49 .. code:: bash 50 51 { 52 "capabilities": { 53 "V1_1": {} 54 } 55 } 56 57 Capabilities in an Initial Configuration 58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 59 60 In the ``configtx.yaml`` file distributed in the ``config`` directory of the release 61 artifacts, there is a ``Capabilities`` section which enumerates the possible capabilities 62 for each capability type (Channel, Orderer, and Application). 63 64 The simplest way to enable capabilities is to pick a v1.1 sample profile and customize 65 it for your network. For example: 66 67 .. code:: bash 68 69 SampleSingleMSPRaftV1_1: 70 Capabilities: 71 <<: *GlobalCapabilities 72 Orderer: 73 <<: *OrdererDefaults 74 Organizations: 75 - *SampleOrg 76 Capabilities: 77 <<: *OrdererCapabilities 78 Consortiums: 79 SampleConsortium: 80 Organizations: 81 - *SampleOrg 82 83 Note that there is a ``Capabilities`` section defined at the root level (for the channel 84 capabilities), and at the Orderer level (for orderer capabilities). The sample above uses 85 a YAML reference to include the capabilities as defined at the bottom of the YAML. 86 87 When defining the orderer system channel there is no Application section, as those 88 capabilities are defined during the creation of an application channel. To define a new 89 channel's application capabilities at channel creation time, the application admins should 90 model their channel creation transaction after the ``SampleSingleMSPChannelV1_1`` profile. 91 92 .. code:: bash 93 94 SampleSingleMSPChannelV1_1: 95 Consortium: SampleConsortium 96 Application: 97 Organizations: 98 - *SampleOrg 99 Capabilities: 100 <<: *ApplicationCapabilities 101 102 Here, the Application section has a new element ``Capabilities`` which references the 103 ``ApplicationCapabilities`` section defined at the end of the YAML. 104 105 .. note:: The capabilities for the Channel and Orderer sections are inherited from 106 the definition in the ordering system channel and are automatically included 107 by the orderer during the process of channel creation. 108 109 .. Licensed under Creative Commons Attribution 4.0 International License 110 https://creativecommons.org/licenses/by/4.0/