github.com/kaituanwang/hyperledger@v2.0.1+incompatible/docs/source/whatsnew.rst (about) 1 What's new in Hyperledger Fabric v2.0 2 ===================================== 3 4 The first Hyperledger Fabric major release since v1.0, Fabric v2.0 5 delivers important new features and changes for users and operators alike, 6 including support for new application and privacy patterns, enhanced 7 governance around smart contracts, and new options for operating nodes. 8 9 What has stayed the same is the ability to upgrade network components on 10 your own terms, with support for rolling upgrades from v1.4.x, and the ability 11 to enable the new capabilities only when member organizations are ready. 12 13 Let's take a look at some of the highlights of the Fabric v2.0 release... 14 15 Decentralized governance for smart contracts 16 -------------------------------------------- 17 18 Fabric v2.0 introduces decentralized governance for smart contracts, with a new 19 process for installing a chaincode on your peers and starting it on a channel. 20 The new Fabric chaincode lifecycle allows multiple organizations to come to 21 agreement on the parameters of a chaincode, such as the chaincode endorsement 22 policy, before it can be used to interact with the ledger. The new model 23 offers several improvements over the previous lifecycle: 24 25 * **Multiple organizations must agree to the parameters of a chaincode** 26 In the release 1.x versions of Fabric, one organization had the ability to 27 set parameters of a chaincode (for instance the endorsement policy) for all 28 other channel members, who only had the power to refuse to install the chaincode 29 and therefore not take part in transactions invoking it. The new Fabric 30 chaincode lifecycle is more flexible since it supports both centralized 31 trust models (such as that of the previous lifecycle model) as well as 32 decentralized models requiring a sufficient number of organizations to 33 agree on an endorsement policy and other details before the chaincode 34 becomes active on a channel. 35 36 * **More deliberate chaincode upgrade process** In the previous chaincode 37 lifecycle, the upgrade transaction could be issued by a single organization, 38 creating a risk for a channel member that had not yet installed the new 39 chaincode. The new model allows for a chaincode to be upgraded only after 40 a sufficient number of organizations have approved the upgrade. 41 42 * **Simpler endorsement policy and private data collection updates** 43 Fabric lifecycle allows you to change an endorsement policy or private 44 data collection configuration without having to repackage or reinstall 45 the chaincode. Users can also take advantage of a new default endorsement 46 policy that requires endorsement from a majority of organizations on the 47 channel. This policy is updated automatically when organizations are 48 added or removed from the channel. 49 50 * **Inspectable chaincode packages** The Fabric lifecycle packages chaincode 51 in easily readable tar files. This makes it easier to inspect the chaincode 52 package and coordinate installation across multiple organizations. 53 54 * **Start multiple chaincodes on a channel using one package** The previous 55 lifecycle defined each chaincode on the channel using a name and version 56 that was specified when the chaincode package was installed. You can now 57 use a single chaincode package and deploy it multiple times with different 58 names on the same channel or on different channels. For example, if you’d 59 like to track different types of assets in their own ‘copy’ of the chaincode. 60 61 * **Chaincode packages do not need to be identical across channel members** 62 Organizations can extend a chaincode for their own use case, for example 63 to perform different validations in the interest of their organization. 64 As long as the required number of organizations endorse chaincode transactions 65 with matching results, the transaction will be validated and committed to the 66 ledger. This also allows organizations to individually roll out minor fixes 67 on their own schedules without requiring the entire network to proceed in lock-step. 68 69 Using the new chaincode lifecycle 70 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 71 72 For existing Fabric deployments, you can continue to use the prior chaincode 73 lifecycle with Fabric v2.0. The new chaincode lifecycle will become effective 74 only when the channel application capability is updated to v2.0. 75 See the :doc:`chaincode4noah` tutorial for complete details of the new 76 chaincode lifecycle. 77 78 New chaincode application patterns for collaboration and consensus 79 ------------------------------------------------------------------ 80 81 The same decentralized methods of coming to agreement that underpin the 82 new chaincode lifecycle management can also be used in your own chaincode 83 applications to ensure organizations consent to data transactions before 84 they are committed to the ledger. 85 86 * **Automated checks** As mentioned above, organizations can add automated 87 checks to chaincode functions to validate additional information before 88 endorsing a transaction proposal. 89 90 * **Decentralized agreement** Human decisions can be modeled into a chaincode process 91 that spans multiple transactions. The chaincode may require actors from 92 various organizations to indicate their terms and conditions of agreement 93 in a ledger transaction. Then, a final chaincode proposal can 94 verify that the conditions from all the individual transactors are met, 95 and "settle" the business transaction with finality across all channel 96 members. For a concrete example of indicating terms and conditions in private, 97 see the asset transfer scenario in the :doc:`private-data/private-data` documentation. 98 99 Private data enhancements 100 ------------------------- 101 102 Fabric v2.0 also enables new patterns for working with and sharing private data, 103 without the requirement of creating private data collections for all 104 combinations of channel members that may want to transact. Specifically, 105 instead of sharing private data within a collection of multiple members, 106 you may want to share private data across collections, where each collection 107 may include a single organization, or perhaps a single organization along 108 with a regulator or auditor. 109 110 Several enhancements in Fabric v2.0 make these new private data patterns possible: 111 112 * **Sharing and verifying private data** When private data is shared with a 113 channel member who is not a member of a collection, or shared with another 114 private data collection that contains one or more channel members (by writing 115 a key to that collection), the receiving parties can utilize the 116 GetPrivateDataHash() chaincode API to verify that the private data matches the 117 on-chain hashes that were created from private data in previous transactions. 118 119 * **Collection-level endorsement policies** Private data collections can now 120 optionally be defined with an endorsement policy that overrides the 121 chaincode-level endorsement policy for keys within the collection. This 122 feature can be used to restrict which organizations can write data to a 123 collection, and is what enables the new chaincode lifecycle and chaincode 124 application patterns mentioned earlier. For example, you may have a chaincode 125 endorsement policy that requires a majority of organizations to endorse, 126 but for any given transaction, you may need two transacting organizations 127 to individually endorse their agreement in their own private data collections. 128 129 * **Implicit per-organization collections** If you’d like to utilize 130 per-organization private data patterns, you don’t even need to define the 131 collections when deploying chaincode in Fabric v2.0. Implicit 132 organization-specific collections can be used without any upfront definition. 133 134 To learn more about the new private data patterns, see the :doc:`private-data/private-data` (conceptual 135 documentation). For details about private data collection configuration and 136 implicit collections, see the :doc:`private-data-arch` (reference documentation). 137 138 External chaincode launcher 139 --------------------------- 140 141 The external chaincode launcher feature empowers operators to build and launch 142 chaincode with the technology of their choice. Use of external builders and launchers 143 is not required as the default behavior builds and runs chaincode in the same manner 144 as prior releases using the Docker API. 145 146 * **Eliminate Docker daemon dependency** Prior releases of Fabric required 147 peers to have access to a Docker daemon in order to build and launch 148 chaincode - something that may not be desirable in production environments 149 due to the privileges required by the peer process. 150 151 * **Alternatives to containers** Chaincode is no longer required to be run 152 in Docker containers, and may be executed in the operator’s choice of 153 environment (including containers). 154 155 * **External builder executables** An operator can provide a set of external 156 builder executables to override how the peer builds and launches chaincode. 157 158 * **Chaincode as an external service** Traditionally, chaincodes are launched 159 by the peer, and then connect back to the peer. It is now possible to run chaincode as 160 an external service, for example in a Kubernetes pod, which a peer can 161 connect to and utilize for chaincode execution. See :doc:`cc_service` for more 162 information. 163 164 See :doc:`cc_launcher` to learn more about the external chaincode launcher feature. 165 166 State database cache for improved performance on CouchDB 167 -------------------------------------------------------- 168 169 * When using external CouchDB state database, read delays during endorsement 170 and validation phases have historically been a performance bottleneck. 171 172 * With Fabric v2.0, a new peer cache replaces many of these expensive lookups 173 with fast local cache reads. The cache size can be configured by using the 174 core.yaml property ``cacheSize``. 175 176 Alpine-based docker images 177 -------------------------- 178 179 Starting with v2.0, Hyperledger Fabric Docker images will use Alpine Linux, 180 a security-oriented, lightweight Linux distribution. This means that Docker 181 images are now much smaller, providing faster download and startup times, 182 as well as taking up less disk space on host systems. Alpine Linux is designed 183 from the ground up with security in mind, and the minimalist nature of the Alpine 184 distribution greatly reduces the risk of security vulnerabilities. 185 186 Sample test network 187 ------------------- 188 189 The fabric-samples repository now includes a new Fabric test network. The test 190 network is built to be a modular and user friendly sample Fabric network that 191 makes it easy to test your applications and smart contracts. The network also 192 supports the ability to deploy your network using Certificate Authorities, 193 in addition to cryptogen. 194 195 For more information about this network, check out :doc:`test_network`. 196 197 Upgrading to Fabric v2.0 198 ------------------------ 199 200 A major new release brings some additional upgrade considerations. Rest assured 201 though, that rolling upgrades from v1.4.x to v2.0 are supported, so that network 202 components can be upgraded one at a time with no downtime. 203 204 The upgrade docs have been significantly expanded and reworked, and now have a 205 standalone home in the documentation: :doc:`upgrade`. Here you'll find documentation on 206 :doc:`upgrading_your_components` and :doc:`updating_capabilities`, as well as a 207 specific look at the considerations for upgrading to v2.0, :doc:`upgrade_to_newest_version`. 208 209 Release notes 210 ============= 211 212 The release notes provide more details for users moving to the new release. 213 Specifically, take a look at the changes and deprecations that are being 214 announced with the new Fabric v2.0 release. 215 216 * `Fabric v2.0.0 release notes <https://github.com/hyperledger/fabric/releases/tag/v2.0.0>`_. 217 * `Fabric v2.0.1 release notes <https://github.com/hyperledger/fabric/releases/tag/v2.0.1>`_. 218 219 .. Licensed under Creative Commons Attribution 4.0 International License 220 https://creativecommons.org/licenses/by/4.0/