mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-05 23:43:07 +00:00
simple library cleanup of unused imports and duplicated code (#2710)
This commit is contained in:
parent
044bbf8b40
commit
e9cde49ff0
@ -2,7 +2,7 @@
|
|||||||
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
||||||
{.passc: "-fPIC".}
|
{.passc: "-fPIC".}
|
||||||
|
|
||||||
import std/[json, sequtils, times, strformat, options, atomics, strutils]
|
import std/[json, strformat, strutils]
|
||||||
import chronicles, chronos
|
import chronicles, chronos
|
||||||
import
|
import
|
||||||
../../waku/common/base64,
|
../../waku/common/base64,
|
||||||
@ -10,7 +10,6 @@ import
|
|||||||
../../waku/node/waku_node,
|
../../waku/node/waku_node,
|
||||||
../../waku/waku_core/topics/pubsub_topic,
|
../../waku/waku_core/topics/pubsub_topic,
|
||||||
../../../waku/waku_relay/protocol,
|
../../../waku/waku_relay/protocol,
|
||||||
./events/json_base_event,
|
|
||||||
./events/json_message_event,
|
./events/json_message_event,
|
||||||
./waku_thread/waku_thread,
|
./waku_thread/waku_thread,
|
||||||
./waku_thread/inter_thread_communication/requests/node_lifecycle_request,
|
./waku_thread/inter_thread_communication/requests/node_lifecycle_request,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import std/[options, sequtils, strutils, json]
|
import std/json
|
||||||
import chronicles, chronos, stew/results, stew/shims/net
|
import chronicles, chronos, stew/results
|
||||||
import ../../../../waku/factory/waku, ../../../../waku/node/waku_node, ../../../alloc
|
import ../../../../waku/factory/waku, ../../../../waku/node/waku_node
|
||||||
|
|
||||||
type DebugNodeMsgType* = enum
|
type DebugNodeMsgType* = enum
|
||||||
RETRIEVE_LISTENING_ADDRESSES
|
RETRIEVE_LISTENING_ADDRESSES
|
||||||
|
|||||||
@ -1,29 +1,12 @@
|
|||||||
import std/[options, sequtils, json, strutils]
|
import std/[options, sequtils, json, strutils, net]
|
||||||
import chronos, chronicles, stew/results, stew/shims/net, confutils, confutils/std/net
|
import chronos, chronicles, stew/results, confutils, confutils/std/net
|
||||||
|
|
||||||
import
|
import
|
||||||
../../../../waku/common/enr/builder,
|
|
||||||
../../../../waku/waku_enr/capabilities,
|
|
||||||
../../../../waku/waku_enr/multiaddr,
|
|
||||||
../../../../waku/waku_enr/sharding,
|
|
||||||
../../../../waku/waku_core/message/message,
|
|
||||||
../../../../waku/waku_core/message/default_values,
|
|
||||||
../../../../waku/waku_core/topics/pubsub_topic,
|
|
||||||
../../../../waku/node/peer_manager/peer_manager,
|
../../../../waku/node/peer_manager/peer_manager,
|
||||||
../../../../waku/waku_core,
|
|
||||||
../../../../waku/factory/external_config,
|
../../../../waku/factory/external_config,
|
||||||
../../../../waku/factory/waku,
|
../../../../waku/factory/waku,
|
||||||
../../../../waku/node/config,
|
|
||||||
../../../../waku/waku_archive/driver/builder,
|
|
||||||
../../../../waku/waku_archive/driver,
|
|
||||||
../../../../waku/waku_archive/retention_policy/builder,
|
|
||||||
../../../../waku/waku_archive/retention_policy,
|
|
||||||
../../../../waku/waku_relay/protocol,
|
|
||||||
../../../../waku/waku_store,
|
|
||||||
../../../../waku/factory/builder,
|
|
||||||
../../../../waku/factory/node_factory,
|
../../../../waku/factory/node_factory,
|
||||||
../../../../waku/factory/networks_config,
|
../../../../waku/factory/networks_config,
|
||||||
../../../events/[json_message_event, json_base_event],
|
|
||||||
../../../alloc
|
../../../alloc
|
||||||
|
|
||||||
type NodeLifecycleMsgType* = enum
|
type NodeLifecycleMsgType* = enum
|
||||||
@ -65,28 +48,6 @@ proc createWaku(configJson: cstring): Future[Result[Waku, string]] {.async.} =
|
|||||||
except Exception:
|
except Exception:
|
||||||
return err("exception parsing configuration: " & getCurrentExceptionMsg())
|
return err("exception parsing configuration: " & getCurrentExceptionMsg())
|
||||||
|
|
||||||
# The Waku Network config (cluster-id=1)
|
|
||||||
if conf.clusterId == 1:
|
|
||||||
## TODO: This section is duplicated in wakunode2.nim. We need to move this to a common module
|
|
||||||
let twnClusterConf = ClusterConf.TheWakuNetworkConf()
|
|
||||||
if len(conf.shards) != 0:
|
|
||||||
conf.pubsubTopics = conf.shards.mapIt(twnClusterConf.pubsubTopics[it.uint16])
|
|
||||||
else:
|
|
||||||
conf.pubsubTopics = twnClusterConf.pubsubTopics
|
|
||||||
|
|
||||||
# Override configuration
|
|
||||||
conf.maxMessageSize = twnClusterConf.maxMessageSize
|
|
||||||
conf.clusterId = twnClusterConf.clusterId
|
|
||||||
conf.rlnRelay = twnClusterConf.rlnRelay
|
|
||||||
conf.rlnRelayEthContractAddress = twnClusterConf.rlnRelayEthContractAddress
|
|
||||||
conf.rlnRelayDynamic = twnClusterConf.rlnRelayDynamic
|
|
||||||
conf.rlnRelayBandwidthThreshold = twnClusterConf.rlnRelayBandwidthThreshold
|
|
||||||
conf.discv5Discovery = twnClusterConf.discv5Discovery
|
|
||||||
conf.discv5BootstrapNodes =
|
|
||||||
conf.discv5BootstrapNodes & twnClusterConf.discv5BootstrapNodes
|
|
||||||
conf.rlnEpochSizeSec = twnClusterConf.rlnEpochSizeSec
|
|
||||||
conf.rlnRelayUserMessageLimit = twnClusterConf.rlnRelayUserMessageLimit
|
|
||||||
|
|
||||||
let wakuRes = Waku.init(conf).valueOr:
|
let wakuRes = Waku.init(conf).valueOr:
|
||||||
error "waku initialization failed", error = error
|
error "waku initialization failed", error = error
|
||||||
return err("Failed setting up Waku: " & $error)
|
return err("Failed setting up Waku: " & $error)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import std/[options, sequtils, strutils]
|
import std/[sequtils, strutils]
|
||||||
import chronicles, chronos, stew/results, stew/shims/net
|
import chronicles, chronos, stew/results
|
||||||
import ../../../../waku/factory/waku, ../../../../waku/node/waku_node, ../../../alloc
|
import ../../../../waku/factory/waku, ../../../../waku/node/waku_node, ../../../alloc
|
||||||
|
|
||||||
type PeerManagementMsgType* = enum
|
type PeerManagementMsgType* = enum
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import std/[options, sequtils, strutils]
|
import std/net
|
||||||
import chronicles, chronos, stew/byteutils, stew/results, stew/shims/net
|
import chronicles, chronos, stew/byteutils, stew/results
|
||||||
import
|
import
|
||||||
../../../../../waku/waku_core/message/message,
|
../../../../../waku/waku_core/message/message,
|
||||||
../../../../../waku/factory/waku,
|
../../../../../waku/factory/waku,
|
||||||
|
|||||||
@ -1,13 +1,5 @@
|
|||||||
import std/[options, sequtils, strutils]
|
import chronos, stew/results
|
||||||
import chronos, stew/results, stew/shims/net
|
import ../../../../../waku/factory/waku, ../../../../alloc, ../../../../callback
|
||||||
import
|
|
||||||
../../../../../waku/factory/waku,
|
|
||||||
../../../../../waku/waku_archive/driver/builder,
|
|
||||||
../../../../../waku/waku_archive/driver,
|
|
||||||
../../../../../waku/waku_archive/retention_policy/builder,
|
|
||||||
../../../../../waku/waku_archive/retention_policy,
|
|
||||||
../../../../alloc,
|
|
||||||
../../../../callback
|
|
||||||
|
|
||||||
type StoreReqType* = enum
|
type StoreReqType* = enum
|
||||||
REMOTE_QUERY ## to perform a query to another Store node
|
REMOTE_QUERY ## to perform a query to another Store node
|
||||||
|
|||||||
@ -2,17 +2,11 @@
|
|||||||
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
||||||
{.passc: "-fPIC".}
|
{.passc: "-fPIC".}
|
||||||
|
|
||||||
import std/[json, sequtils, times, strformat, options, atomics, strutils, os]
|
import std/[options, atomics, os, net]
|
||||||
import
|
import
|
||||||
chronicles,
|
chronicles, chronos, chronos/threadsync, taskpools/channels_spsc_single, stew/results
|
||||||
chronos,
|
|
||||||
chronos/threadsync,
|
|
||||||
taskpools/channels_spsc_single,
|
|
||||||
stew/results,
|
|
||||||
stew/shims/net
|
|
||||||
import
|
import
|
||||||
../../../waku/factory/waku,
|
../../../waku/factory/waku,
|
||||||
../events/[json_message_event, json_base_event],
|
|
||||||
./inter_thread_communication/waku_thread_request,
|
./inter_thread_communication/waku_thread_request,
|
||||||
./inter_thread_communication/waku_thread_response
|
./inter_thread_communication/waku_thread_response
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user