Skip to content

Commit 50af5aa

Browse files
add resource manager flags to boot node
1 parent 248f32c commit 50af5aa

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

cmd/bootnode/main.go

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ func main() {
114114
maxConnPerIP := flag.Int("max_conn_per_ip", 10, "max connections number for same ip")
115115
forceReachabilityPublic := flag.Bool("force_public", false, "forcing the local node to believe it is reachable externally")
116116
connMgrHighWaterMark := flag.Int("cmg_high_watermark", 900, "connection manager trims excess connections when they pass the high watermark")
117+
resourceManagerEnabled := flag.Bool("resmgr-enabled", false, "enable p2p resource manager")
118+
resourceManagerMemoryLimitBytes := flag.Uint64("resmgr-memory-limit-bytes", 0, "memory limit for p2p resource manager")
119+
resourceManagerFileDescriptorsLimit := flag.Uint64("resmgr-file-descriptor-limit", 0, "file descriptor limit for p2p resource manager")
117120
noTransportSecurity := flag.Bool("no_transport_security", false, "disable TLS encrypted transport")
118121
muxer := flag.String("muxer", "mplex, yamux", "protocol muxer to mux per-protocol streams (mplex, yamux)")
119122
userAgent := flag.String("user_agent", defUserAgent, "explicitly set the user-agent, so we can differentiate from other Go libp2p users")
@@ -149,20 +152,23 @@ func main() {
149152
selfPeer := p2p.Peer{IP: *ip, Port: *port}
150153

151154
host, err := p2p.NewHost(p2p.HostConfig{
152-
Self: &selfPeer,
153-
BLSKey: privKey,
154-
BootNodes: nil, // Boot nodes have no boot nodes :) Will be connected when other nodes joined
155-
TrustedNodes: nil,
156-
DataStoreFile: &dataStorePath,
157-
MaxConnPerIP: *maxConnPerIP,
158-
ForceReachabilityPublic: *forceReachabilityPublic,
159-
ConnManagerHighWatermark: *connMgrHighWaterMark,
160-
NoTransportSecurity: *noTransportSecurity,
161-
NAT: true,
162-
UserAgent: *userAgent,
163-
DialTimeout: time.Minute,
164-
Muxer: *muxer,
165-
NoRelay: *noRelay,
155+
Self: &selfPeer,
156+
BLSKey: privKey,
157+
BootNodes: nil, // Boot nodes have no boot nodes :) Will be connected when other nodes joined
158+
TrustedNodes: nil,
159+
DataStoreFile: &dataStorePath,
160+
MaxConnPerIP: *maxConnPerIP,
161+
ForceReachabilityPublic: *forceReachabilityPublic,
162+
ConnManagerHighWatermark: *connMgrHighWaterMark,
163+
ResourceMgrEnabled: *resourceManagerEnabled,
164+
ResourceMgrMemoryLimitBytes: *resourceManagerMemoryLimitBytes,
165+
ResourceMgrFileDescriptorsLimit: *resourceManagerFileDescriptorsLimit,
166+
NoTransportSecurity: *noTransportSecurity,
167+
NAT: true,
168+
UserAgent: *userAgent,
169+
DialTimeout: time.Minute,
170+
Muxer: *muxer,
171+
NoRelay: *noRelay,
166172
})
167173
if err != nil {
168174
utils.FatalErrMsg(err, "cannot initialize network")

0 commit comments

Comments
 (0)