diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-02-14 04:51:51 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-02-14 04:51:51 +0800 |
commit | acc7c0f706e6b7d936208117c9bc13b7fbee3ba2 (patch) | |
tree | 757e0e74ff2bb25dbd436cb3fe735fd92e35a6a2 | |
parent | 384305f4aa8daef684efc76a374e1d6686c9c83f (diff) | |
parent | 1c1a3033beed74b22adc9827929e72ae04ed42cc (diff) | |
download | dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar.gz dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar.bz2 dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar.lz dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar.xz dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.tar.zst dexon-acc7c0f706e6b7d936208117c9bc13b7fbee3ba2.zip |
Merge pull request #308 from fjl/default-bootnodes
eth: add default bootnode
-rw-r--r-- | eth/backend.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/eth/backend.go b/eth/backend.go index 28a065066..8c2073574 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -19,8 +19,14 @@ import ( "github.com/ethereum/go-ethereum/whisper" ) -var logger = ethlogger.NewLogger("SERV") -var jsonlogger = ethlogger.NewJsonLogger() +var ( + logger = ethlogger.NewLogger("SERV") + jsonlogger = ethlogger.NewJsonLogger() + + defaultBootNodes = []*discover.Node{ + discover.MustParseNode("enode://6cdd090303f394a1cac34ecc9f7cda18127eafa2a3a06de39f6d920b0e583e062a7362097c7c65ee490a758b442acd5c80c6fce4b148c6a391e946b45131365b@54.169.166.226:30303"), + } +) type Config struct { Name string @@ -50,6 +56,9 @@ type Config struct { } func (cfg *Config) parseBootNodes() []*discover.Node { + if cfg.BootNodes == "" { + return defaultBootNodes + } var ns []*discover.Node for _, url := range strings.Split(cfg.BootNodes, " ") { if url == "" { |