diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-11-09 22:35:04 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-11-15 00:00:14 +0800 |
commit | b61f48e5aad9cf897f5655a0db002a3349109c67 (patch) | |
tree | 32b0d7d4a126ee444e1cd563c5d4d8ebadef09ec /mobile/geth.go | |
parent | de4b39a1a32a61a9683a036b2e27e8df7cd4c9ff (diff) | |
download | dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.gz dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.bz2 dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.lz dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.xz dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.zst dexon-b61f48e5aad9cf897f5655a0db002a3349109c67.zip |
cmd, mobile, node, p2p: surface the discovery V5 bootnodes
Diffstat (limited to 'mobile/geth.go')
-rw-r--r-- | mobile/geth.go | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/mobile/geth.go b/mobile/geth.go index 85ac7fec5..4d1f48ec3 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -78,11 +78,11 @@ type NodeConfig struct { // defaultNodeConfig contains the default node configuration values to use if all // or some fields are missing from the user's specified list. var defaultNodeConfig = &NodeConfig{ - BootstrapNodes: MainnetBootnodes(), + BootstrapNodes: FoundationBootnodes(), MaxPeers: 25, EthereumEnabled: true, EthereumNetworkID: 1, - EthereumChainConfig: MainnetChainConfig, + EthereumChainConfig: MainnetChainConfig(), EthereumDatabaseCache: 16, } @@ -106,17 +106,21 @@ func NewNode(datadir string, config *NodeConfig) (*Node, error) { if config.MaxPeers == 0 { config.MaxPeers = defaultNodeConfig.MaxPeers } + if config.BootstrapNodes == nil || config.BootstrapNodes.Size() == 0 { + config.BootstrapNodes = defaultNodeConfig.BootstrapNodes + } // Create the empty networking stack nodeConf := &node.Config{ - Name: clientIdentifier, - DataDir: datadir, - KeyStoreDir: filepath.Join(datadir, "keystore"), // Mobile should never use internal keystores! - NoDiscovery: true, - DiscoveryV5: true, - BootstrapNodes: config.BootstrapNodes.nodes, - ListenAddr: ":0", - NAT: nat.Any(), - MaxPeers: config.MaxPeers, + Name: clientIdentifier, + DataDir: datadir, + KeyStoreDir: filepath.Join(datadir, "keystore"), // Mobile should never use internal keystores! + NoDiscovery: true, + DiscoveryV5: true, + DiscoveryV5Addr: ":0", + BootstrapNodesV5: config.BootstrapNodes.nodes, + ListenAddr: ":0", + NAT: nat.Any(), + MaxPeers: config.MaxPeers, } stack, err := node.New(nodeConf) if err != nil { |