logos-delivery/waku/events/message_events.nim
Fabiana Cecin fd6370f3fa
Implement sub/unsub/receive
* Apply insights and constraints from early reviews
* Add support for Core/Relay sub/unsub/receive
* WIP Edge support (new EdgeDriver placeholder)
* Hook MessageReceivedInternalEvent to Kernel API bus
* Fix MAPI vs Kernel API unique relay handler support
* RecvService delegating topic subs to SubscriptionService
* SubscriptionService abstracts Core vs. Edge switching
* RecvService emits MessageReceivedEvent (fully filtered)
* Delete SubscriptionService.shardSubs
* Track relay shard sub with empty contentTopicSubs val
* Ensure relay shards never unsubscribed for Core for now
2026-02-24 19:48:34 -03:00

35 lines
976 B
Nim

import waku/[api/types, waku_core/message, waku_core/topics, common/broker/event_broker]
export types
EventBroker:
# Event emitted when a message is sent to the network
type MessageSentEvent* = object
requestId*: RequestId
messageHash*: string
EventBroker:
# Event emitted when a message send operation fails
type MessageErrorEvent* = object
requestId*: RequestId
messageHash*: string
error*: string
EventBroker:
# Confirmation that a message has been correctly delivered to some neighbouring nodes.
type MessagePropagatedEvent* = object
requestId*: RequestId
messageHash*: string
EventBroker:
# Event emitted when a message is received via Waku
type MessageReceivedEvent* = object
messageHash*: string
message*: WakuMessage
EventBroker:
# Internal event emitted when a message arrives from the network via any protocol
type MessageReceivedInternalEvent* = object
topic*: PubsubTopic
message*: WakuMessage