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.NoDiscovery = true
nodeConfig.ListenAddr = ""
if *staticEnodeAddr != "" {
nodeConfig.ClusterConfig.Enabled = true

View File

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

View File

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

View File

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

View File

@ -315,6 +315,7 @@ func WithFleet(fleet string) Option {
if fleet == FleetUndefined {
return nil
}
c.NoDiscovery = false
c.ClusterConfig.Enabled = true
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
}
c.NoDiscovery = false
c.NoDiscovery = true
c.HTTPHost = ""
c.ListenAddr = ":30303"
c.LogEnabled = true