Hyperledger Fabric 2.5.4开发之“定义功能需求”问题
  iwbGD3gmtxyT 2023年11月02日 55 0

说明


本文描述了一个不再使用“系统通道”的网络(以前该通道由排序服务引导,并且由排序服务专门控制)。自Fabric v2.3发布以来,在创建通道的过程方法中,使用系统通道现在被视为遗留方案。


在通道配置(在通道的最新配置区块中找到)中,可以为每个通道定义功能需求。通道配置包含三个位置,每个位置定义了不同类型的功能。

功能类型

规范路径

JSON路径

Channel

/Channel/Capabilities

.channel_group.values.Capabilities

Orderer

/Channel/Orderer/Capabilities

.channel_group.groups.Orderer.values.Capabilities

Application

/Channel/Application/Capabilities

.channel_group.groups.Application.values. Capabilities

功能设置

功能设置是通道配置的一部分(要么作为初始配置,要么作为重新配置的一部分)。

有关如何更新通道配置的更多信息,请查看更新通道配置

初始配置中的功能

在最新下载安装的Fabric(V2.5.4)的目录fabric-samples中的config子目录下的 configtx.yaml 文件中,有一个 Capabilities 部分,列举了每种功能类型(通道、排序节点和应用程序)的可能功能。


Capabilities:

    # Channel capabilities apply to both the orderers and the peers and must be

    # supported by both.

    # Set the value of the capability to true to require it.

    Channel: &ChannelCapabilities

        # V2.0 for Channel is a catchall flag for behavior which has been

        # determined to be desired for all orderers and peers running at the v2.0.0

        # level, but which would be incompatible with orderers and peers from

        # prior releases.

        # Prior to enabling V2.0 channel capabilities, ensure that all

        # orderers and peers on a channel are at v2.0.0 or later.

        V2_0: true


    # Orderer capabilities apply only to the orderers, and may be safely

    # used with prior release peers.

    # Set the value of the capability to true to require it.

    Orderer: &OrdererCapabilities

        # V1.1 for Orderer is a catchall flag for behavior which has been

        # determined to be desired for all orderers running at the v1.1.x

        # level, but which would be incompatible with orderers from prior releases.

        # Prior to enabling V2.0 orderer capabilities, ensure that all

        # orderers on a channel are at v2.0.0 or later.

        V2_0: true


    # Application capabilities apply only to the peer network, and may be safely

    # used with prior release orderers.

    # Set the value of the capability to true to require it.

    Application: &ApplicationCapabilities

        # V2.5 for Application enables the new non-backwards compatible

        # features of fabric v2.5, namely the ability to purge private data.

        # Prior to enabling V2.5 application capabilities, ensure that all

        # peers on a channel are at v2.5.0 or later.

        V2_5: true


请注意, Capabilities 在根级别(用于通道功能)和 Orderer 级别(用于排序节点功能)各有一个定义部分。上边的示例使用 YAML 引用了在 YAML 文件底部定义的功能。


定义排序服务通道的时候没有 Application 部分,它在创建应用通道的时候会被创建。


这里,Application 部分有一个新元素 Capabilities,引用了 YAML 最后部分的 ApplicationCapabilities


参考


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

iwbGD3gmtxyT