From cef0aa3283d9aeb3ec188ae32e185da9f344a289 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Tue, 14 Feb 2017 14:52:48 -0500 Subject: [PATCH] [FAB-2239] Fix broken orderer image https://jira.hyperledger.org/browse/FAB-2239 Moving the configuration around caused the orderer docker image to no longer resolve the MSP configuration directory. This CR explicitly sets the MSPDir and ID, and adds them to the config file so that the env variables are effective. Change-Id: I1d5c059125ef028c7f4269ae5c573d51e317a401 Signed-off-by: Jason Yellick --- images/orderer/Dockerfile.in | 3 ++- orderer/network_test.go | 1 + orderer/orderer.yaml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/images/orderer/Dockerfile.in b/images/orderer/Dockerfile.in index 65353dccc24..5e539e01c84 100644 --- a/images/orderer/Dockerfile.in +++ b/images/orderer/Dockerfile.in @@ -1,9 +1,10 @@ FROM hyperledger/fabric-baseos:_BASE_TAG_ ENV ORDERER_CFG_PATH /etc/hyperledger/fabric +ENV ORDERER_GENERAL_LOCALMSPDIR $ORDERER_CFG_PATH/msp/sampleconfig RUN mkdir -p /var/hyperledger/production $ORDERER_CFG_PATH COPY payload/orderer /usr/local/bin COPY payload/genesis.yaml $ORDERER_CFG_PATH/ COPY payload/orderer.yaml $ORDERER_CFG_PATH/ -COPY payload/genesis.yaml $ORDERER_CFG_PATH/ +ADD payload/msp-sampleconfig.tar.bz2 $ORDERER_CFG_PATH/ EXPOSE 7050 CMD orderer diff --git a/orderer/network_test.go b/orderer/network_test.go index dbb7a1d5bb2..46dc8ab9fd7 100644 --- a/orderer/network_test.go +++ b/orderer/network_test.go @@ -305,6 +305,7 @@ func generateConfigEnv(peerNum uint64, grpcPort int, peerCommPort string, certFi panicOnError(err) envs := []string{} envs = append(envs, fmt.Sprintf("ORDERER_CFG_PATH=%s", ordererDir)) + envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LOCALMSPDIR=%s", ordererDir+"/../msp/sampleconfig")) envs = append(envs, fmt.Sprintf("ORDERER_GENERAL_LISTENPORT=%d", grpcPort)) envs = append(envs, fmt.Sprintf("CONFIGTX_ORDERER_ORDERERTYPE=%s", "sbft")) envs = append(envs, fmt.Sprintf("ORDERER_GENESIS_DEPRECATEDBATCHTIMEOUT=%d", 1000)) diff --git a/orderer/orderer.yaml b/orderer/orderer.yaml index ef5438bbff0..02c5a977e99 100644 --- a/orderer/orderer.yaml +++ b/orderer/orderer.yaml @@ -52,6 +52,18 @@ General: # when GenesisMethod is set to "file". GenesisFile: ./genesisblock + # LocalMSPDir is where to find the crypto material needed for signing in the orderer + # It is set relative here as a default for dev environments but should be changed to the + # real location in production + LocalMSPDir: ../msp/ + + # LocalMSPID is the identity to register the local MSP material with the MSP manager + # ----!!!!IMPORTANT!!!-!!!IMPORTANT!!!-!!!IMPORTANT!!!!---- + # Deployers need to change the value of the localMspId string. + # In particular, the name of the local MSP ID of a orderer needs + # to match the name of one of the MSPs in the ordering system channel + LocalMSPID: DEFAULT + # Enable an HTTP service for Go "pprof" profiling as documented at: # https://golang.org/pkg/net/http/pprof Profile: