mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-05-14 06:19:42 +00:00
update libp2p & fixes
This commit is contained in:
parent
e0d5c2e331
commit
fdff21ce0f
@ -27,7 +27,7 @@ requires "nim >= 2.2.4",
|
||||
"toml_serialization",
|
||||
"faststreams",
|
||||
# Networking & P2P
|
||||
"https://github.com/vacp2p/nim-libp2p.git#ff8d51857b4b79a68468e7bcc27b2026cca02996",
|
||||
"https://github.com/vacp2p/nim-libp2p.git#9b6fedca059f3c054582407be9268e2999c7d05d",
|
||||
"eth",
|
||||
"nat_traversal",
|
||||
"dnsdisc",
|
||||
|
||||
@ -14,6 +14,7 @@ import
|
||||
../discovery/waku_discv5,
|
||||
../waku_node,
|
||||
../node/peer_manager,
|
||||
../node/waku_switch,
|
||||
../common/rate_limit/setting,
|
||||
../common/utils/parse_size_units,
|
||||
../common/broker/broker_context
|
||||
@ -189,7 +190,7 @@ proc build*(builder: WakuNodeBuilder): Result[WakuNode, string] =
|
||||
wsAddress = builder.netConfig.get().wsHostAddress,
|
||||
transportFlags = {ServerFlags.ReuseAddr, ServerFlags.TcpNoDelay},
|
||||
rng = rng,
|
||||
maxConnections = builder.switchMaxConnections.get(builders.MaxConnections),
|
||||
maxConnections = builder.switchMaxConnections.get(MaxConnections),
|
||||
wssEnabled = builder.netConfig.get().wssEnabled,
|
||||
secureKeyPath = builder.switchSslSecureKey.get(""),
|
||||
secureCertPath = builder.switchSslSecureCert.get(""),
|
||||
@ -209,7 +210,7 @@ proc build*(builder: WakuNodeBuilder): Result[WakuNode, string] =
|
||||
maxServicePeers = some(builder.maxServicePeers),
|
||||
colocationLimit = builder.colocationLimit,
|
||||
shardedPeerManagement = builder.shardAware,
|
||||
maxConnections = builder.switchMaxConnections.get(builders.MaxConnections),
|
||||
maxConnections = builder.switchMaxConnections.get(MaxConnections),
|
||||
)
|
||||
|
||||
var node: WakuNode
|
||||
|
||||
@ -23,6 +23,7 @@ import
|
||||
common/utils/parse_size_units,
|
||||
common/broker/broker_context,
|
||||
node/health_monitor/online_monitor,
|
||||
node/waku_switch,
|
||||
],
|
||||
./peer_store/peer_storage,
|
||||
./waku_peer_store
|
||||
|
||||
@ -635,9 +635,6 @@ proc stop*(node: WakuNode) {.async.} =
|
||||
not node.wakuPeerExchangeClient.pxLoopHandle.isNil():
|
||||
await node.wakuPeerExchangeClient.pxLoopHandle.cancelAndWait()
|
||||
|
||||
if not node.wakuKademlia.isNil():
|
||||
await node.wakuKademlia.stop()
|
||||
|
||||
if not node.wakuRendezvousClient.isNil():
|
||||
await node.wakuRendezvousClient.stopWait()
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ import
|
||||
libp2p/transports/[transport, tcptransport, wstransport],
|
||||
libp2p/peeraddrpolicy
|
||||
|
||||
# override nim-libp2p default value (which is also 1)
|
||||
# override nim-libp2p default values (which are also 50 & 1)
|
||||
const MaxConnections* = 50
|
||||
const MaxConnectionsPerPeer* = 1
|
||||
|
||||
proc withWsTransport*(b: SwitchBuilder): SwitchBuilder =
|
||||
@ -67,8 +68,8 @@ proc newWakuSwitch*(
|
||||
inTimeout: Duration = 5.minutes,
|
||||
outTimeout: Duration = 5.minutes,
|
||||
maxConnections = MaxConnections,
|
||||
maxIn = -1,
|
||||
maxOut = -1,
|
||||
maxIn = int.high,
|
||||
maxOut = int.high,
|
||||
maxConnsPerPeer = MaxConnectionsPerPeer,
|
||||
nameResolver: NameResolver = nil,
|
||||
sendSignedPeerRecord = false,
|
||||
@ -90,8 +91,7 @@ proc newWakuSwitch*(
|
||||
.new()
|
||||
.withRng(rng)
|
||||
.withMaxConnections(maxConnections)
|
||||
.withMaxIn(maxIn)
|
||||
.withMaxOut(maxOut)
|
||||
.withMaxInOut(maxIn, maxOut)
|
||||
.withMaxConnsPerPeer(maxConnsPerPeer)
|
||||
.withYamux()
|
||||
.withMplex(inTimeout, outTimeout)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user