在Hyperledger Fabric上创建频道时出错

时间:2018-10-21 19:04:42

标签: hyperledger-fabric hyperledger

我对网络有一个简单的配置。 1个单人订购组织,1个有2个同行的组织。

我正在按照以下步骤创建频道:

  • 生成证书-> crypto-config文件夹
  • 生成Genesis Block和频道tx。
  • 启动订单器
  • 使用下面的证书对频道tx签名:peerInfo/$ORG_NAME.com/users/Admin@$ORG_NAME.com/msp
  • 创建频道

我在最后一步遇到此错误:

  

错误:状态发生意外:已禁止-无法隐式到达   1个子策略的阈值,需要剩余1个:权限被拒绝

所以看来通道tx的签名不正确,但是我尝试了不同的方法,但无法解决。

有什么想法吗?

以下是配置文件:

configtx.yaml

################################################################################
#
#   Section: Organizations
#
#   - This section defines the different organizational identities which will
#   be referenced later in the configuration.
#
################################################################################
Organizations:

    - &OrdererOrg

        Name: Orderer
        ID: OrdererMSP
        MSPDir: ordererInfo/eb.com/msp

        Policies:
            Readers:
                Type: Signature
                Rule: "OR('OrdererMSP.member')"
            Writers:
                Type: Signature
                Rule: "OR('OrdererMSP.member')"
            Admins:
                Type: Signature
                Rule: "OR('OrdererMSP.admin')"

    - &EB

        Name: EB
        ID: EBMSP
        MSPDir: peerInfo/eb.com/msp

        Policies:
            Readers:
                Type: Signature
                Rule: "OR('EBMSP.admin', 'EBMSP.peer', 'EBMSP.client')"
            Writers:
                Type: Signature
                Rule: "OR('EBMSP.admin', 'EBMSP.client')"
            Admins:
                Type: Signature
                Rule: "OR('EBMSP.admin')"

        AnchorPeers:
            - Host: peer0.eb.com
              Port: 7051


################################################################################
#
#   SECTION: 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
        # V1.3 for Channel is a catchall flag for behavior which has been
        # determined to be desired for all orderers and peers running at the v1.3.x
        # level, but which would be incompatible with orderers and peers from
        # prior releases.
        # Prior to enabling V1.3 channel capabilities, ensure that all
        # orderers and peers on a channel are at v1.3.0 or later.
        V1_3: 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 V1.1 orderer capabilities, ensure that all
        # orderers on a channel are at v1.1.0 or later.
        V1_1: 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
        # V1.3 for Application enables the new non-backwards compatible
        # features and fixes of fabric v1.3.
        V1_3: true
        # V1.2 for Application enables the new non-backwards compatible
        # features and fixes of fabric v1.2 (note, this need not be set if
        # later version capabilities are set)
        V1_2: false
        # V1.1 for Application enables the new non-backwards compatible
        # features and fixes of fabric v1.1 (note, this need not be set if
        # later version capabilities are set).
        V1_1: false

################################################################################
#
#   SECTION: Application
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for application related parameters
#
################################################################################
Application: &ApplicationDefaults

    # Organizations is the list of orgs which are defined as participants on
    # the application side of the network
    Organizations:

    # Policies defines the set of policies at this level of the config tree
    # For Application policies, their canonical path is
    #   /Channel/Application/<PolicyName>
    Policies:
        Readers:
            Type: ImplicitMeta
            Rule: "ANY Readers"
        Writers:
            Type: ImplicitMeta
            Rule: "ANY Writers"
        Admins:
            Type: ImplicitMeta
            Rule: "MAJORITY Admins"

################################################################################
#
#   SECTION: Orderer
#
#   - This section defines the values to encode into a config transaction or
#   genesis block for orderer related parameters
#
################################################################################
Orderer: &OrdererDefaults


    OrdererType: solo
    Addresses:
        - orderer.eb.com:7050

    # Batch Timeout: The amount of time to wait before creating a batch
    BatchTimeout: 2s

    # Batch Size: Controls the number of messages batched into a block
    BatchSize:

        # Max Message Count: The maximum number of messages to permit in a batch
        MaxMessageCount: 10

        # Absolute Max Bytes: The absolute maximum number of bytes allowed for
        # the serialized messages in a batch.
        AbsoluteMaxBytes: 99 MB

        # Preferred Max Bytes: The preferred maximum number of bytes allowed for
        # the serialized messages in a batch. A message larger than the preferred
        # max bytes will result in a batch larger than preferred max bytes.
        PreferredMaxBytes: 512 KB

    Kafka:
        # Brokers: A list of Kafka brokers to which the orderer connects
        # NOTE: Use IP:port notation
        Brokers:
            - 127.0.0.1:9092

    Policies:
        Readers:
            Type: ImplicitMeta
            Rule: "ANY Readers"
        Writers:
            Type: ImplicitMeta
            Rule: "ANY Writers"
        Admins:
            Type: ImplicitMeta
            Rule: "MAJORITY Admins"
        # BlockValidation specifies what signatures must be included in the block
        # from the orderer for the peer to validate it.
        BlockValidation:
            Type: ImplicitMeta
            Rule: "ANY Writers"

################################################################################
#
#   CHANNEL
#
#   This section defines the values to encode into a config transaction or
#   genesis block for channel related parameters.
#
################################################################################
Channel: &ChannelDefaults
    # Policies defines the set of policies at this level of the config tree
    # For Channel policies, their canonical path is
    #   /Channel/<PolicyName>
    Policies:
        # Who may invoke the 'Deliver' API
        Readers:
            Type: ImplicitMeta
            Rule: "ANY Readers"
        # Who may invoke the 'Broadcast' API
        Writers:
            Type: ImplicitMeta
            Rule: "ANY Writers"
        # By default, who may modify elements at this config level
        Admins:
            Type: ImplicitMeta
            Rule: "MAJORITY Admins"

    # Capabilities describes the channel level capabilities, see the
    # dedicated Capabilities section elsewhere in this file for a full
    # description
    Capabilities:
        <<: *ChannelCapabilities

################################################################################
#
#   Profile
#
#   - Different configuration profiles may be encoded here to be specified
#   as parameters to the configtxgen tool
#
################################################################################
Profiles:

    GenesisProfile:
        <<: *ChannelDefaults
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *EB
    ChannelProfile:
        Consortium: SampleConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                - *EB
            Capabilities:
                <<: *ApplicationCapabilities

crypto-config.yaml

# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

# ---------------------------------------------------------------------------
# "OrdererOrgs" - Definition of organizations managing orderer nodes
# ---------------------------------------------------------------------------
OrdererOrgs:
  # ---------------------------------------------------------------------------
  # Orderer
  # ---------------------------------------------------------------------------
  - Name: Orderer
    Domain: eb.com

    Specs:
      - Hostname: orderer1

# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
  # ---------------------------------------------------------------------------
  # Org1
  # ---------------------------------------------------------------------------
  - Name: EB
    Domain: eb.com
    EnableNodeOUs: true

    Template:
      Count: 2
    Users:
      Count: 0

orderer.yaml

################################################################################
#
#   Orderer Configuration
#
################################################################################
General:

    # Genesis Block Method = Provisional then GenesisProfile need to be specified 
    # GenesisMethod: provisional
    # GenesisProfile: AcmeOrdererGenesis

    # Genesis Block Method = file then GenesisFile need to be specified 
    # The genesis block file need to be generated using the configtxgen tool
    GenesisMethod: file
    GenesisFile: ./channel-artifacts/genesis.block


    # Ledger Type can be ram, json or file
    LedgerType: file

    # BCCSP Setup
    BCCSP:
        # Setup to use the Software CSP
        Default: SW
        SW:
            HASH: SHA2
            Security: 256
            # Using the default 'LocalMSPDir/keystore'
            FileKeyStore:
                Keystore:

    # Directory for the private crypto material needed by the
    # orderer. 
    LocalMSPDir: ./ordererInfo/eb.com/orderers/orderer1.eb.com/msp

    # Identity to register the local MSP material with the MSP
    LocalMSPID: OrdererMSP

    # Listen address: The IP on which to bind to listen.
    ListenAddress: 127.0.0.1

    # Listen port: The port on which to bind to listen.
    ListenPort: 7050

    # Keepalive settings for the GRPC server.
    Keepalive:
        # Disconnect the client if the time between pings is less than the specified time
        ServerMinInterval: 60s
        # Server pings the clients on open connection with the specified time between pings
        ServerInterval: 7200s
        # Server expects the clients to respond to pings. Server disconnets if response not receieved within timeout
        ServerTimeout: 20s

    # TLS: TLS settings for the GRPC server.
    TLS:
        Enabled: false
        PrivateKey: ./server.key
        Certificate: ./server.crt
        RootCAs:
          - ./ca.crt
        ClientAuthRequired: false
        ClientRootCAs:



    # Log Level: The level at which to log. This accepts logging specifications
    # per: fabric/docs/Setup/logging-control.md
    LogLevel: info

    # Log Format:  The format string to use when logging.  Especially useful to disable color logging
    LogFormat: '%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}'


################################################################################
#
#   SECTION: File Ledger
#   - This section applies to the configuration of the file or json ledgers.
################################################################################
FileLedger:

    # Location: The directory to store the blocks in.
    # Windows - if you get a LevelDb error in launching orderer use the VM file 
    # by uncommenting the following line - comment the Location: ./ledger 
    #Location: /home/vagrant/ledgers/orderer/simple-two-orgs/ledger
    Location: /Users/emilio.marin/Desktop/Fabric/HL_Fabric/MultiOrg/ledger

    # The prefix to use when generating a ledger directory in temporary space.
    Prefix: hyperledger-fabric-ordererledger    

################################################################################
#
#   Debug Configuration
#
#   - This controls the debugging options for the orderer
#
################################################################################
Debug:

    # BroadcastTraceDir when set will cause each request to the Broadcast service
    # for this orderer to be written to a file in this directory
    BroadcastTraceDir: ./trace

    # DeliverTraceDir when set will cause each request to the Deliver service
    # for this orderer to be written to a file in this directory
    DeliverTraceDir: ./trace

0 个答案:

没有答案