Skip to content

Commit 2443b05

Browse files
committed
chore: rename Waku API's "Waku Config" to "Protocols" Config
Make it clearer that with this config, we are configuring the Waku protocols, in contrast to other parameters which are more executable related.
1 parent bc8acf7 commit 2443b05

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

examples/waku_example.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ when isMainModule:
1616
if (args.ethRpcEndpoint == ""):
1717
# Create a basic configuration for the Waku node
1818
# No RLN as we don't have an ETH RPC Endpoint
19-
NodeConfig.init(wakuConfig = WakuConfig.init(entryNodes = @[], clusterId = 42))
19+
NodeConfig.init(wakuConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 42))
2020
else:
2121
# Connect to TWN, use ETH RPC Endpoint for RLN
2222
NodeConfig.init(ethRpcEndpoints = @[args.ethRpcEndpoint])

tests/api/test_node_conf.nim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ suite "LibWaku Conf - toWakuConf":
2323

2424
test "Core mode configuration":
2525
## Given
26-
let wakuConfig = WakuConfig.init(entryNodes = @[], clusterId = 1)
26+
let wakuConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 1)
2727

2828
let nodeConfig = NodeConfig.init(mode = Core, wakuConfig = wakuConfig)
2929

@@ -44,7 +44,7 @@ suite "LibWaku Conf - toWakuConf":
4444
## Given
4545
let nodeConfig = NodeConfig.init(
4646
mode = Core,
47-
wakuConfig = WakuConfig.init(
47+
wakuConfig = ProtocolsConfig.init(
4848
entryNodes = @[],
4949
staticStoreNodes = @[],
5050
clusterId = 42,
@@ -73,7 +73,7 @@ suite "LibWaku Conf - toWakuConf":
7373
let libConf = NodeConfig.init(
7474
mode = Core,
7575
wakuConfig =
76-
WakuConfig.init(entryNodes = entryNodes, staticStoreNodes = @[], clusterId = 1),
76+
ProtocolsConfig.init(entryNodes = entryNodes, staticStoreNodes = @[], clusterId = 1),
7777
)
7878

7979
## When
@@ -95,7 +95,7 @@ suite "LibWaku Conf - toWakuConf":
9595
"/ip4/192.168.1.1/tcp/60001/p2p/16Uuu2HBmAcHvhLqQKwSSbX6BG5JLWUDRcaLVrehUVqpw7fz1hbYd",
9696
]
9797
let nodeConf = NodeConfig.init(
98-
wakuConfig = WakuConfig.init(
98+
wakuConfig = ProtocolsConfig.init(
9999
entryNodes = @[], staticStoreNodes = staticStoreNodes, clusterId = 1
100100
)
101101
)
@@ -113,7 +113,7 @@ suite "LibWaku Conf - toWakuConf":
113113
test "Message validation with max message size":
114114
## Given
115115
let nodeConfig = NodeConfig.init(
116-
wakuConfig = WakuConfig.init(
116+
wakuConfig = ProtocolsConfig.init(
117117
entryNodes = @[],
118118
staticStoreNodes = @[],
119119
clusterId = 1,
@@ -135,7 +135,7 @@ suite "LibWaku Conf - toWakuConf":
135135
test "Message validation with RLN config":
136136
## Given
137137
let nodeConfig = NodeConfig.init(
138-
wakuConfig = WakuConfig.init(
138+
wakuConfig = ProtocolsConfig.init(
139139
entryNodes = @[],
140140
clusterId = 1,
141141
messageValidation = MessageValidation(
@@ -174,7 +174,7 @@ suite "LibWaku Conf - toWakuConf":
174174
## Given
175175
let nodeConfig = NodeConfig.init(
176176
mode = Core,
177-
wakuConfig = WakuConfig.init(
177+
wakuConfig = ProtocolsConfig.init(
178178
entryNodes =
179179
@[
180180
"enr:-QESuEC1p_s3xJzAC_XlOuuNrhVUETmfhbm1wxRGis0f7DlqGSw2FM-p2Vn7gmfkTTnAe8Ys2cgGBN8ufJnvzKQFZqFMBgmlkgnY0iXNlY3AyNTZrMaEDS8-D878DrdbNwcuY-3p1qdDp5MOoCurhdsNPJTXZ3c5g3RjcIJ2X4N1ZHCCd2g"
@@ -255,7 +255,7 @@ suite "LibWaku Conf - toWakuConf":
255255
let nodeConfig = NodeConfig.init(
256256
mode = Core,
257257
wakuConfig =
258-
WakuConfig.init(entryNodes = entryNodes, staticStoreNodes = @[], clusterId = 1),
258+
ProtocolsConfig.init(entryNodes = entryNodes, staticStoreNodes = @[], clusterId = 1),
259259
)
260260

261261
## When

tests/test_waku.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ suite "Waku API - Create node":
88
asyncTest "Create node with minimal configuration":
99
## Given
1010
let nodeConfig =
11-
NodeConfig.init(wakuConfig = WakuConfig.init(entryNodes = @[], clusterId = 1))
11+
NodeConfig.init(wakuConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 1))
1212

1313
# This is the actual minimal config but as the node auto-start, it is not suitable for tests
1414
# NodeConfig.init(ethRpcEndpoints = @["http://someaddress"])
@@ -27,7 +27,7 @@ suite "Waku API - Create node":
2727
## Given
2828
let nodeConfig = NodeConfig.init(
2929
mode = Core,
30-
wakuConfig = WakuConfig.init(
30+
wakuConfig = ProtocolsConfig.init(
3131
entryNodes =
3232
@[
3333
"enr:-QESuEC1p_s3xJzAC_XlOuuNrhVUETmfhbm1wxRGis0f7DlqGSw2FM-p2Vn7gmfkTTnAe8Ys2cgGBN8ufJnvzKQFZqFMBgmlkgnY0iXNlY3AyNTZrMaEDS8-D878DrdbNwcuY-3p1qdDp5MOoCurhdsNPJTXZ3c5g3RjcIJ2X4N1ZHCCd2g"
@@ -63,7 +63,7 @@ suite "Waku API - Create node":
6363
## Given
6464
let nodeConfig = NodeConfig.init(
6565
mode = Core,
66-
wakuConfig = WakuConfig.init(
66+
wakuConfig = ProtocolsConfig.init(
6767
entryNodes =
6868
@[
6969
"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",

waku/api/api_conf.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type MessageValidation* {.requiresInit.} = object
2626
maxMessageSize*: string # Accepts formats like "150 KiB", "1500 B"
2727
rlnConfig*: Option[RlnConfig]
2828

29-
type WakuConfig* {.requiresInit.} = object
29+
type ProtocolsConfig* {.requiresInit.} = object
3030
entryNodes: seq[string]
3131
staticStoreNodes: seq[string]
3232
clusterId: uint16
@@ -42,7 +42,7 @@ const DefaultMessageValidation* =
4242
MessageValidation(maxMessageSize: "150 KiB", rlnConfig: none(RlnConfig))
4343

4444
proc init*(
45-
T: typedesc[WakuConfig],
45+
T: typedesc[ProtocolsConfig],
4646
entryNodes: seq[string],
4747
staticStoreNodes: seq[string] = @[],
4848
clusterId: uint16,
@@ -57,7 +57,7 @@ proc init*(
5757
messageValidation: messageValidation,
5858
)
5959

60-
const TheWakuNetworkPreset* = WakuConfig(
60+
const TheWakuNetworkPreset* = ProtocolsConfig(
6161
entryNodes:
6262
@[
6363
"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im"
@@ -83,14 +83,14 @@ type WakuMode* {.pure.} = enum
8383

8484
type NodeConfig* {.requiresInit.} = object
8585
mode: WakuMode
86-
wakuConfig: WakuConfig
86+
wakuConfig: ProtocolsConfig
8787
networkingConfig: NetworkingConfig
8888
ethRpcEndpoints: seq[string]
8989

9090
proc init*(
9191
T: typedesc[NodeConfig],
9292
mode: WakuMode = WakuMode.Core,
93-
wakuConfig: WakuConfig = TheWakuNetworkPreset,
93+
wakuConfig: ProtocolsConfig = TheWakuNetworkPreset,
9494
networkingConfig: NetworkingConfig = DefaultNetworkingConfig,
9595
ethRpcEndpoints: seq[string] = @[],
9696
): T =

0 commit comments

Comments
 (0)