whisper standalone mode (#498)

This commit is contained in:
Evgeny Danilenko 2017-12-07 15:07:45 +03:00 committed by Adam Babik
parent 5446a09029
commit 596b7ea2e1
2 changed files with 11 additions and 0 deletions

View File

@ -23,6 +23,7 @@ var (
// Whisper
identity = flag.String("identity", "", "Protocol identity file (private key used for asymmetric encryption)")
passwordFile = flag.String("passwordfile", "", "Password file (password is used for symmetric encryption)")
standalone = flag.Bool("standalone", true, "Don't actively connect to peers, wait for incoming connections")
minPow = flag.Float64("pow", params.WhisperMinimumPoW, "PoW for messages to be added to queue, in float format")
ttl = flag.Int("ttl", params.WhisperTTL, "Time to live for messages, in seconds")
@ -106,5 +107,10 @@ func makeNodeConfig() (*params.NodeConfig, error) {
nodeConfig.IPCEnabled = *ipcEnabled
nodeConfig.RPCEnabled = *httpEnabled
if *standalone {
nodeConfig.BootClusterConfig.Enabled = false
nodeConfig.BootClusterConfig.BootNodes = nil
}
return nodeConfig, nil
}

View File

@ -119,6 +119,11 @@ func defaultEmbeddedNodeConfig(config *params.NodeConfig) *node.Config {
nc.HTTPPort = config.HTTPPort
}
if !config.BootClusterConfig.Enabled {
nc.P2P.BootstrapNodes = nil
nc.P2P.BootstrapNodesV5 = nil
}
return nc
}