Commit 1b402341 authored by Janos Guljas's avatar Janos Guljas

remove libp2p connection manager as we are going to track peers

parent 4b643f4b
...@@ -38,9 +38,6 @@ func (c *command) initStartCmd() (err error) { ...@@ -38,9 +38,6 @@ func (c *command) initStartCmd() (err error) {
optionNameDebugAPIAddr = "debug-api-addr" optionNameDebugAPIAddr = "debug-api-addr"
optionNameBootnodes = "bootnode" optionNameBootnodes = "bootnode"
optionNameNetworkID = "network-id" optionNameNetworkID = "network-id"
optionNameConnectionsLow = "connections-low"
optionNameConnectionsHigh = "connections-high"
optionNameConnectionsGrace = "connections-grace"
optionNameVerbosity = "verbosity" optionNameVerbosity = "verbosity"
) )
...@@ -103,9 +100,6 @@ func (c *command) initStartCmd() (err error) { ...@@ -103,9 +100,6 @@ func (c *command) initStartCmd() (err error) {
DisableQUIC: c.config.GetBool(optionNameP2PDisableQUIC), DisableQUIC: c.config.GetBool(optionNameP2PDisableQUIC),
Bootnodes: c.config.GetStringSlice(optionNameBootnodes), Bootnodes: c.config.GetStringSlice(optionNameBootnodes),
NetworkID: c.config.GetInt32(optionNameNetworkID), NetworkID: c.config.GetInt32(optionNameNetworkID),
ConnectionsLow: c.config.GetInt(optionNameConnectionsLow),
ConnectionsHigh: c.config.GetInt(optionNameConnectionsHigh),
ConnectionsGrace: c.config.GetDuration(optionNameConnectionsGrace),
Logger: logger, Logger: logger,
}, },
Logger: logger, Logger: logger,
...@@ -164,9 +158,6 @@ func (c *command) initStartCmd() (err error) { ...@@ -164,9 +158,6 @@ func (c *command) initStartCmd() (err error) {
cmd.Flags().Bool(optionNameEnableDebugAPI, false, "enable debug HTTP API") cmd.Flags().Bool(optionNameEnableDebugAPI, false, "enable debug HTTP API")
cmd.Flags().String(optionNameDebugAPIAddr, ":6060", "debug HTTP API listen address") cmd.Flags().String(optionNameDebugAPIAddr, ":6060", "debug HTTP API listen address")
cmd.Flags().Int32(optionNameNetworkID, 1, "ID of the Swarm network") cmd.Flags().Int32(optionNameNetworkID, 1, "ID of the Swarm network")
cmd.Flags().Int(optionNameConnectionsLow, 200, "low watermark governing the number of connections that'll be maintained")
cmd.Flags().Int(optionNameConnectionsHigh, 400, "high watermark governing the number of connections that'll be maintained")
cmd.Flags().Duration(optionNameConnectionsGrace, time.Minute, "the amount of time a newly opened connection is given before it becomes subject to pruning")
cmd.Flags().String(optionNameVerbosity, "info", "log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace") cmd.Flags().String(optionNameVerbosity, "info", "log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace")
c.root.AddCommand(cmd) c.root.AddCommand(cmd)
......
...@@ -10,7 +10,6 @@ import ( ...@@ -10,7 +10,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"net" "net"
"time"
"github.com/ethersphere/bee/pkg/logging" "github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/p2p" "github.com/ethersphere/bee/pkg/p2p"
...@@ -18,7 +17,6 @@ import ( ...@@ -18,7 +17,6 @@ import (
"github.com/ethersphere/bee/pkg/swarm" "github.com/ethersphere/bee/pkg/swarm"
"github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p"
autonat "github.com/libp2p/go-libp2p-autonat-svc" autonat "github.com/libp2p/go-libp2p-autonat-svc"
connmgr "github.com/libp2p/go-libp2p-connmgr"
crypto "github.com/libp2p/go-libp2p-core/crypto" crypto "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/helpers" "github.com/libp2p/go-libp2p-core/helpers"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
...@@ -51,9 +49,6 @@ type Options struct { ...@@ -51,9 +49,6 @@ type Options struct {
DisableQUIC bool DisableQUIC bool
Bootnodes []string Bootnodes []string
NetworkID int32 NetworkID int32
ConnectionsLow int
ConnectionsHigh int
ConnectionsGrace time.Duration
Logger logging.Logger Logger logging.Logger
} }
...@@ -107,13 +102,6 @@ func New(ctx context.Context, o Options) (*Service, error) { ...@@ -107,13 +102,6 @@ func New(ctx context.Context, o Options) (*Service, error) {
libp2p.Security(secio.ID, secio.New), libp2p.Security(secio.ID, secio.New),
// support any other default transports (TCP) // support any other default transports (TCP)
libp2p.DefaultTransports, libp2p.DefaultTransports,
// Let's prevent our peer from having too many
// connections by attaching a connection manager.
libp2p.ConnectionManager(connmgr.NewConnManager(
o.ConnectionsLow,
o.ConnectionsHigh,
o.ConnectionsGrace,
)),
// Attempt to open ports using uPNP for NATed hosts. // Attempt to open ports using uPNP for NATed hosts.
libp2p.NATPortMap(), libp2p.NATPortMap(),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment