From 681f38a388ff6fd8b310470b2e6dc7c34f8b2f83 Mon Sep 17 00:00:00 2001 From: Sasha Date: Tue, 21 Oct 2025 01:19:16 +0200 Subject: [PATCH] add EventSource and address comments --- standards/application/waku-api.md | 66 +++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/standards/application/waku-api.md b/standards/application/waku-api.md index 3d6fe83..406d32e 100644 --- a/standards/application/waku-api.md +++ b/standards/application/waku-api.md @@ -321,10 +321,6 @@ types: type: bool default: false description: "Whether the message is ephemeral. Read at [ATTRIBUTES](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/14/message.md#message-attributes)" - rateLimitProof: - type: array - default: none - description: "Rate limiting proof needed for [PUBLISHING](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/17/rln-relay.md#publishing)" RequestId: type: string @@ -347,11 +343,67 @@ functions: #### Extended definitions -When `message` is sent with `contentTopic` for a first time, +When `message` is sent with `contentTopic` for the first time, the node SHOULD trigger a subscription based on `Subscribe to messages` section. -Additionally, the node SHOULD initiate recurring [STORE](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/13/store.md) queries -to validate if sent message was stored on the network and `static_store_nodes` SHOULD be prioritised. +The node uses [P2P-RELIABILITY](/standards/application/p2p-reliability.md) strategies to ensure message delivery. + +## Event source + +#### Type definitions + +```yaml +types: + MessageSentEvent: + type: object + fields: + eventType: + type: string + default: "message:sent" + description: "Event type identifier" + requestId: + type: RequestId + description: "The request ID associated with the sent message" + + MessageErrorEvent: + type: object + fields: + eventType: + type: string + default: "message:error" + description: "Event type identifier" + requestId: + type: RequestId + description: "The request ID associated with the failed message" + error: + type: string + description: "Error message describing what went wrong" + + MessageAckEvent: + type: object + fields: + eventType: + type: string + default: "message:ack" + description: "Event type identifier" + requestId: + type: RequestId + description: "The request ID associated with the acknowledged message" + ackType: + type: string + description: "Type of acknowledgment (e.g., 'store', 'filter')" + + EventSource: + type: object + description: "Event source for message-related events" + fields: + onEvent: + type: function + description: "Callback for message:sent events" + parameters: + - name: event + type: MessageSentEvent | MessageErrorEvent | MessageAckEvent +``` ## The Validation API