Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/api_example/api_example.nim
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ when isMainModule:
echo "Failed to create default config: ", error
quit(QuitFailure)

# The CLI default is kernel-only; this example drives the messaging API.
conf.entryLayer = EntryLayer.channels

if args.ethRpcEndpoint == "":
# Create a basic configuration for the Waku node
# No RLN as we don't have an ETH RPC Endpoint
Expand Down
1 change: 1 addition & 0 deletions logos_delivery/api/conf/logos_delivery_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ proc init*(
let merged = merge(?resolvePreset(preset), messagingOverrides)
var kernelConf = ?toWakuNodeConf(merged, mode)
kernelConf.preset = preset
kernelConf.entryLayer = entryLayer
return ok(
LogosDeliveryConf(
kernelConf: KernelConf(kernelConf),
Expand Down
3 changes: 3 additions & 0 deletions logos_delivery/api/conf/messaging_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ proc toWakuNodeConf*(
# `LogosDelivery.new(WakuNodeConf)` re-application is idempotent instead of
# clobbering these flags with the field's default (`Core`).
conf.mode = mode
# Derived from a `MessagingClientConf`, so never kernel-only: don't inherit the
# CLI default. `LogosDeliveryConf.init` overwrites this with the caller's layer.
conf.entryLayer = EntryLayer.channels

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the level be "messaging" in this case? ( I might be missing something .)


if self.store.isSome():
conf.store = self.store.get()
Expand Down
7 changes: 7 additions & 0 deletions tests/wakunode2/test_cli_args.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ suite "Waku external config - default values":
let conf = res.get()
check conf.subscribeShards == defaultSubscribeShards

test "Default entry layer is kernel":
## Given
let preConfig = defaultWakuNodeConf().get()

## Then
check preConfig.entryLayer == EntryLayer.kernel

suite "Waku external config - apply preset":
test "Preset is TWN":
## Setup
Expand Down
2 changes: 1 addition & 1 deletion tools/confutils/cli_args.nim
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type WakuNodeConf* = object
entryLayer* {.
desc:
"Top API layer to run: kernel (transport only), messaging, or channels (messaging + reliable channels).",
defaultValue: EntryLayer.channels,
defaultValue: EntryLayer.kernel,
name: "entry-layer"
.}: EntryLayer

Expand Down
Loading