Skip to content

Commit 6d24ea7

Browse files
author
Srinivasan Muralidharan
committed
FAB-1162 read MSP cfg from a global path
https://jira.hyperledger.org/browse/FAB-1162 Anytime we assume full peer environment to be there (such as based on GOPATH) we prevent other environments that don’t have the full fabric from working. We will follow other use of PEER_CFG_PATH to break that implied strong association with a full fabric path. Change-Id: Ief1e7b9e56f78039095e3ed29c588360b4bc6eab Signed-off-by: Srinivasan Muralidharan <[email protected]>
1 parent 9d3abd1 commit 6d24ea7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

peer/main.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ func main() {
121121

122122
// Init the MSP
123123
// TODO: determine the location of this config file
124-
mspMgrConfigFile := os.Getenv("GOPATH") + "/src/github.com/hyperledger/fabric/msp/peer-config.json"
124+
var mspMgrConfigFile string
125+
if alternativeCfgPath != "" {
126+
mspMgrConfigFile = alternativeCfgPath + "/msp/peer-config.json"
127+
} else if _, err := os.Stat("./peer-config.json"); err == nil {
128+
mspMgrConfigFile = "./peer-config.json"
129+
} else {
130+
mspMgrConfigFile = os.Getenv("GOPATH") + "/src/github.com/hyperledger/fabric/msp/peer-config.json"
131+
}
125132
err = msp.GetManager().Setup(mspMgrConfigFile)
126133
if err != nil {
127134
panic(fmt.Errorf("Fatal error when reading MSP config file %s: err %s\n", mspMgrConfigFile, err))

0 commit comments

Comments
 (0)