From 89d1f87bfe2c565eddf05f8d2547cb3b45b14eb5 Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Wed, 3 Jun 2026 13:59:07 +0200 Subject: [PATCH] Rename kernel_api dir to waku_node and tidy node module layout Why these changes hang together: - Rename `waku/node/kernel_api/` to `waku/node/waku_node/`: the folder holds the node's protocol APIs, so it should carry the node's name rather than the legacy "kernel_api" label. - Collapse the old `kernel_api.nim` aggregator into the top-level `waku/waku_node.nim` barrel, and drop `net_config`/`health_monitor` from it. Those aren't the node's concern; consumers that used them now import them directly (clearer, explicit deps). - Move the `WakuNode` type from `node_types.nim` into `waku_node.nim`. `node_types.nim` only existed to dodge a `WakuNode`/`SubscriptionManager` import cycle that Nim actually handles fine, so the type now lives in one obvious home and the indirection module is deleted. - Extract `ShardSubscription` and `EdgeFilterSubState` into their own small modules: they are standalone value types with no back-reference to the node. `SubscriptionManager` stays with `WakuNode` on purpose (it is the node's subscription subsystem; the relationship is real). Verified: `wakunode2` and `libwaku` build; representative node tests pass. Co-Authored-By: Claude Opus 4.8 --- apps/wakucanary/wakucanary.nim | 1 + library/kernel_api/discovery_api.nim | 3 +- library/kernel_api/protocols/filter_api.nim | 3 +- library/kernel_api/protocols/relay_api.nim | 2 +- tests/api/test_api_subscription.nim | 2 +- tests/factory/test_node_factory.nim | 9 +- tests/node/test_wakunode_filter.nim | 3 +- tests/node/test_wakunode_health_monitor.nim | 8 +- tests/node/test_wakunode_legacy_lightpush.nim | 4 +- tests/node/test_wakunode_lightpush.nim | 10 +- tests/node/test_wakunode_peer_exchange.nim | 10 +- tests/node/test_wakunode_peer_manager.nim | 3 +- tests/node/test_wakunode_relay_rln.nim | 2 - tests/node/test_wakunode_sharding.nim | 3 +- tests/node/test_wakunode_store.nim | 3 +- tests/test_waku_keepalive.nim | 7 +- tests/testlib/wakunode.nim | 1 + tests/waku_discv5/test_waku_discv5.nim | 3 +- tests/waku_filter_v2/test_waku_client.nim | 3 +- waku/factory/builder.nim | 1 + waku/factory/node_factory.nim | 1 + waku/factory/waku.nim | 1 + waku/node/edge_filter_sub_state.nim | 13 ++ .../health_monitor/node_health_monitor.nim | 2 +- waku/node/kernel_api.nim | 9 -- waku/node/node_types.nim | 116 ------------------ waku/node/shard_subscription.nim | 11 ++ waku/node/subscription_manager.nim | 2 +- waku/node/waku_node.nim | 66 +++++++++- .../node/{kernel_api => waku_node}/filter.nim | 0 .../{kernel_api => waku_node}/lightpush.nim | 0 .../peer_exchange.nim | 0 waku/node/{kernel_api => waku_node}/ping.nim | 0 waku/node/{kernel_api => waku_node}/relay.nim | 0 waku/node/{kernel_api => waku_node}/store.nim | 0 waku/rest_api/endpoint/builder.nim | 1 + waku/rest_api/endpoint/health/handlers.nim | 3 +- waku/rest_api/endpoint/health/types.nim | 2 +- waku/waku_node.nim | 13 +- 39 files changed, 140 insertions(+), 181 deletions(-) create mode 100644 waku/node/edge_filter_sub_state.nim delete mode 100644 waku/node/kernel_api.nim delete mode 100644 waku/node/node_types.nim create mode 100644 waku/node/shard_subscription.nim rename waku/node/{kernel_api => waku_node}/filter.nim (100%) rename waku/node/{kernel_api => waku_node}/lightpush.nim (100%) rename waku/node/{kernel_api => waku_node}/peer_exchange.nim (100%) rename waku/node/{kernel_api => waku_node}/ping.nim (100%) rename waku/node/{kernel_api => waku_node}/relay.nim (100%) rename waku/node/{kernel_api => waku_node}/store.nim (100%) diff --git a/apps/wakucanary/wakucanary.nim b/apps/wakucanary/wakucanary.nim index e7b1ff9aa..f9023c45c 100644 --- a/apps/wakucanary/wakucanary.nim +++ b/apps/wakucanary/wakucanary.nim @@ -13,6 +13,7 @@ import import ./certsgenerator, waku/[waku_enr, node/peer_manager, waku_core, waku_node, factory/builder], + waku/net/net_config, waku/waku_metadata/protocol, waku/common/callbacks diff --git a/library/kernel_api/discovery_api.nim b/library/kernel_api/discovery_api.nim index f61b7bad1..882c91686 100644 --- a/library/kernel_api/discovery_api.nim +++ b/library/kernel_api/discovery_api.nim @@ -5,8 +5,7 @@ import waku/discovery/waku_dnsdisc, waku/discovery/waku_discv5, waku/waku_core/peers, - waku/node/waku_node, - waku/node/kernel_api, + waku/waku_node, library/declare_lib proc retrieveBootstrapNodes( diff --git a/library/kernel_api/protocols/filter_api.nim b/library/kernel_api/protocols/filter_api.nim index c4f99510a..866b70ca2 100644 --- a/library/kernel_api/protocols/filter_api.nim +++ b/library/kernel_api/protocols/filter_api.nim @@ -8,8 +8,7 @@ import waku/waku_filter_v2/common, waku/waku_core/subscription/push_handler, waku/node/peer_manager/peer_manager, - waku/node/waku_node, - waku/node/kernel_api, + waku/waku_node, waku/waku_core/topics/pubsub_topic, waku/waku_core/topics/content_topic, library/events/json_message_event, diff --git a/library/kernel_api/protocols/relay_api.nim b/library/kernel_api/protocols/relay_api.nim index b184d6011..4364a4170 100644 --- a/library/kernel_api/protocols/relay_api.nim +++ b/library/kernel_api/protocols/relay_api.nim @@ -7,7 +7,7 @@ import waku/waku_core/message, waku/waku_core/topics/pubsub_topic, waku/waku_core/topics, - waku/node/kernel_api/relay, + waku/node/waku_node/relay, waku/waku_relay/protocol, waku/node/peer_manager, library/events/json_message_event, diff --git a/tests/api/test_api_subscription.nim b/tests/api/test_api_subscription.nim index 8f587b535..7cb0e981a 100644 --- a/tests/api/test_api_subscription.nim +++ b/tests/api/test_api_subscription.nim @@ -14,7 +14,7 @@ import waku_core, events/message_events, waku_relay/protocol, - node/kernel_api/filter, + node/waku_node/filter, node/subscription_manager, ] import waku/factory/waku_conf diff --git a/tests/factory/test_node_factory.nim b/tests/factory/test_node_factory.nim index 1fe242532..63dd730c2 100644 --- a/tests/factory/test_node_factory.nim +++ b/tests/factory/test_node_factory.nim @@ -11,7 +11,14 @@ import import tests/testlib/[wakunode, wakucore], - waku/[waku_node, waku_enr, net/auto_port, discovery/waku_discv5, node/waku_metrics], + waku/[ + waku_node, + net/net_config, + waku_enr, + net/auto_port, + discovery/waku_discv5, + node/waku_metrics, + ], waku/factory/[ node_factory, internal_config, diff --git a/tests/node/test_wakunode_filter.nim b/tests/node/test_wakunode_filter.nim index 2777b0124..b0dbaa198 100644 --- a/tests/node/test_wakunode_filter.nim +++ b/tests/node/test_wakunode_filter.nim @@ -11,8 +11,7 @@ import waku/[ waku_core, node/peer_manager, - node/waku_node, - node/kernel_api, + waku_node, waku_filter_v2, waku_filter_v2/client, waku_filter_v2/subscriptions, diff --git a/tests/node/test_wakunode_health_monitor.nim b/tests/node/test_wakunode_health_monitor.nim index a85056d51..be779c586 100644 --- a/tests/node/test_wakunode_health_monitor.nim +++ b/tests/node/test_wakunode_health_monitor.nim @@ -16,10 +16,10 @@ import node/health_monitor/topic_health, node/health_monitor/node_health_monitor, messaging_client, - node/kernel_api/relay, - node/kernel_api/store, - node/kernel_api/lightpush, - node/kernel_api/filter, + node/waku_node/relay, + node/waku_node/store, + node/waku_node/lightpush, + node/waku_node/filter, events/health_events, events/peer_events, waku_archive, diff --git a/tests/node/test_wakunode_legacy_lightpush.nim b/tests/node/test_wakunode_legacy_lightpush.nim index 68c6cacde..cdd29b398 100644 --- a/tests/node/test_wakunode_legacy_lightpush.nim +++ b/tests/node/test_wakunode_legacy_lightpush.nim @@ -11,9 +11,7 @@ import waku/[ waku_core, node/peer_manager, - node/waku_node, - node/kernel_api, - node/kernel_api/lightpush, + waku_node, waku_lightpush_legacy, waku_lightpush_legacy/common, waku_lightpush_legacy/protocol_metrics, diff --git a/tests/node/test_wakunode_lightpush.nim b/tests/node/test_wakunode_lightpush.nim index b407327e3..4f5476701 100644 --- a/tests/node/test_wakunode_lightpush.nim +++ b/tests/node/test_wakunode_lightpush.nim @@ -8,15 +8,7 @@ import libp2p/crypto/crypto import - waku/[ - waku_core, - node/peer_manager, - node/waku_node, - node/kernel_api, - node/kernel_api/lightpush, - waku_lightpush, - waku_rln_relay, - ], + waku/[waku_core, node/peer_manager, waku_node, waku_lightpush, waku_rln_relay], ../testlib/[wakucore, wakunode, testasync, futures], ../resources/payloads, ../waku_rln_relay/[rln/waku_rln_relay_utils, utils_onchain] diff --git a/tests/node/test_wakunode_peer_exchange.nim b/tests/node/test_wakunode_peer_exchange.nim index 82ca25868..ac263c92f 100644 --- a/tests/node/test_wakunode_peer_exchange.nim +++ b/tests/node/test_wakunode_peer_exchange.nim @@ -13,14 +13,8 @@ import brokers/broker_context import - waku/[ - waku_node, - node/kernel_api, - discovery/waku_discv5, - waku_peer_exchange, - node/peer_manager, - waku_core, - ], + waku/ + [waku_node, discovery/waku_discv5, waku_peer_exchange, node/peer_manager, waku_core], ../waku_peer_exchange/utils, ../testlib/[wakucore, wakunode, testasync] diff --git a/tests/node/test_wakunode_peer_manager.nim b/tests/node/test_wakunode_peer_manager.nim index ed58db7fe..b0c4354cf 100644 --- a/tests/node/test_wakunode_peer_manager.nim +++ b/tests/node/test_wakunode_peer_manager.nim @@ -16,8 +16,7 @@ import waku/[ waku_core, node/peer_manager, - node/waku_node, - node/kernel_api, + waku_node, discovery/waku_discv5, waku_filter_v2/common, waku_relay/protocol, diff --git a/tests/node/test_wakunode_relay_rln.nim b/tests/node/test_wakunode_relay_rln.nim index 3a2a8a67c..b78255ce9 100644 --- a/tests/node/test_wakunode_relay_rln.nim +++ b/tests/node/test_wakunode_relay_rln.nim @@ -13,11 +13,9 @@ from std/times import epochTime import ../../../waku/[ - node/waku_node, node/peer_manager, waku_core, waku_node, - node/kernel_api, common/error_handling, waku_rln_relay, waku_rln_relay/rln, diff --git a/tests/node/test_wakunode_sharding.nim b/tests/node/test_wakunode_sharding.nim index f482b6abc..88bf63efa 100644 --- a/tests/node/test_wakunode_sharding.nim +++ b/tests/node/test_wakunode_sharding.nim @@ -14,8 +14,7 @@ import waku/[ waku_core/topics/pubsub_topic, waku_core/topics/sharding, - node/waku_node, - node/kernel_api, + waku_node, common/paging, waku_core, waku_store/common, diff --git a/tests/node/test_wakunode_store.nim b/tests/node/test_wakunode_store.nim index 01deb2903..daa1db682 100644 --- a/tests/node/test_wakunode_store.nim +++ b/tests/node/test_wakunode_store.nim @@ -5,8 +5,7 @@ import std/[options, sequtils, sets], testutils/unittests, chronos, libp2p/crypt import waku/[ common/paging, - node/waku_node, - node/kernel_api, + waku_node, node/peer_manager, waku_core, waku_core/message/digest, diff --git a/tests/test_waku_keepalive.nim b/tests/test_waku_keepalive.nim index 5d8402268..32cfb245d 100644 --- a/tests/test_waku_keepalive.nim +++ b/tests/test_waku_keepalive.nim @@ -9,7 +9,12 @@ import libp2p/stream/bufferstream, libp2p/stream/connection, libp2p/crypto/crypto -import waku/waku_core, waku/waku_node, ./testlib/wakucore, ./testlib/wakunode +import + waku/waku_core, + waku/waku_node, + waku/node/health_monitor, + ./testlib/wakucore, + ./testlib/wakunode suite "Waku Keepalive": asyncTest "handle ping keepalives": diff --git a/tests/testlib/wakunode.nim b/tests/testlib/wakunode.nim index 77c017d96..c23854f08 100644 --- a/tests/testlib/wakunode.nim +++ b/tests/testlib/wakunode.nim @@ -10,6 +10,7 @@ import import waku/[ waku_node, + net/net_config, waku_core/topics, node/peer_manager, waku_enr, diff --git a/tests/waku_discv5/test_waku_discv5.nim b/tests/waku_discv5/test_waku_discv5.nim index 36d34058c..58d7d5bb8 100644 --- a/tests/waku_discv5/test_waku_discv5.nim +++ b/tests/waku_discv5/test_waku_discv5.nim @@ -21,8 +21,7 @@ import waku_enr/capabilities, factory/conf_builder/conf_builder, factory/waku, - node/waku_node, - node/kernel_api, + waku_node, node/peer_manager, ], ../testlib/[wakucore, testasync, assertions, futures, wakunode, testutils], diff --git a/tests/waku_filter_v2/test_waku_client.nim b/tests/waku_filter_v2/test_waku_client.nim index c57699d39..b34c22018 100644 --- a/tests/waku_filter_v2/test_waku_client.nim +++ b/tests/waku_filter_v2/test_waku_client.nim @@ -3,7 +3,8 @@ import std/[options, sequtils, json], testutils/unittests, results, chronos import - waku/node/[peer_manager, waku_node, kernel_api], + waku/node/peer_manager, + waku/waku_node, waku/waku_core, waku/waku_filter_v2/[common, client, subscriptions, protocol, rpc_codec], ../testlib/[wakucore, testasync, testutils, futures, sequtils, wakunode], diff --git a/waku/factory/builder.nim b/waku/factory/builder.nim index 4212cb92d..953d95a34 100644 --- a/waku/factory/builder.nim +++ b/waku/factory/builder.nim @@ -15,6 +15,7 @@ import ../waku_enr, ../discovery/waku_discv5, ../waku_node, + ../net/net_config, ../node/peer_manager, ../common/rate_limit/setting, ../common/utils/parse_size_units diff --git a/waku/factory/node_factory.nim b/waku/factory/node_factory.nim index 52b719b8f..2a2b6e5d9 100644 --- a/waku/factory/node_factory.nim +++ b/waku/factory/node_factory.nim @@ -17,6 +17,7 @@ import ./validator_signed, ../waku_enr/sharding, ../waku_node, + ../net/net_config, ../waku_core, ../waku_core/codecs, ../waku_rln_relay, diff --git a/waku/factory/waku.nim b/waku/factory/waku.nim index ee70cf713..edd02ade8 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -34,6 +34,7 @@ import common/logging, node/peer_manager, node/health_monitor, + net/net_config, node/waku_metrics, node/subscription_manager, rest_api/message_cache, diff --git a/waku/node/edge_filter_sub_state.nim b/waku/node/edge_filter_sub_state.nim new file mode 100644 index 000000000..9863f876a --- /dev/null +++ b/waku/node/edge_filter_sub_state.nim @@ -0,0 +1,13 @@ +{.push raises: [].} + +import std/sets +import chronos, libp2p/peerid +import ../waku_core, ./health_monitor/topic_health + +type EdgeFilterSubState* = object + peers*: seq[RemotePeerInfo] + pending*: seq[Future[void]] + pendingPeers*: HashSet[PeerId] + currentHealth*: TopicHealth + +{.pop.} diff --git a/waku/node/health_monitor/node_health_monitor.nim b/waku/node/health_monitor/node_health_monitor.nim index 98c0f6c7a..e5c941191 100644 --- a/waku/node/health_monitor/node_health_monitor.nim +++ b/waku/node/health_monitor/node_health_monitor.nim @@ -16,7 +16,7 @@ import node/waku_node, node/node_telemetry, node/peer_manager, - node/kernel_api, + node/waku_node/ping, node/health_monitor/online_monitor, node/health_monitor/health_status, node/health_monitor/health_report, diff --git a/waku/node/kernel_api.nim b/waku/node/kernel_api.nim deleted file mode 100644 index 9d19acb07..000000000 --- a/waku/node/kernel_api.nim +++ /dev/null @@ -1,9 +0,0 @@ -import - ./kernel_api/filter as filter_api, - ./kernel_api/lightpush as lightpush_api, - ./kernel_api/store as store_api, - ./kernel_api/relay as relay_api, - ./kernel_api/peer_exchange as peer_exchange_api, - ./kernel_api/ping as ping_api - -export filter_api, lightpush_api, store_api, relay_api, peer_exchange_api, ping_api diff --git a/waku/node/node_types.nim b/waku/node/node_types.nim deleted file mode 100644 index f5c2a56b6..000000000 --- a/waku/node/node_types.nim +++ /dev/null @@ -1,116 +0,0 @@ -{.push raises: [].} - -import - std/[options, tables, sets], - chronos, - results, - eth/keys, - bearssl/rand, - eth/p2p/discoveryv5/enr, - libp2p/crypto/crypto, - libp2p/[multiaddress, multicodec], - libp2p/protocols/ping, - libp2p/protocols/mix/mix_protocol, - brokers/broker_context - -import - waku/[ - waku_core, - waku_relay, - waku_archive, - waku_store/protocol as store, - waku_store/client as store_client, - waku_store/resume, - waku_store_sync, - waku_filter_v2, - waku_filter_v2/client as filter_client, - waku_metadata, - waku_rendezvous/protocol, - waku_rendezvous/client as rendezvous_client, - waku_lightpush_legacy/client as legacy_lightpush_client, - waku_lightpush_legacy as legacy_lightpush_protocol, - waku_lightpush/client as lightpush_client, - waku_lightpush as lightpush_protocol, - waku_peer_exchange, - waku_rln_relay, - waku_mix, - common/rate_limit/setting, - discovery/waku_kademlia, - net/bound_ports, - events/peer_events, - ], - ./peer_manager, - ./health_monitor/topic_health - -# key and crypto modules different -type - # TODO: Move to application instance (e.g., `WakuNode2`) - WakuInfo* = object # NOTE One for simplicity, can extend later as needed - listenAddresses*: seq[string] - enrUri*: string #multiaddrStrings*: seq[string] - mixPubKey*: Option[string] - - # NOTE based on Eth2Node in NBC eth2_network.nim - WakuNode* = ref object - peerManager*: PeerManager - switch*: Switch - wakuRelay*: WakuRelay - wakuArchive*: waku_archive.WakuArchive - wakuStore*: store.WakuStore - wakuStoreClient*: store_client.WakuStoreClient - wakuStoreResume*: StoreResume - wakuStoreReconciliation*: SyncReconciliation - wakuStoreTransfer*: SyncTransfer - wakuFilter*: waku_filter_v2.WakuFilter - wakuFilterClient*: filter_client.WakuFilterClient - wakuRlnRelay*: WakuRLNRelay - wakuLegacyLightPush*: WakuLegacyLightPush - wakuLegacyLightpushClient*: WakuLegacyLightPushClient - wakuLightPush*: WakuLightPush - wakuLightpushClient*: WakuLightPushClient - wakuPeerExchange*: WakuPeerExchange - wakuPeerExchangeClient*: WakuPeerExchangeClient - wakuMetadata*: WakuMetadata - wakuAutoSharding*: Option[Sharding] - enr*: enr.Record - libp2pPing*: Ping - rng*: ref rand.HmacDrbgContext - brokerCtx*: BrokerContext - wakuRendezvous*: WakuRendezVous - wakuRendezvousClient*: rendezvous_client.WakuRendezVousClient - announcedAddresses*: seq[MultiAddress] - extMultiAddrsOnly*: bool # When true, skip automatic IP address replacement - started*: bool # Indicates that node has started listening - topicSubscriptionQueue*: AsyncEventQueue[SubscriptionEvent] - rateLimitSettings*: ProtocolRateLimitSettings - legacyAppHandlers*: Table[PubsubTopic, WakuRelayHandler] - ## Kernel API Relay appHandlers (if any) - subscriptionManager*: SubscriptionManager - wakuMix*: WakuMix - kademliaDiscoveryLoop*: Future[void] - wakuKademlia*: WakuKademlia - ports*: BoundPorts - - ShardSubscription* = object - contentTopics*: HashSet[ContentTopic] - directShardSub*: bool - ## shard subscribed directly (PubsubSub), independent of content-topic interest - - EdgeFilterSubState* = object - peers*: seq[RemotePeerInfo] - pending*: seq[Future[void]] - pendingPeers*: HashSet[PeerId] - currentHealth*: TopicHealth - - SubscriptionManager* = ref object of RootObj - node*: WakuNode - shards*: Table[PubsubTopic, ShardSubscription] - edgeFilterSubStates*: Table[PubsubTopic, EdgeFilterSubState] - edgeFilterWakeup*: AsyncEvent - edgeFilterSubLoopFut*: Future[void] - edgeFilterConnectionLoopFut*: Future[void] - peerEventListener*: WakuPeerEventListener - ownsEdgeShardHealthProvider*: bool - ownsEdgeFilterPeerCountProvider*: bool - -{.pop.} diff --git a/waku/node/shard_subscription.nim b/waku/node/shard_subscription.nim new file mode 100644 index 000000000..9801fb32d --- /dev/null +++ b/waku/node/shard_subscription.nim @@ -0,0 +1,11 @@ +{.push raises: [].} + +import std/sets +import ../waku_core + +type ShardSubscription* = object + contentTopics*: HashSet[ContentTopic] + directShardSub*: bool + ## shard subscribed directly (PubsubSub), independent of content-topic interest + +{.pop.} diff --git a/waku/node/subscription_manager.nim b/waku/node/subscription_manager.nim index eaafa11c3..57a0c664d 100644 --- a/waku/node/subscription_manager.nim +++ b/waku/node/subscription_manager.nim @@ -6,7 +6,7 @@ import waku/[ waku_core, waku_core/topics/sharding, - node/node_types, + node/waku_node, node/node_telemetry, waku_relay, waku_archive, diff --git a/waku/node/waku_node.nim b/waku/node/waku_node.nim index 9ac3c5d00..6a8826d2a 100644 --- a/waku/node/waku_node.nim +++ b/waku/node/waku_node.nim @@ -67,7 +67,11 @@ import ./peer_manager, ./health_monitor/health_status, ./health_monitor/topic_health, - ./node_telemetry + ./node_telemetry, + ./shard_subscription, + ./edge_filter_sub_state + +export shard_subscription, edge_filter_sub_state logScope: topics = "waku node" @@ -85,8 +89,64 @@ const clientId* = "Nimbus Waku v2 node" const WakuNodeVersionString* = "version / git commit hash: " & git_version -import ./node_types -export node_types +type + # TODO: Move to application instance (e.g., `WakuNode2`) + WakuInfo* = object # NOTE One for simplicity, can extend later as needed + listenAddresses*: seq[string] + enrUri*: string #multiaddrStrings*: seq[string] + mixPubKey*: Option[string] + + # NOTE based on Eth2Node in NBC eth2_network.nim + WakuNode* = ref object + peerManager*: PeerManager + switch*: Switch + wakuRelay*: WakuRelay + wakuArchive*: waku_archive.WakuArchive + wakuStore*: store.WakuStore + wakuStoreClient*: store_client.WakuStoreClient + wakuStoreResume*: StoreResume + wakuStoreReconciliation*: SyncReconciliation + wakuStoreTransfer*: SyncTransfer + wakuFilter*: waku_filter_v2.WakuFilter + wakuFilterClient*: filter_client.WakuFilterClient + wakuRlnRelay*: WakuRLNRelay + wakuLegacyLightPush*: WakuLegacyLightPush + wakuLegacyLightpushClient*: WakuLegacyLightPushClient + wakuLightPush*: WakuLightPush + wakuLightpushClient*: WakuLightPushClient + wakuPeerExchange*: WakuPeerExchange + wakuPeerExchangeClient*: WakuPeerExchangeClient + wakuMetadata*: WakuMetadata + wakuAutoSharding*: Option[Sharding] + enr*: enr.Record + libp2pPing*: Ping + rng*: ref rand.HmacDrbgContext + brokerCtx*: BrokerContext + wakuRendezvous*: WakuRendezVous + wakuRendezvousClient*: rendezvous_client.WakuRendezVousClient + announcedAddresses*: seq[MultiAddress] + extMultiAddrsOnly*: bool # When true, skip automatic IP address replacement + started*: bool # Indicates that node has started listening + topicSubscriptionQueue*: AsyncEventQueue[SubscriptionEvent] + rateLimitSettings*: ProtocolRateLimitSettings + legacyAppHandlers*: Table[PubsubTopic, WakuRelayHandler] + ## Kernel API Relay appHandlers (if any) + subscriptionManager*: SubscriptionManager + wakuMix*: WakuMix + kademliaDiscoveryLoop*: Future[void] + wakuKademlia*: WakuKademlia + ports*: BoundPorts + + SubscriptionManager* = ref object of RootObj + node*: WakuNode + shards*: Table[PubsubTopic, ShardSubscription] + edgeFilterSubStates*: Table[PubsubTopic, EdgeFilterSubState] + edgeFilterWakeup*: AsyncEvent + edgeFilterSubLoopFut*: Future[void] + edgeFilterConnectionLoopFut*: Future[void] + peerEventListener*: WakuPeerEventListener + ownsEdgeShardHealthProvider*: bool + ownsEdgeFilterPeerCountProvider*: bool import ./subscription_manager diff --git a/waku/node/kernel_api/filter.nim b/waku/node/waku_node/filter.nim similarity index 100% rename from waku/node/kernel_api/filter.nim rename to waku/node/waku_node/filter.nim diff --git a/waku/node/kernel_api/lightpush.nim b/waku/node/waku_node/lightpush.nim similarity index 100% rename from waku/node/kernel_api/lightpush.nim rename to waku/node/waku_node/lightpush.nim diff --git a/waku/node/kernel_api/peer_exchange.nim b/waku/node/waku_node/peer_exchange.nim similarity index 100% rename from waku/node/kernel_api/peer_exchange.nim rename to waku/node/waku_node/peer_exchange.nim diff --git a/waku/node/kernel_api/ping.nim b/waku/node/waku_node/ping.nim similarity index 100% rename from waku/node/kernel_api/ping.nim rename to waku/node/waku_node/ping.nim diff --git a/waku/node/kernel_api/relay.nim b/waku/node/waku_node/relay.nim similarity index 100% rename from waku/node/kernel_api/relay.nim rename to waku/node/waku_node/relay.nim diff --git a/waku/node/kernel_api/store.nim b/waku/node/waku_node/store.nim similarity index 100% rename from waku/node/kernel_api/store.nim rename to waku/node/waku_node/store.nim diff --git a/waku/rest_api/endpoint/builder.nim b/waku/rest_api/endpoint/builder.nim index 9b4ecf662..16cdde988 100644 --- a/waku/rest_api/endpoint/builder.nim +++ b/waku/rest_api/endpoint/builder.nim @@ -4,6 +4,7 @@ import net, tables import presto import waku/waku_node, + waku/node/health_monitor, waku/discovery/waku_discv5, waku/rest_api/message_cache, waku/rest_api/handlers, diff --git a/waku/rest_api/endpoint/health/handlers.nim b/waku/rest_api/endpoint/health/handlers.nim index 865133245..dc7588d16 100644 --- a/waku/rest_api/endpoint/health/handlers.nim +++ b/waku/rest_api/endpoint/health/handlers.nim @@ -1,7 +1,8 @@ {.push raises: [].} import chronicles, json_serialization, presto/route -import ../../../waku_node, ../responses, ../serdes, ./types +import + ../../../waku_node, ../../../node/health_monitor, ../responses, ../serdes, ./types logScope: topics = "waku node rest health_api" diff --git a/waku/rest_api/endpoint/health/types.nim b/waku/rest_api/endpoint/health/types.nim index 88fa736a8..4f85ebde5 100644 --- a/waku/rest_api/endpoint/health/types.nim +++ b/waku/rest_api/endpoint/health/types.nim @@ -3,7 +3,7 @@ import results import chronicles, json_serialization, json_serialization/std/options import ../serdes -import waku/[waku_node, api/types] +import waku/[waku_node, api/types, node/health_monitor] #### Serialization and deserialization diff --git a/waku/waku_node.nim b/waku/waku_node.nim index c8b13d4ea..674ac96e6 100644 --- a/waku/waku_node.nim +++ b/waku/waku_node.nim @@ -1,8 +1,13 @@ import - ./net/net_config, ./node/waku_switch as switch, ./node/waku_node as node, - ./node/health_monitor as health_monitor, - ./node/kernel_api as kernel_api + ./node/waku_node/filter as filter_api, + ./node/waku_node/lightpush as lightpush_api, + ./node/waku_node/store as store_api, + ./node/waku_node/relay as relay_api, + ./node/waku_node/peer_exchange as peer_exchange_api, + ./node/waku_node/ping as ping_api -export net_config, switch, node, health_monitor, kernel_api +export + switch, node, filter_api, lightpush_api, store_api, relay_api, peer_exchange_api, + ping_api