Ensure that `NewNodeConfigWithDefaults` builds a valid configuration

This commit is contained in:
Pedro Pombeiro 2018-10-27 15:20:17 +02:00 committed by Pedro Pombeiro
parent 1f6cccd0fc
commit 87f1af0743
5 changed files with 6 additions and 1 deletions

View File

@ -253,6 +253,7 @@ func makeNodeConfig() (*params.NodeConfig, error) {
nodeConfig.LogFile = *logFile nodeConfig.LogFile = *logFile
} }
nodeConfig.NoDiscovery = true
nodeConfig.ListenAddr = "" nodeConfig.ListenAddr = ""
if *staticEnodeAddr != "" { if *staticEnodeAddr != "" {
nodeConfig.ClusterConfig.Enabled = true nodeConfig.ClusterConfig.Enabled = true

View File

@ -1,5 +1,6 @@
{ {
"Rendezvous": true, "Rendezvous": true,
"NoDiscovery": false,
"ClusterConfig": { "ClusterConfig": {
"Enabled": true, "Enabled": true,
"Fleet": "eth.beta", "Fleet": "eth.beta",

View File

@ -1,5 +1,6 @@
{ {
"Rendezvous": true, "Rendezvous": true,
"NoDiscovery": false,
"ClusterConfig": { "ClusterConfig": {
"Enabled": true, "Enabled": true,
"Fleet": "eth.staging", "Fleet": "eth.staging",

View File

@ -1,5 +1,6 @@
{ {
"LogLevel": "DEBUG", "LogLevel": "DEBUG",
"NoDiscovery": false,
"ClusterConfig": { "ClusterConfig": {
"Enabled": true, "Enabled": true,
"Fleet": "eth.test", "Fleet": "eth.test",

View File

@ -315,6 +315,7 @@ func WithFleet(fleet string) Option {
if fleet == FleetUndefined { if fleet == FleetUndefined {
return nil return nil
} }
c.NoDiscovery = false
c.ClusterConfig.Enabled = true c.ClusterConfig.Enabled = true
return loadConfigFromAsset(fmt.Sprintf("../config/cli/fleet-%s.json", fleet), c) return loadConfigFromAsset(fmt.Sprintf("../config/cli/fleet-%s.json", fleet), c)
} }
@ -342,7 +343,7 @@ func NewNodeConfigWithDefaults(dataDir string, networkID uint64, opts ...Option)
return nil, err return nil, err
} }
c.NoDiscovery = false c.NoDiscovery = true
c.HTTPHost = "" c.HTTPHost = ""
c.ListenAddr = ":30303" c.ListenAddr = ":30303"
c.LogEnabled = true c.LogEnabled = true