Skip to content

Commit

Permalink
Implemented our own makeshift go seed. Fixes ethereum#16
Browse files Browse the repository at this point in the history
  • Loading branch information
Maran committed May 13, 2014
1 parent cc341b8 commit 3647cc5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,21 @@ func (s *Ethereum) Start(seed bool) {
}

func (s *Ethereum) Seed() {
ethutil.Config.Log.Debugln("Seeding")
// DNS Bootstrapping
ethutil.Config.Log.Debugln("[SERV] Retrieving seed nodes")

// Eth-Go Bootstrapping
ips, er := net.LookupIP("seed.bysh.me")
if er == nil {
peers := []string{}
for _, ip := range ips {
node := fmt.Sprintf("%s:%d", ip.String(), 30303)
ethutil.Config.Log.Debugln("[SERV] Found DNS Go Peer:", node)
peers = append(peers, node)
}
s.ProcessPeerList(peers)
}

// Official DNS Bootstrapping
_, nodes, err := net.LookupSRV("eth", "tcp", "ethereum.org")
if err == nil {
peers := []string{}
Expand All @@ -340,11 +353,11 @@ func (s *Ethereum) Seed() {
for _, a := range addr {
// Build string out of SRV port and Resolved IP
peer := net.JoinHostPort(a, port)
log.Println("Found DNS Bootstrap Peer:", peer)
ethutil.Config.Log.Debugln("[SERV] Found DNS Bootstrap Peer:", peer)
peers = append(peers, peer)
}
} else {
log.Println("Couldn't resolve :", target)
ethutil.Config.Log.Debugln("[SERV} Couldn't resolve :", target)
}
}
// Connect to Peer list
Expand Down

0 comments on commit 3647cc5

Please sign in to comment.