Skip to content

Commit

Permalink
Merge pull request #591 from hyperledger-labs/release-2.0
Browse files Browse the repository at this point in the history
update master branch from release-2.0
  • Loading branch information
greatcyang committed Feb 28, 2020
2 parents 270e73d + 713fae0 commit 9cbd03a
Show file tree
Hide file tree
Showing 18 changed files with 771 additions and 1,636 deletions.
41 changes: 14 additions & 27 deletions docs/source/capability_requirements.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,36 @@
Defining capability requirements
定义功能需求
================================

As discussed in :doc:`capabilities_concept`, capability requirements are defined
per channel in the channel configuration (found in the channel’s most recent
configuration block). The channel configuration contains three locations, each
of which defines a capability of a different type.
如文档:doc:`capabilities_concept`中所述,在通道配置(在通道的最新配置区块中找到)中,为每个通道定义了功能需求。通道配置包含三个位置,每个位置定义了不同类型的功能。

+------------------+-----------------------------------+----------------------------------------------------+
| Capability Type | Canonical Path | JSON Path |
| 功能类型 | 规范路径 | JSON路径 |
+==================+===================================+====================================================+
| Channel | /Channel/Capabilities | .channel_group.values.Capabilities |
| 通道 | /Channel/Capabilities | .channel_group.values.Capabilities |
+------------------+-----------------------------------+----------------------------------------------------+
| Orderer | /Channel/Orderer/Capabilities | .channel_group.groups.Orderer.values.Capabilities |
| 排序服务 | /Channel/Orderer/Capabilities | .channel_group.groups.Orderer.values.Capabilities |
+------------------+-----------------------------------+----------------------------------------------------+
| Application | /Channel/Application/Capabilities | .channel_group.groups.Application.values. |
| 应用 | /Channel/Application/Capabilities | .channel_group.groups.Application.values. |
| | | Capabilities |
+------------------+-----------------------------------+----------------------------------------------------+

Setting Capabilities
功能设置
--------------------

Capabilities are set as part of the channel configuration (either as part of the
initial configuration -- which we'll talk about in a moment -- or as part of a
reconfiguration).
功能设置是通道配置的一部分(要么作为初始配置(稍后我们将讨论),要么作为重新配置的一部分)。

.. note:: For more information about how to update a channel configuration, check
.. note:: 有关如何更新通道配置的更多信息,请参阅
out :doc:`config_update`.

Because new channels copy the configuration of the ordering system channel by
default, new channels will automatically be configured to work with the orderer
and channel capabilities of the ordering system channel and the application
capabilities specified by the channel creation transaction.
由于新通道在默认情况下复制了orderer系统通道的配置,因此将自动配置新通道,使其与orderer系统通道的orderer和通道功能以及通道创建事务指定的应用程序功能一起工作。

Capabilities in an Initial Configuration
初始配置中的功能
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
在 ``config`` 目录分发的 ``configtx.yaml`` 文件中,有一个 ``Capabilities`` 部分,列举了每种功能类型(通道,orderer和应用程序)的可能功能。

In the ``configtx.yaml`` file distributed in the ``config`` directory of the release
artifacts, there is a ``Capabilities`` section which enumerates the possible capabilities
for each capability type (Channel, Orderer, and Application).
请注意, ``Capabilities`` 在根级别(用于通道功能)和orderer级别(用于orderer功能)各有一个定义部分。

Note that there is a ``Capabilities`` section defined at the root level (for the channel
capabilities), and at the Orderer level (for orderer capabilities).

When defining the orderer system channel there is no Application section, as those
capabilities are defined during the creation of an application channel.
定义orderer系统通道时,没有“应用程序”部分,因为这些功能是在创建应用程序通道时定义的。

.. Licensed under Creative Commons Attribution 4.0 International License
https://creativecommons.org/licenses/by/4.0/
38 changes: 15 additions & 23 deletions docs/source/chaincode.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
Chaincode Tutorials
链码教程
===================

What is Chaincode?
什么是链码?
------------------

Chaincode is a program, written in `Go <https://golang.org>`_, `node.js <https://nodejs.org>`_,
or `Java <https://java.com/en/>`_ that implements a prescribed interface.
Chaincode runs in a secured Docker container isolated from the endorsing peer
process. Chaincode initializes and manages ledger state through transactions
submitted by applications.
链码是一个程序,可以使用 `Go <https://golang.org>`_ 、`node.js <https://nodejs.org>`_ 、
或者 `Java <https://java.com/en/>`_ 来实现预定义的接口。链码运行在一个和背书节点进程相
隔离的安全的容器中。通过应用程序提交交易来初始化链码和管理账本状态。

A chaincode typically handles business logic agreed to by members of the
network, so it may be considered as a "smart contract". State created by a
chaincode is scoped exclusively to that chaincode and can't be accessed
directly by another chaincode. However, within the same network, given
the appropriate permission a chaincode may invoke another chaincode to
access its state.
一个链码一般用来处理由网络中成员一致认可的商业逻辑,所以可以认为它就是一个“智能合约”。
链码创建的状态仅限于该链码范围内,其他链码不能直接访问。但是在同一个网络中,通过合理
的授权,链码可以让其他链码访问的它状态数据。

Two Personas
两种角色
------------

We offer two different perspectives on chaincode. One, from the perspective of
an application developer developing a blockchain application/solution
entitled :doc:`chaincode4ade`, and the other, :doc:`chaincode4noah` oriented
to the blockchain network operator who is responsible for managing a blockchain
network, and who would leverage the Hyperledger Fabric API to install and govern
chaincode, but would likely not be involved in the development of a chaincode
application.
我们提供了从两种视角来看链码。第一中,从区块链应用或者解决方案开发这的视角的标题为
:doc:`chaincode4ade` 另外一个 :doc:`chaincode4noah` 面向管理区块链网络的维护人员,
他们将使用 Hyperledger Fabric 的 API 来安装、治理链码,但是在开发链码应用的
过程很少调用链码。

Fabric Chaincode Lifecycle
--------------------------
Fabric 链码生命周期
------------------------------

The Fabric Chaincode Lifecycle is responsible for managing the installation
of chaincodes and the definition of their parameters before a chaincode is
Expand Down

0 comments on commit 9cbd03a

Please sign in to comment.