aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-11-09 22:35:04 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-11-15 00:00:14 +0800
commitb61f48e5aad9cf897f5655a0db002a3349109c67 (patch)
tree32b0d7d4a126ee444e1cd563c5d4d8ebadef09ec /p2p/server.go
parentde4b39a1a32a61a9683a036b2e27e8df7cd4c9ff (diff)
downloadgo-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.gz
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.bz2
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.lz
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.xz
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.tar.zst
go-tangerine-b61f48e5aad9cf897f5655a0db002a3349109c67.zip
cmd, mobile, node, p2p: surface the discovery V5 bootnodes
Diffstat (limited to 'p2p/server.go')
-rw-r--r--p2p/server.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/p2p/server.go b/p2p/server.go
index 1e571abf1..7381127dc 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -73,16 +73,26 @@ type Config struct {
// or not. Disabling is usually useful for protocol debugging (manual topology).
Discovery bool
+ // DiscoveryV5 specifies whether the the new topic-discovery based V5 discovery
+ // protocol should be started or not.
DiscoveryV5 bool
+ // Listener address for the V5 discovery protocol UDP traffic.
+ DiscoveryV5Addr string
+
// Name sets the node name of this server.
// Use common.MakeName to create a name that follows existing conventions.
Name string
- // Bootstrap nodes are used to establish connectivity
+ // BootstrapNodes are used to establish connectivity
// with the rest of the network.
BootstrapNodes []*discover.Node
+ // BootstrapNodesV5 are used to establish connectivity
+ // with the rest of the network using the V5 discovery
+ // protocol.
+ BootstrapNodesV5 []*discv5.Node
+
// Static nodes are used as pre-configured connections which are always
// maintained and re-connected on disconnects.
StaticNodes []*discover.Node
@@ -108,8 +118,6 @@ type Config struct {
// the server is started.
ListenAddr string
- ListenAddrV5 string
-
// If set to a non-nil value, the given NAT port mapper
// is used to make the listening port available to the
// Internet.
@@ -359,11 +367,11 @@ func (srv *Server) Start() (err error) {
}
if srv.DiscoveryV5 {
- ntab, err := discv5.ListenUDP(srv.PrivateKey, srv.ListenAddrV5, srv.NAT, "") //srv.NodeDatabase)
+ ntab, err := discv5.ListenUDP(srv.PrivateKey, srv.DiscoveryV5Addr, srv.NAT, "") //srv.NodeDatabase)
if err != nil {
return err
}
- if err := ntab.SetFallbackNodes(discv5.BootNodes); err != nil {
+ if err := ntab.SetFallbackNodes(srv.BootstrapNodesV5); err != nil {
return err
}
srv.DiscV5 = ntab