Hyperledger Fabric多主机设置中的错误

时间:2018-10-23 09:58:41

标签: hyperledger-fabric hyperledger

我正在手动尝试使用通过结构证书颁发机构生成的加密材料创建超级账本结构多主机设置。我正在使用AWS服务器部署结构。为此,我做了以下步骤

1-在4台主机之间创建集群网络

2-通过使用fabric-ca-client调用fabric-ca-server在所有主机中生成加密材料。

3-在订购机中使用configtxgen工具生成创世块。这是configtxgen的配置文件

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: ../crypto-config/ordererOrganization/msp

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

        # ID to load the MSP definition as
        ID: NeduetDeanMSP

        MSPDir: ../crypto-config/peerOrganization/dean.neduet.com/msp

        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: deanpeer
              Port: 7054

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

        # ID to load the MSP definition as
        ID: degreeMSP

        MSPDir: ../crypto-config/peerOrganization/degree.neduet.com/msp

        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: degree
              Port: 7054

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

        # ID to load the MSP definition as
        ID: RegistrarMSP

        MSPDir: ../crypto-config/peerOrganization/registrar.neduet.com/msp

        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: registrar
              Port: 7054

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

        # ID to load the MSP definition as
        ID: ExaminationMSP

        MSPDir: ../crypto-config/peerOrganization/examination.neduet.com/msp

        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: examination
              Port: 7054

################################################################################
#
#   SECTION: Capabilities
#
#   - This section defines the capabilities of fabric network. This is a new
#   concept as of v1.1.0 and should not be utilized in mixed networks with
#   v1.0.x peers and orderers.  Capabilities define features which must be
#   present in a fabric binary for that binary to safely participate in the
#   fabric network.  For instance, if a new MSP type is added, newer binaries
#   might recognize and validate the signatures from this type, while older
#   binaries without this support would be unable to validate those
#   transactions.  This could lead to different versions of the fabric binaries
#   having different world states.  Instead, defining a capability for a channel
#   informs those binaries without this capability that they must cease
#   processing transactions until they have been upgraded.  For v1.0.x if any
#   capabilities are defined (including a map with all capabilities turned off)
#   then the v1.0.x peer will deliberately crash.
#
################################################################################
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.
    Global: &ChannelCapabilities
        # V1.1 for Global is a catchall flag for behavior which has been
        # determined to be desired for all orderers and peers running v1.0.x,
        # but the modification of which would cause incompatibilities.  Users
        # should leave this flag set to true.
        V1_1: true

    # Orderer capabilities apply only to the orderers, and may be safely
    # manipulated without concern for upgrading peers.  Set the value of the
    # capability to true to require it.
    Orderer: &OrdererCapabilities
        # V1.1 for Order is a catchall flag for behavior which has been
        # determined to be desired for all orderers running v1.0.x, but the
        # modification of which  would cause incompatibilities.  Users should
        # leave this flag set to true.
        V1_1: true

    # Application capabilities apply only to the peer network, and may be safely
    # manipulated without concern for upgrading orderers.  Set the value of the
    # capability to true to require it.
    Application: &ApplicationCapabilities
        # V1.1 for Application is a catchall flag for behavior which has been
        # determined to be desired for all peers running v1.0.x, but the
        # modification of which would cause incompatibilities.  Users should
        # leave this flag set to true.
        V1_1: true

################################################################################
#
#   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:



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

    # Orderer Type: The orderer implementation to start
    # Available types are "solo" and "kafka"
    OrdererType: solo

    Addresses:
        - orderer: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

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



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

    FourOrgsOrdererGenesis:
        Capabilities:
            <<: *ChannelCapabilities
        Orderer:
            <<: *OrdererDefaults
            Organizations:
                - *OrdererOrg
            Capabilities:
                <<: *OrdererCapabilities
        Consortiums:
            SampleConsortium:
                Organizations:
                    - *NeduetDean
                    - *degree
                    - *Registrar
                    - *Examination
    FourOrgsChannel:
        Consortium: SampleConsortium
        Application:
            <<: *ApplicationDefaults
            Organizations:
                    - *NeduetDean
                    - *degree
                    - *Registrar
                    - *Examination
            Capabilities:
                <<: *ApplicationCapabilities

在另一个aws实例中,我启动了对等容器和cli容器,并在两个容器上安装了相关的加密材料。现在,当尝试使用此命令peer channel create -c obaid -o 10.0.0.1:7050创建频道时,在订购日志和cli容器中都出现错误Attempted to include a member which is not in the consortium。任何人都可以帮助解决这些问题吗?

这些是我的订购者和同等的Yaml文件

Orderer.yaml文件

version: '3'

services:
    orderer1st:
        image: hyperledger/fabric-orderer:1.2.1
        ports:
              - 7050:7050
        hostname: orderer
        networks:
              - fabricoverlay
        environment:
              - ORDERER_GENERAL_LOGLEVEL=debug
              - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
              - ORDERER_GENERAL_GENESISMETHOD=file
              - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
              - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
              - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp

        command: orderer
        volumes:
             - ./channel-configuration/orderer.genesis.block:/var/hyperledger/orderer/orderer.genesis.block
             - ./msp:/var/hyperledger/orderer/msp
             - ./peerOrganization:/var/hyperledger/allorgs
        deploy:
           placement:
              constraints: [node.hostname == ip-xxx-xx-45-231]

networks:
    fabricoverlay:
        external: true

对等和cli yaml文件:

version : "3"

services:
   deanpeer:
     image: hyperledger/fabric-peer:1.2.1
     hostname: deanpeer.neduet.com
     networks:
       - fabricoverlay
     ports:
       - 7054:7054
     depends_on:
       - node_orderer1st
     environment:
       - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
       - CORE_LOGGING_LEVEL= DEBUG
       - CORE_PEER_ENDORSER_ENABLED=true
       - CORE_PEER_GOSSIP_USELEADERELECTION= true
       - CORE_PEER_GOSSIP_ORGLEADER= leader
       - CORE_PEER_PROFILE_ENABLED=true
       - CORE_PEER_TLS_ENABLED=false
       - CORE_PEER_ID=deanpeer
       - CORE_PEER_ADDRESS=deanpeer:7054
       - CORE_PEER_GOSSIP_EXTERNALENDPOINT=deanpeer:7054
       - CORE_PEER_LOCALMSPID= NeduetDeanMSP
       - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/fabric/msp

     volumes:
       -  /var/run/:/host/var/run/
       - ./Deansection/msp:/etc/hyperledger/fabric/msp

     deploy:
        placement:
           constraints: [node.hostname == ip-172-31-19-22]


     command: peer node start
   cli:
    image: hyperledger/fabric-tools
    tty: true
    environment:
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_LOGGING_LEVEL=DEBUG
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=deanpeer:7054
      - CORE_PEER_LOCALMSPID=NeduetDeanMSP
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
      - CORE_CHAINCODE_KEEPALIVE=10
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
        - ./Deansection/msp:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
        - /var/run/:/host/var/run/
    networks:
        - fabricoverlay

    deploy:
        placement:
           constraints: [node.hostname == ip-xxx-31-19-22]


networks:
  fabricoverlay:
      external: true

0 个答案:

没有答案