Warm tip: This article is reproduced from serverfault.com, please click

hyperledger fabric-创建频道失败,无法生成锚点对等更新事务

(hyperledger fabric - Create Channel fails with failure to generate anchor peer update transaction)

发布于 2020-12-06 15:42:17

我正在尝试创建一个由4个组织组成的网络,并将每个组织加入一个渠道。但是,我遇到了createChannel的问题,特别是在尝试为我添加的其他2个组织生成锚点对等更新事务时。

这是我得到的错误。它说名称为Org3MSP的组织在配置中不存在。

以下是我的configtx.yaml,其中定义了Org3MSP。我还需要添加其他内容来更新配置文件吗?

Organizations:

# SampleOrg defines an MSP using the sampleconfig.  It should never be used
# in production but may be used as a template for other definitions
- &OrdererOrg
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: OrdererOrg

    # ID to load the MSP definition as
    ID: OrdererMSP

    # MSPDir is the filesystem path which contains the MSP configuration
    MSPDir: ../organizations/ordererOrganizations/example.com/msp

    # Policies defines the set of policies at this level of the config tree
    # For organization policies, their canonical path is usually
    #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
    Policies:
        Readers:
            Type: Signature
            Rule: "OR('OrdererMSP.member')"
        Writers:
            Type: Signature
            Rule: "OR('OrdererMSP.member')"
        Admins:
            Type: Signature
            Rule: "OR('OrdererMSP.admin')"

    OrdererEndpoints:
        - orderer.example.com:7050

- &Org1
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org1MSP

    # ID to load the MSP definition as
    ID: Org1MSP

    MSPDir: ../organizations/peerOrganizations/org1.example.com/msp

    # Policies defines the set of policies at this level of the config tree
    # For organization policies, their canonical path is usually
    #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org1MSP.admin', 'Org1MSP.peer', 'Org1MSP.client')"
        Writers:
            Type: Signature
            Rule: "OR('Org1MSP.admin', 'Org1MSP.client')"
        Admins:
            Type: Signature
            Rule: "OR('Org1MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org1MSP.peer')"

    # leave this flag set to true.
    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org1.example.com
          Port: 7051

- &Org2
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org2MSP

    # ID to load the MSP definition as
    ID: Org2MSP

    MSPDir: ../organizations/peerOrganizations/org2.example.com/msp

    # Policies defines the set of policies at this level of the config tree
    # For organization policies, their canonical path is usually
    #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org2MSP.admin', 'Org2MSP.peer', 'Org2MSP.client')"
        Writers:
            Type: Signature
            Rule: "OR('Org2MSP.admin', 'Org2MSP.client')"
        Admins:
            Type: Signature
            Rule: "OR('Org2MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org2MSP.peer')"

    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org2.example.com
          Port: 9051

- &Org3
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org3MSP

    # ID to load the MSP definition as
    ID: Org3MSP

    MSPDir: ../organizations/peerOrganizations/org3.example.com/msp

    # Policies defines the set of policies at this level of the config tree
    # For organization policies, their canonical path is usually
    #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org3MSP.admin', 'Org3MSP.peer', 'Org3MSP.client')"
        Writers:
            Type: Signature
            Rule: "OR('Org3MSP.admin', 'Org3MSP.client')"
        Admins:
            Type: Signature
            Rule: "OR('Org3MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org3MSP.peer')"

    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org3.example.com
          Port: 11051

- &Org4
    # DefaultOrg defines the organization which is used in the sampleconfig
    # of the fabric.git development environment
    Name: Org4MSP

    # ID to load the MSP definition as
    ID: Org4MSP

    MSPDir: ../organizations/peerOrganizations/org4.example.com/msp

    # Policies defines the set of policies at this level of the config tree
    # For organization policies, their canonical path is usually
    #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
    Policies:
        Readers:
            Type: Signature
            Rule: "OR('Org4MSP.admin', 'Org4MSP.peer', 'Org4MSP.client')"
        Writers:
            Type: Signature
            Rule: "OR('Org4MSP.admin', 'Org4MSP.client')"
        Admins:
            Type: Signature
            Rule: "OR('Org4MSP.admin')"
        Endorsement:
            Type: Signature
            Rule: "OR('Org4MSP.peer')"

    AnchorPeers:
        # AnchorPeers defines the location of peers which can be used
        # for cross org gossip communication.  Note, this value is only
        # encoded in the genesis block in the Application section context
        - Host: peer0.org4.example.com
          Port: 13051

configtx.yaml中的FourOrgsChannel的配置文件如下:

Profiles:

FourOrgsOrdererGenesis:
    <<: *ChannelDefaults
    Orderer:
        <<: *OrdererDefaults
        Organizations:
            - *OrdererOrg
        Capabilities:
            <<: *OrdererCapabilities
    Consortiums:
        SampleConsortium:
            Organizations:
                - *Org1
                - *Org2
                - *Org4
                - *Org4

FourOrgsChannel:
    Consortium: SampleConsortium
    <<: *ChannelDefaults
    Application:
        <<: *ApplicationDefaults
        Organizations:
            - *Org1
            - *Org2
            - *Org4
            - *Org4
        Capabilities:
            <<: *ApplicationCapabilities

我正在运行的命令是./network.sh up createChannel,其输出如下: 在此处输入图片说明

在此处输入图片说明

Questioner
Jasmine Wong
Viewed
11
myeongkil kim 2020-12-07 10:39:16

我认为...只是拼写错误

    Consortiums:
        SampleConsortium:
            Organizations:
                - *Org1
                - *Org2
                - *Org4 -> Org3
                - *Org4

FourOrgsChannel:
    Consortium: SampleConsortium
    <<: *ChannelDefaults
    Application:
        <<: *ApplicationDefaults
        Organizations:
            - *Org1
            - *Org2
            - *Org4 -> Org3
            - *Org4