hyperledger-fabrichyperledger-composer

hyperledger fabric, can`t start orderer via docker


I could not start fabric-orderer via docker . the docker-compose file

// code placeholder
networks:
    fabric-ca:
        external: 
            name: fabric-ca
services:
  orderer1-org0:
    container_name: orderer1-org0
    image: hyperledger/fabric-orderer:2.2.1
    environment:
      - ORDERER_HOST=orderer1-org0
      - ORDERER_GENERAL_PROFILE_ENABLED=false
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_LISTENPORT=7050
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/orderer/orderer.genesis.block
      - ORDERER_GENERAL_LOCALMSPID=org0MSP
      - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/org0/orderer/msp
      - ORDERER_GENERAL_TLS_ENABLED=true
      - ORDERER_GENERAL_TLS_PRIVATEKEY=/etc/hyperledger/org0/orderer/tls-msp/keystore/key.pem
      - ORDERER_GENERAL_TLS_CERTIFICATE=/etc/hyperledger/org0/orderer/tls-msp/signcerts/cert.pem
      - ORDERER_GENERAL_TLS_ROOTCAS=[/etc/hyperledger/org0/orderer/tls-msp/tlscacerts/tls-0-0-0-0-7052.pem]
      - ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
      - ORDERER_KAFKA_VERBOSE=true
      - ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/etc/hyperledger/org0/orderer/tls-msp/signcerts/cert.pem
      - ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/etc/hyperledger/org0/orderer/tls-msp/keystore/key.pem
      - ORDERER_GENERAL_CLUSTER_ROOTCAS=[/etc/hyperledger/org0/orderer/tls-msp/tlscacerts/tls-0-0-0-0-7052.pem]
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_DEBUG_BROADCASTTRACEDIR=data/logs
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer    
    volumes:
      - /opt/hyperledger/org0/orderer:/etc/hyperledger/org0/orderer/
      - /opt/hyperledger/configtx/system-genesis-block/genesis.block:/etc/hyperledger/orderer/orderer.genesis.block
    networks:
      - fabric-ca

when I use it to start docker. the error code is.

failed to parse config: Error reading configuration: Unsupported Config Type ""

but when I add this line to the environment.

- FABRIC_CFG_PATH=/etc/hyperledger/org0/orderer and add a orderer.yaml to the /opt/hyperledger/org0/orderer floder, the error code is * '' has invalid keys: admin and when I remove the

Admin:
    # host and port for the admin server
    ListenAddress: 127.0.0.1:9443    # TLS configuration for the admin endpoint
    TLS:
        # TLS enabled
        Enabled: false        # Certificate is the location of the PEM encoded TLS certificate
        Certificate:        # PrivateKey points to the location of the PEM-encoded key
        PrivateKey:        # Most admin service endpoints require client authentication when TLS
        # is enabled. ClientAuthRequired requires client certificate authentication
        # at the TLS layer to access all resources.
        #
        # NOTE: When TLS is enabled, the admin endpoint requires mutual TLS. The
        # orderer will panic on startup if this value is set to false.
        ClientAuthRequired: true        # Paths to PEM encoded ca certificates to trust for client authentication
        ClientRootCAs: []

block from orderer.yaml

the error code is

panic: Failed validating bootstrap block: initializing channelconfig failed: could not create channel Consortiums sub-group config: setting up the MSP manager failed: administrators must be declared when no admin ou classification is set

so, is there a right way to start a fabric-orderer docker ?

Thanks a lot.


Solution

  • [YOUR SECOND ERROR]
    Admin is an invalid config value.

    It needs to be changed to General. Please refer to the link below
    sampleconfig/orderer.yaml


    [YOUR FIRST ERROR]
    Try adding FABRIC_CFG_PATH parameter in docker-compose.yaml FABRIC_CFG_PATH is the directory path where the orderer.yaml file exists.

    ~~~
      orderer1-org0:
        container_name: orderer1-org0
        image: hyperledger/fabric-orderer:2.2.1
        environment:
          - FABRIC_CFG_PATH=/etc/hyperledger/org0/orderer/
    ~~~
    
    ~~~
    GenesisFile: /etc/hyperledger/orderer/orderer.genesis.block
    ~~~