diff --git a/standards/application/waku-api.md b/standards/application/waku-api.md index 943a3b8..7ddf866 100644 --- a/standards/application/waku-api.md +++ b/standards/application/waku-api.md @@ -36,6 +36,8 @@ contributors: * [Event source](#event-source) * [Type definitions](#type-definitions-2) * [The Validation API](#the-validation-api) + * [Health Status](#health-status) + * [Event Source](#event-source) * [Security/Privacy Considerations](#securityprivacy-considerations) * [Copyright](#copyright) @@ -428,6 +430,61 @@ that would contain all validation parameters including RLN. In the time being, parameters specific to RLN are accepted for the message validation. RLN can also be disabled. +## Health Status + +#### Type definitions + +```yml +types: + HealthStatus: + type: enum + values: [Unhealthy, MinimallyHealthy, Healthy] + description: "Used to identify health of the operating node" +``` + +#### Extended definitions + +`Unhealthy` indicates that the node has lost connectivity for message reception, +sending, or both, and as a result, it cannot reliably receive or transmit messages. + +`MinimallyHealthy` indicates that the node meets the minimum operational requirements: +it is connected to at least one peer with a protocol to send messages ([LIGHTPUSH](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/19/lightpush.md) or [RELAY](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/11/relay.md)), +one peer with a protocol to receive messages ([FILTER](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/12/filter.md) or [RELAY](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/11/relay.md)), +and one peer with [STORE](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/13/store.md) service capabilities, +although performance or reliability may still be impacted. + +`Healthy` indicates that the node is operating optimally, +with full support for message reception and transmission. + +## Event Source + +#### Type definitions + +```yaml +types: + HealthStatusEvent: + type: object + fields: + eventType: + type: string + default: "health" + description: "Event type identifier" + status: + type: HealthStatus + description: "Node health status emitted on state change" + +EventSource: + type: object + description: "Event source for Waku API events" + fields: + onEvent: + type: function + description: "Callback for captured events" + parameters: + - name: event + type: HealthStatusEvent +``` + ## Security/Privacy Considerations See [WAKU2-ADVERSARIAL-MODELS](https://github.com/waku-org/specs/blob/master/informational/adversarial-models.md).