You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document specifies an Application Programming Interface (API) that is RECOMMENDED for developers of the [WAKU2](https://github.com/vacp2p/rfc-index/blob/7b443c1aab627894e3f22f5adfbb93f4c4eac4f6/waku/standards/core/10/waku2.md) clients to implement,
40
46
and for consumers to use as a single entry point to its functionalities.
41
47
42
-
This API defines the RECOMMENDED interface for leveraging Waku protocols to send and receive messages.
48
+
This API defines the RECOMMENDED interface for leveraging Waku protocols to send and receive messages.
43
49
Application developers SHOULD use it to access capabilities for peer discovery, message routing, and peer-to-peer reliability.
44
50
45
-
TODO: This spec must be further extended to include connection health inspection, message sending, subscription and store hash queries.
51
+
TODO: This spec must be further extended to include connection health inspection, subscription, and store hash queries.
46
52
47
53
## Motivation
48
54
@@ -72,9 +78,10 @@ An alternative would be to choose a programming language. However, such choice m
72
78
- Primitive types are `string`, `int`, `bool`, `byte`, `enum` and `uint`
73
79
- Complex pre-defined types are:
74
80
-`object`: object and other nested types.
75
-
-`array`: iterable object containing values of all the same type.
81
+
-`array`: iterable object containing values of all the same type. Syntax: `array<T>` where `T` is the element type (e.g., `array<string>`, `array<byte>`).
76
82
-`result`: an enum type that either contains a value or void (success), or an error (failure); The error is left to the implementor.
77
83
-`error`: Left to the implementor on whether `error` types are `string` or `object` in the given language.
84
+
-`event_emitter`: an object that emits events with specific event names and associated event data types.
78
85
- Usage of `result` is RECOMMENDED, usage of exceptions is NOT RECOMMENDED, no matter the language.
79
86
80
87
TODO: Review whether to specify categories of errors.
@@ -90,11 +97,13 @@ language_mappings:
90
97
- functions: "camelCase"
91
98
- variables: "camelCase"
92
99
- types: "PascalCase"
100
+
event_emitter: "Use EventEmitter object with `emit`, `addListener`, etc; with event name the string specified in IDL. For example. eventEmitter.emit('message:sent',...)"
93
101
nim:
94
102
naming_convention:
95
103
- functions: "camelCase"
96
104
- variables: "camelCase"
97
105
- types: "PascalCase"
106
+
event_emitter: TBD
98
107
```
99
108
100
109
### Application
@@ -118,6 +127,10 @@ types:
118
127
WakuNode:
119
128
type: object
120
129
description: "A Waku node instance."
130
+
fields:
131
+
message_events:
132
+
type: MessageEvents
133
+
description: "Message related events."
121
134
122
135
NodeConfig:
123
136
type: object
@@ -151,6 +164,7 @@ types:
151
164
description: "The passed nodes are prioritised for store queries."
152
165
cluster_id:
153
166
type: uint
167
+
description: "The cluster ID for the Waku network. Cluster IDs are defined in [RELAY-SHARDING](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/51/relay-sharding.md) and allocated in [RELAY-STATIC-SHARD-ALLOC](https://github.com/waku-org/specs/blob/master/informational/relay-static-shard-alloc.md)."
154
168
auto_sharding_config:
155
169
type: AutoShardingConfig
156
170
default: DefaultAutoShardingConfig
@@ -201,10 +215,10 @@ types:
201
215
fields:
202
216
contract_address:
203
217
type: string
204
-
description: "The address of the RLN contract exposes `root` and `getMerkleRoot` ABIs"
218
+
description: "The address of the RLN contract that exposes `root` and `getMerkleRoot` ABIs"
205
219
chain_id:
206
220
type: uint
207
-
description: "The chain id on which the RLN contract is deployed"
221
+
description: "The chain ID on which the RLN contract is deployed"
208
222
epoch_size_sec:
209
223
type: uint
210
224
description: "The epoch size to use for RLN, in seconds"
@@ -224,15 +238,6 @@ functions:
224
238
type: result<WakuNode, error>
225
239
```
226
240
227
-
#### Property definitions
228
-
229
-
```yaml
230
-
properties:
231
-
events:
232
-
type: EventEmitter
233
-
description: "Event source for message-related events"
0 commit comments