whisper standalone mode (#498)
This commit is contained in:
parent
5446a09029
commit
596b7ea2e1
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue