From 03609a2121f5e4b35d504dc14f63c0f3e99e42ff Mon Sep 17 00:00:00 2001 From: darshankabariya Date: Tue, 21 Jan 2025 00:39:22 +0530 Subject: [PATCH] chore: backward compitibility --- waku/factory/node_factory.nim | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index 668bf73684..e1bbf2238e 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -110,16 +110,18 @@ proc initNode( relayRatio = (maxRelayPeers.float / maxConnections.float) * 100 serviceRatio = 100 - relayRatio - # Override the relayServiceRatio in config - conf.relayServiceRatio = $relayRatio & ":" & $serviceRatio - + builder.withPeerManagerConfig( + maxConnections = conf.maxConnections, + relayServiceRatio = $relayRatio & ":" & $serviceRatio, + shardAware = conf.relayShardedPeerManagement, + ) error "maxRelayPeers is deprecated. It is recommended to use relayServiceRatio instead. If relayServiceRatio is not set, it will be automatically calculated based on maxConnections and maxRelayPeers." - - builder.withPeerManagerConfig( - maxConnections = conf.maxConnections, - relayServiceRatio = conf.relayServiceRatio, - shardAware = conf.relayShardedPeerManagement, - ) + else: + builder.withPeerManagerConfig( + maxConnections = conf.maxConnections, + relayServiceRatio = conf.relayServiceRatio, + shardAware = conf.relayShardedPeerManagement, + ) builder.withRateLimit(conf.rateLimits) builder.withCircuitRelay(relay)