@@ -114,6 +114,9 @@ func main() {
114
114
maxConnPerIP := flag .Int ("max_conn_per_ip" , 10 , "max connections number for same ip" )
115
115
forceReachabilityPublic := flag .Bool ("force_public" , false , "forcing the local node to believe it is reachable externally" )
116
116
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" )
117
120
noTransportSecurity := flag .Bool ("no_transport_security" , false , "disable TLS encrypted transport" )
118
121
muxer := flag .String ("muxer" , "mplex, yamux" , "protocol muxer to mux per-protocol streams (mplex, yamux)" )
119
122
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() {
149
152
selfPeer := p2p.Peer {IP : * ip , Port : * port }
150
153
151
154
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 ,
166
172
})
167
173
if err != nil {
168
174
utils .FatalErrMsg (err , "cannot initialize network" )
0 commit comments