Skip to content

Commit

Permalink
Merge pull request #2054 from bcbrock/issue-1962
Browse files Browse the repository at this point in the history
Remove all command-line flags that shadow keys in core.yaml
  • Loading branch information
srderson committed Jun 28, 2016
2 parents 474516e + 6422786 commit 8fc92be
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions peer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,8 @@ func main() {

// Set the flags on the node start command.
flags := nodeStartCmd.Flags()
flags.Bool("peer-tls-enabled", false, "Connection uses TLS if true, else plain TCP")
flags.String("peer-tls-cert-file", "testdata/server1.pem", "TLS cert file")
flags.String("peer-tls-key-file", "testdata/server1.key", "TLS key file")
flags.Int("peer-gomaxprocs", 2, "The maximum number threads excuting peer code")
flags.Bool("peer-discovery-enabled", true, "Whether peer discovery is enabled")

flags.BoolVarP(&chaincodeDevMode, "peer-chaincodedev", "", false, "Whether peer in chaincode development mode")

viper.BindPFlag("peer.tls.enabled", flags.Lookup("peer-tls-enabled"))
viper.BindPFlag("peer.tls.cert.file", flags.Lookup("peer-tls-cert-file"))
viper.BindPFlag("peer.tls.key.file", flags.Lookup("peer-tls-key-file"))
viper.BindPFlag("peer.gomaxprocs", flags.Lookup("peer-gomaxprocs"))

// Now set the configuration file.
viper.SetConfigName(cmdRoot) // Name of config file (without extension)
viper.AddConfigPath("./") // Path to look for the config file in
Expand All @@ -273,7 +262,7 @@ func main() {
nodeCmd.AddCommand(nodeStartCmd)
nodeCmd.AddCommand(nodeStatusCmd)

nodeStopCmd.Flags().StringVarP(&stopPidFile, "stop-peer-pid-file", "", viper.GetString("peer.fileSystemPath"), "Location of peer pid local file, for forces kill")
nodeStopCmd.Flags().StringVar(&stopPidFile, "stop-peer-pid-file", viper.GetString("peer.fileSystemPath"), "Location of peer pid local file, for forces kill")
nodeCmd.AddCommand(nodeStopCmd)

mainCmd.AddCommand(nodeCmd)
Expand Down

0 comments on commit 8fc92be

Please sign in to comment.