From 5f735d6fce10b4552b0a6d3eb6503c5a302f4f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 23 Apr 2015 18:47:24 +0300 Subject: cmd, eth, p2p, p2p/discover: init and clean up the seed cache --- p2p/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'p2p/server.go') diff --git a/p2p/server.go b/p2p/server.go index ecf418d13..39b0b8b6e 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -59,6 +59,10 @@ type Server struct { // with the rest of the network. BootstrapNodes []*discover.Node + // SeedCache is the path to the database containing the previously seen live + // nodes in the network to use as potential bootstrap seeds. + SeedCache string + // Protocols should contain the protocols supported // by the server. Matching protocols are launched for // each peer. @@ -197,7 +201,7 @@ func (srv *Server) Start() (err error) { } // node table - ntab, err := discover.ListenUDP(srv.PrivateKey, srv.ListenAddr, srv.NAT) + ntab, err := discover.ListenUDP(srv.PrivateKey, srv.ListenAddr, srv.NAT, srv.SeedCache) if err != nil { return err } -- cgit v1.2.3 From 6def110c37d4d43402c4b658ce6b291400f840e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 24 Apr 2015 11:19:33 +0300 Subject: cmd/bootnode, eth, p2p, p2p/discover: clean up the seeder and mesh into eth. --- p2p/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'p2p/server.go') diff --git a/p2p/server.go b/p2p/server.go index 39b0b8b6e..5f1b80f51 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -59,9 +59,9 @@ type Server struct { // with the rest of the network. BootstrapNodes []*discover.Node - // SeedCache is the path to the database containing the previously seen live - // nodes in the network to use as potential bootstrap seeds. - SeedCache string + // SeedCache is the database containing the previously seen live nodes in + // the network to use as potential bootstrap seeds. + SeedCache *discover.Cache // Protocols should contain the protocols supported // by the server. Matching protocols are launched for -- cgit v1.2.3 From 8646365b42ddae30e596835b4512792ca11196a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 24 Apr 2015 18:04:41 +0300 Subject: cmd/bootnode, eth, p2p, p2p/discover: use a fancier db design --- p2p/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'p2p/server.go') diff --git a/p2p/server.go b/p2p/server.go index 5f1b80f51..5c5883ae8 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -59,9 +59,9 @@ type Server struct { // with the rest of the network. BootstrapNodes []*discover.Node - // SeedCache is the database containing the previously seen live nodes in - // the network to use as potential bootstrap seeds. - SeedCache *discover.Cache + // NodeDatabase is the path to the database containing the previously seen + // live nodes in the network. + NodeDatabase string // Protocols should contain the protocols supported // by the server. Matching protocols are launched for @@ -201,7 +201,7 @@ func (srv *Server) Start() (err error) { } // node table - ntab, err := discover.ListenUDP(srv.PrivateKey, srv.ListenAddr, srv.NAT, srv.SeedCache) + ntab, err := discover.ListenUDP(srv.PrivateKey, srv.ListenAddr, srv.NAT, srv.NodeDatabase) if err != nil { return err } -- cgit v1.2.3