mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-06-04 05:00:02 +00:00
Merge 89d1f87bfe2c565eddf05f8d2547cb3b45b14eb5 into 1494ebb96f321eb581decc5be19cbed94ef7feca
This commit is contained in:
commit
23871a7990
@ -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
|
||||
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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]
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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":
|
||||
|
||||
@ -10,6 +10,7 @@ import
|
||||
import
|
||||
waku/[
|
||||
waku_node,
|
||||
net/net_config,
|
||||
waku_core/topics,
|
||||
node/peer_manager,
|
||||
waku_enr,
|
||||
|
||||
@ -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],
|
||||
|
||||
@ -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],
|
||||
|
||||
@ -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
|
||||
|
||||
@ -17,6 +17,7 @@ import
|
||||
./validator_signed,
|
||||
../waku_enr/sharding,
|
||||
../waku_node,
|
||||
../net/net_config,
|
||||
../waku_core,
|
||||
../waku_core/codecs,
|
||||
../waku_rln_relay,
|
||||
|
||||
@ -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,
|
||||
|
||||
13
waku/node/edge_filter_sub_state.nim
Normal file
13
waku/node/edge_filter_sub_state.nim
Normal file
@ -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.}
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
@ -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.}
|
||||
11
waku/node/shard_subscription.nim
Normal file
11
waku/node/shard_subscription.nim
Normal file
@ -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.}
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user