Skip to content

Commit

Permalink
add connection manager high water mark flag to boot node (#4747)
Browse files Browse the repository at this point in the history
  • Loading branch information
GheisMohammadi authored Aug 30, 2024
1 parent 4e50bbc commit 016d979
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func main() {
logConn := flag.Bool("log_conn", false, "log incoming/outgoing connections")
maxConnPerIP := flag.Int("max_conn_per_ip", 10, "max connections number for same ip")
forceReachabilityPublic := flag.Bool("force_public", false, "forcing the local node to believe it is reachable externally")
connMgrHighWaterMark := flag.Int("cmg_high_watermark", 900, "connection manager trims excess connections when they pass the high watermark")
noTransportSecurity := flag.Bool("no_transport_security", false, "disable TLS encrypted transport")
muxer := flag.String("muxer", "mplex, yamux", "protocol muxer to mux per-protocol streams (mplex, yamux)")
userAgent := flag.String("user_agent", defUserAgent, "explicitly set the user-agent, so we can differentiate from other Go libp2p users")
Expand Down Expand Up @@ -142,18 +143,19 @@ func main() {
selfPeer := p2p.Peer{IP: *ip, Port: *port}

host, err := p2p.NewHost(p2p.HostConfig{
Self: &selfPeer,
BLSKey: privKey,
BootNodes: nil, // Boot nodes have no boot nodes :) Will be connected when other nodes joined
DataStoreFile: &dataStorePath,
MaxConnPerIP: *maxConnPerIP,
ForceReachabilityPublic: *forceReachabilityPublic,
NoTransportSecurity: *noTransportSecurity,
NAT: true,
UserAgent: *userAgent,
DialTimeout: time.Minute,
Muxer: *muxer,
NoRelay: *noRelay,
Self: &selfPeer,
BLSKey: privKey,
BootNodes: nil, // Boot nodes have no boot nodes :) Will be connected when other nodes joined
DataStoreFile: &dataStorePath,
MaxConnPerIP: *maxConnPerIP,
ForceReachabilityPublic: *forceReachabilityPublic,
ConnManagerHighWatermark: *connMgrHighWaterMark,
NoTransportSecurity: *noTransportSecurity,
NAT: true,
UserAgent: *userAgent,
DialTimeout: time.Minute,
Muxer: *muxer,
NoRelay: *noRelay,
})
if err != nil {
utils.FatalErrMsg(err, "cannot initialize network")
Expand Down

0 comments on commit 016d979

Please sign in to comment.