forked from cerc-io/plugeth
Seed bootstrapping added
This commit is contained in:
parent
42123b4396
commit
5a83114efd
16
ethereum.go
16
ethereum.go
@ -6,8 +6,10 @@ import (
|
|||||||
"github.com/ethereum/ethdb-go"
|
"github.com/ethereum/ethdb-go"
|
||||||
"github.com/ethereum/ethutil-go"
|
"github.com/ethereum/ethutil-go"
|
||||||
"github.com/ethereum/ethwire-go"
|
"github.com/ethereum/ethwire-go"
|
||||||
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@ -243,6 +245,20 @@ func (s *Ethereum) Start() {
|
|||||||
|
|
||||||
// Start the tx pool
|
// Start the tx pool
|
||||||
s.TxPool.Start()
|
s.TxPool.Start()
|
||||||
|
|
||||||
|
resp, err := http.Get("http://www.ethereum.org/servers.poc2.txt")
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Fetching seed failed:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Reading seed failed:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
s.ConnectToPeer(string(body))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Ethereum) peerHandler(listener net.Listener) {
|
func (s *Ethereum) peerHandler(listener net.Listener) {
|
||||||
|
Loading…
Reference in New Issue
Block a user