chore: clarify api folders (#3637)

* Rename waku_api to rest_api and underlying rest to endpoint for clearity
* Rename node/api to node/kernel_api to suggest that it is an internal accessor to node interface + make everything compile after renaming
* make waku api a top level import
* fix use of relative path imports and use default to root rather in case of waku and tools modules
This commit is contained in:
NagyZoltanPeter 2025-11-15 23:31:09 +01:00 committed by GitHub
parent 262d33e394
commit 1762548741
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
92 changed files with 162 additions and 147 deletions

View File

@ -240,7 +240,7 @@ proc stop*(cmb: Chat2MatterBridge) {.async: (raises: [Exception]).} =
{.pop.} {.pop.}
# @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError # @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
when isMainModule: when isMainModule:
import waku/common/utils/nat, waku/waku_api/message_cache import waku/common/utils/nat, waku/rest_api/message_cache
let let
rng = newRng() rng = newRng()

View File

@ -14,7 +14,7 @@ import
libp2p/wire libp2p/wire
import import
../../tools/confutils/cli_args, tools/confutils/cli_args,
waku/[ waku/[
node/peer_manager, node/peer_manager,
waku_lightpush/common, waku_lightpush/common,

View File

@ -11,7 +11,7 @@ import
confutils confutils
import import
../../tools/confutils/cli_args, tools/confutils/cli_args,
waku/[ waku/[
common/enr, common/enr,
common/logging, common/logging,

View File

@ -77,7 +77,7 @@ proc maintainSubscription(
some(filterPubsubTopic), filterContentTopic, actualFilterPeer some(filterPubsubTopic), filterContentTopic, actualFilterPeer
) )
).errorOr: ).errorOr:
await sleepAsync(subscriptionMaintenanceMs) await sleepAsync(SubscriptionMaintenanceMs)
if noFailedSubscribes > 0: if noFailedSubscribes > 0:
noFailedSubscribes -= 1 noFailedSubscribes -= 1
notice "subscribe request successful." notice "subscribe request successful."

View File

@ -11,7 +11,7 @@ import
libp2p/wire libp2p/wire
import import
../wakunode2/cli_args, tools/confutils/cli_args,
waku/[ waku/[
common/enr, common/enr,
waku_node, waku_node,

View File

@ -8,6 +8,8 @@ import
results, results,
libp2p/peerid libp2p/peerid
from std/sugar import `=>`
import ./tester_message, ./lpt_metrics import ./tester_message, ./lpt_metrics
type type

View File

@ -6,7 +6,7 @@ import
json_serialization/std/options, json_serialization/std/options,
json_serialization/lexer json_serialization/lexer
import ../../waku/waku_api/rest/serdes import waku/rest_api/endpoint/serdes
type ProtocolTesterMessage* = object type ProtocolTesterMessage* = object
sender*: string sender*: string

View File

@ -14,7 +14,7 @@ import
common/logging, common/logging,
factory/waku, factory/waku,
node/health_monitor, node/health_monitor,
waku_api/rest/builder as rest_server_builder, rest_api/endpoint/builder as rest_server_builder,
waku_core/message/default_values, waku_core/message/default_values,
] ]

View File

@ -1,6 +1,6 @@
{.push raises: [].} {.push raises: [].}
import ../../apps/wakunode2/cli_args import tools/confutils/cli_args
import waku/[common/logging, factory/[waku, networks_config]] import waku/[common/logging, factory/[waku, networks_config]]
import import
std/[options, strutils, os, sequtils], std/[options, strutils, os, sequtils],

View File

@ -6,7 +6,7 @@ import
../../../waku/discovery/waku_discv5, ../../../waku/discovery/waku_discv5,
../../../waku/waku_core/peers, ../../../waku/waku_core/peers,
../../../waku/node/waku_node, ../../../waku/node/waku_node,
../../../waku/node/api, ../../../waku/node/kernel_api,
../../alloc ../../alloc
type DiscoveryMsgType* = enum type DiscoveryMsgType* = enum

View File

@ -2,13 +2,15 @@ import std/[options, json, strutils, net]
import chronos, chronicles, results, confutils, confutils/std/net import chronos, chronicles, results, confutils, confutils/std/net
import import
../../../waku/node/peer_manager/peer_manager, waku/node/peer_manager/peer_manager,
../../../tools/confutils/cli_args, tools/confutils/cli_args,
../../../waku/factory/waku, waku/factory/waku,
../../../waku/factory/node_factory, waku/factory/node_factory,
../../../waku/factory/networks_config, waku/factory/networks_config,
../../../waku/factory/app_callbacks, waku/factory/app_callbacks,
../../../waku/waku_api/rest/builder, waku/rest_api/endpoint/builder
import
../../alloc ../../alloc
type NodeLifecycleMsgType* = enum type NodeLifecycleMsgType* = enum

View File

@ -8,7 +8,7 @@ import
../../../../waku/waku_core/subscription/push_handler, ../../../../waku/waku_core/subscription/push_handler,
../../../../waku/node/peer_manager/peer_manager, ../../../../waku/node/peer_manager/peer_manager,
../../../../waku/node/waku_node, ../../../../waku/node/waku_node,
../../../../waku/node/api, ../../../../waku/node/kernel_api,
../../../../waku/waku_core/topics/pubsub_topic, ../../../../waku/waku_core/topics/pubsub_topic,
../../../../waku/waku_core/topics/content_topic, ../../../../waku/waku_core/topics/content_topic,
../../../alloc ../../../alloc

View File

@ -1,16 +1,18 @@
import std/[net, sequtils, strutils] import std/[net, sequtils, strutils]
import chronicles, chronos, stew/byteutils, results import chronicles, chronos, stew/byteutils, results
import import
../../../../waku/waku_core/message/message, waku/waku_core/message/message,
../../../../waku/factory/[validator_signed, waku], waku/factory/[validator_signed, waku],
../../../../tools/confutils/cli_args, tools/confutils/cli_args,
../../../../waku/waku_node, waku/waku_node,
../../../../waku/waku_core/message, waku/waku_core/message,
../../../../waku/waku_core/time, # Timestamp waku/waku_core/time, # Timestamp
../../../../waku/waku_core/topics/pubsub_topic, waku/waku_core/topics/pubsub_topic,
../../../../waku/waku_core/topics, waku/waku_core/topics,
../../../../waku/waku_relay/protocol, waku/waku_relay/protocol,
../../../../waku/node/peer_manager, waku/node/peer_manager
import
../../../alloc ../../../alloc
type RelayMsgType* = enum type RelayMsgType* = enum

View File

@ -12,7 +12,7 @@ import
waku_core, waku_core,
node/peer_manager, node/peer_manager,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
waku_filter_v2, waku_filter_v2,
waku_filter_v2/client, waku_filter_v2/client,
waku_filter_v2/subscriptions, waku_filter_v2/subscriptions,

View File

@ -12,7 +12,7 @@ import
waku_core, waku_core,
node/peer_manager, node/peer_manager,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
waku_lightpush_legacy, waku_lightpush_legacy,
waku_lightpush_legacy/common, waku_lightpush_legacy/common,
waku_lightpush_legacy/protocol_metrics, waku_lightpush_legacy/protocol_metrics,

View File

@ -6,7 +6,7 @@ import
waku/[ waku/[
common/paging, common/paging,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
node/peer_manager, node/peer_manager,
waku_core, waku_core,
waku_store_legacy, waku_store_legacy,

View File

@ -12,7 +12,7 @@ import
waku_core, waku_core,
node/peer_manager, node/peer_manager,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
waku_lightpush, waku_lightpush,
waku_rln_relay, waku_rln_relay,
], ],

View File

@ -14,7 +14,7 @@ import
import import
waku/[ waku/[
waku_node, waku_node,
node/api, node/kernel_api,
discovery/waku_discv5, discovery/waku_discv5,
waku_peer_exchange, waku_peer_exchange,
node/peer_manager, node/peer_manager,

View File

@ -17,7 +17,7 @@ import
waku_core, waku_core,
node/peer_manager, node/peer_manager,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
discovery/waku_discv5, discovery/waku_discv5,
waku_filter_v2/common, waku_filter_v2/common,
waku_relay/protocol, waku_relay/protocol,

View File

@ -17,7 +17,7 @@ import
node/peer_manager, node/peer_manager,
waku_core, waku_core,
waku_node, waku_node,
node/api, node/kernel_api,
common/error_handling, common/error_handling,
waku_rln_relay, waku_rln_relay,
waku_rln_relay/rln, waku_rln_relay/rln,

View File

@ -16,7 +16,7 @@ import
waku_core/topics/sharding, waku_core/topics/sharding,
waku_store_legacy/common, waku_store_legacy/common,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
common/paging, common/paging,
waku_core, waku_core,
waku_store/common, waku_store/common,

View File

@ -6,7 +6,7 @@ import
waku/[ waku/[
common/paging, common/paging,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
node/peer_manager, node/peer_manager,
waku_core, waku_core,
waku_core/message/digest, waku_core/message/digest,

View File

@ -1,7 +1,7 @@
{.used.} {.used.}
import std/[sets, random], results, stew/byteutils, testutils/unittests import std/[sets, random], results, stew/byteutils, testutils/unittests
import waku/waku_core, waku/waku_api/message_cache, ./testlib/wakucore import waku/waku_core, waku/rest_api/message_cache, ./testlib/wakucore
randomize() randomize()

View File

@ -22,7 +22,7 @@ import
factory/conf_builder/conf_builder, factory/conf_builder/conf_builder,
factory/waku, factory/waku,
node/waku_node, node/waku_node,
node/api, node/kernel_api,
node/peer_manager, node/peer_manager,
], ],
../testlib/[wakucore, testasync, assertions, futures, wakunode, testutils], ../testlib/[wakucore, testasync, assertions, futures, wakunode, testutils],

View File

@ -3,7 +3,7 @@
import std/[options, sequtils, json], testutils/unittests, results, chronos import std/[options, sequtils, json], testutils/unittests, results, chronos
import import
waku/node/[peer_manager, waku_node, api], waku/node/[peer_manager, waku_node, kernel_api],
waku/waku_core, waku/waku_core,
waku/waku_filter_v2/[common, client, subscriptions, protocol, rpc_codec], waku/waku_filter_v2/[common, client, subscriptions, protocol, rpc_codec],
../testlib/[wakucore, testasync, testutils, futures, sequtils, wakunode], ../testlib/[wakucore, testasync, testutils, futures, sequtils, wakunode],

View File

@ -14,12 +14,12 @@ import
waku_node, waku_node,
waku_filter_v2/client, waku_filter_v2/client,
node/peer_manager, node/peer_manager,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/admin/types, rest_api/endpoint/admin/types,
waku_api/rest/admin/handlers as admin_api, rest_api/endpoint/admin/handlers as admin_rest_interface,
waku_api/rest/admin/client as admin_api_client, rest_api/endpoint/admin/client as admin_rest_client,
waku_relay, waku_relay,
waku_peer_exchange, waku_peer_exchange,
], ],

View File

@ -11,8 +11,8 @@ import
waku/[ waku/[
waku_node, waku_node,
node/waku_node as waku_node2, node/waku_node as waku_node2,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/debug/handlers as debug_api, rest_api/endpoint/debug/handlers as debug_rest_interface,
], ],
../testlib/common, ../testlib/common,
../testlib/wakucore, ../testlib/wakucore,

View File

@ -12,11 +12,11 @@ import
waku_node, waku_node,
node/waku_node as waku_node2, node/waku_node as waku_node2,
# TODO: Remove after moving `git_version` to the app code. # TODO: Remove after moving `git_version` to the app code.
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/debug/handlers as debug_api, rest_api/endpoint/debug/handlers as debug_rest_interface,
waku_api/rest/debug/client as debug_api_client, rest_api/endpoint/debug/client as debug_rest_client,
], ],
../testlib/common, ../testlib/common,
../testlib/wakucore, ../testlib/wakucore,

View File

@ -1,7 +1,7 @@
{.used.} {.used.}
import results, stew/byteutils, testutils/unittests, json_serialization import results, stew/byteutils, testutils/unittests, json_serialization
import waku/waku_api/rest/serdes, waku/waku_api/rest/debug/types import waku/rest_api/endpoint/serdes, waku/rest_api/endpoint/debug/types
suite "Waku v2 REST API - Debug - serialization": suite "Waku v2 REST API - Debug - serialization":
suite "DebugWakuInfo - decode": suite "DebugWakuInfo - decode":

View File

@ -9,21 +9,21 @@ import
libp2p/crypto/crypto libp2p/crypto/crypto
import import
waku/[ waku/[
waku_api/message_cache, rest_api/message_cache,
waku_core, waku_core,
waku_node, waku_node,
node/peer_manager, node/peer_manager,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/filter/types, rest_api/endpoint/filter/types,
waku_api/rest/filter/handlers as filter_api, rest_api/endpoint/filter/handlers as filter_rest_interface,
waku_api/rest/filter/client as filter_api_client, rest_api/endpoint/filter/client as filter_rest_client,
waku_relay, waku_relay,
waku_filter_v2/subscriptions, waku_filter_v2/subscriptions,
waku_filter_v2/common, waku_filter_v2/common,
waku_api/rest/relay/handlers as relay_api, rest_api/endpoint/relay/handlers as relay_rest_interface,
waku_api/rest/relay/client as relay_api_client, rest_api/endpoint/relay/client as relay_rest_client,
], ],
../testlib/wakucore, ../testlib/wakucore,
../testlib/wakunode ../testlib/wakunode

View File

@ -13,11 +13,11 @@ import
waku_node, waku_node,
node/waku_node as waku_node2, node/waku_node as waku_node2,
# TODO: Remove after moving `git_version` to the app code. # TODO: Remove after moving `git_version` to the app code.
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/health/handlers as health_api, rest_api/endpoint/health/handlers as health_rest_interface,
waku_api/rest/health/client as health_api_client, rest_api/endpoint/health/client as health_rest_client,
waku_rln_relay, waku_rln_relay,
node/health_monitor, node/health_monitor,
], ],

View File

@ -10,17 +10,17 @@ import
import import
waku/[ waku/[
waku_api/message_cache, rest_api/message_cache,
waku_core, waku_core,
waku_node, waku_node,
node/peer_manager, node/peer_manager,
waku_lightpush/common, waku_lightpush/common,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/lightpush/types, rest_api/endpoint/lightpush/types,
waku_api/rest/lightpush/handlers as lightpush_api, rest_api/endpoint/lightpush/handlers as lightpush_rest_interface,
waku_api/rest/lightpush/client as lightpush_api_client, rest_api/endpoint/lightpush/client as lightpush_rest_client,
waku_relay, waku_relay,
common/rate_limit/setting, common/rate_limit/setting,
], ],

View File

@ -10,17 +10,17 @@ import
import import
waku/[ waku/[
waku_api/message_cache, rest_api/message_cache,
waku_core, waku_core,
waku_node, waku_node,
node/peer_manager, node/peer_manager,
waku_lightpush_legacy/common, waku_lightpush_legacy/common,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/legacy_lightpush/types, rest_api/endpoint/legacy_lightpush/types,
waku_api/rest/legacy_lightpush/handlers as lightpush_api, rest_api/endpoint/legacy_lightpush/handlers as lightpush_rest_interface,
waku_api/rest/legacy_lightpush/client as lightpush_api_client, rest_api/endpoint/legacy_lightpush/client as lightpush_rest_client,
waku_relay, waku_relay,
common/rate_limit/setting, common/rate_limit/setting,
], ],

View File

@ -12,13 +12,13 @@ import
common/base64, common/base64,
waku_core, waku_core,
waku_node, waku_node,
waku_api/message_cache, rest_api/message_cache,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/relay/types, rest_api/endpoint/relay/types,
waku_api/rest/relay/handlers as relay_api, rest_api/endpoint/relay/handlers as relay_rest_interface,
waku_api/rest/relay/client as relay_api_client, rest_api/endpoint/relay/client as relay_rest_client,
waku_relay, waku_relay,
waku_rln_relay, waku_rln_relay,
], ],

View File

@ -1,7 +1,9 @@
{.used.} {.used.}
import results, stew/byteutils, unittest2, json_serialization import results, stew/byteutils, unittest2, json_serialization
import waku/[common/base64, waku_api/rest/serdes, waku_api/rest/relay/types, waku_core] import
waku/
[common/base64, rest_api/endpoint/serdes, rest_api/endpoint/relay/types, waku_core]
suite "Waku v2 Rest API - Relay - serialization": suite "Waku v2 Rest API - Relay - serialization":
suite "RelayWakuMessage - decode": suite "RelayWakuMessage - decode":

View File

@ -1,9 +1,9 @@
{.used.} {.used.}
import results, stew/byteutils, chronicles, unittest2, json_serialization import results, stew/byteutils, chronicles, unittest2, json_serialization
import waku/waku_api/rest/serdes, waku/waku_api/rest/debug/types import waku/rest_api/endpoint/serdes, waku/rest_api/endpoint/debug/types
# TODO: Decouple this test suite from the `debug_api` module by defining # TODO: Decouple this test suite from the `debug_rest_interface` module by defining
# private custom types for this test suite module # private custom types for this test suite module
suite "Waku v2 Rest API - Serdes": suite "Waku v2 Rest API - Serdes":
suite "decode": suite "decode":

View File

@ -17,12 +17,12 @@ import
waku_core/time, waku_core/time,
waku_node, waku_node,
node/peer_manager, node/peer_manager,
waku_api/rest/server, rest_api/endpoint/server,
waku_api/rest/client, rest_api/endpoint/client,
waku_api/rest/responses, rest_api/endpoint/responses,
waku_api/rest/store/handlers as store_api, rest_api/endpoint/store/handlers as store_rest_interface,
waku_api/rest/store/client as store_api_client, rest_api/endpoint/store/client as store_rest_client,
waku_api/rest/store/types, rest_api/endpoint/store/types,
waku_archive, waku_archive,
waku_archive/driver/queue_driver, waku_archive/driver/queue_driver,
waku_archive/driver/sqlite_driver, waku_archive/driver/sqlite_driver,
@ -34,7 +34,7 @@ import
../testlib/wakunode ../testlib/wakunode
logScope: logScope:
topics = "waku node rest store_api test" topics = "waku node rest store_rest_interface test"
proc put( proc put(
store: ArchiveDriver, pubsubTopic: PubsubTopic, message: WakuMessage store: ArchiveDriver, pubsubTopic: PubsubTopic, message: WakuMessage

View File

@ -34,7 +34,9 @@ import
import ./envvar as confEnvvarDefs, ./envvar_net as confEnvvarNet import ./envvar as confEnvvarDefs, ./envvar_net as confEnvvarNet
export confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet, ProtectedShard export
confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet, ProtectedShard,
DefaultMaxWakuMessageSizeStr
logScope: logScope:
topics = "waku cli args" topics = "waku cli args"

3
waku/api.nim Normal file
View File

@ -0,0 +1,3 @@
import ./api/[api, api_conf, entry_nodes]
export api, api_conf, entry_nodes

View File

@ -28,9 +28,9 @@ import
../node/health_monitor, ../node/health_monitor,
../node/waku_metrics, ../node/waku_metrics,
../node/delivery_monitor/delivery_monitor, ../node/delivery_monitor/delivery_monitor,
../waku_api/message_cache, ../rest_api/message_cache,
../waku_api/rest/server, ../rest_api/endpoint/server,
../waku_api/rest/builder as rest_server_builder, ../rest_api/endpoint/builder as rest_server_builder,
../waku_archive, ../waku_archive,
../waku_relay/protocol, ../waku_relay/protocol,
../discovery/waku_dnsdisc, ../discovery/waku_dnsdisc,

View File

@ -9,7 +9,7 @@ import
import import
../waku_rln_relay/rln_relay, ../waku_rln_relay/rln_relay,
../waku_api/rest/builder, ../rest_api/endpoint/builder,
../discovery/waku_discv5, ../discovery/waku_discv5,
../node/waku_metrics, ../node/waku_metrics,
../common/logging, ../common/logging,

View File

@ -1,9 +0,0 @@
import
./api/filter as filter_api,
./api/lightpush as lightpush_api,
./api/store as store_api,
./api/relay as relay_api,
./api/peer_exchange as peer_exchange_api,
./api/ping as ping_api
export filter_api, lightpush_api, store_api, relay_api, peer_exchange_api, ping_api

View File

@ -8,7 +8,7 @@ import
import import
../waku_node, ../waku_node,
../api, ../kernel_api,
../../waku_rln_relay, ../../waku_rln_relay,
../../waku_relay, ../../waku_relay,
../peer_manager, ../peer_manager,

9
waku/node/kernel_api.nim Normal file
View File

@ -0,0 +1,9 @@
import
./kernel_api/filter as filter_api,
./kernel_api/lightpush as lightpush_api,
./kernel_api/store as store_api,
./kernel_api/relay as relay_api,
./kernel_api/peer_exchange as peer_exchange_api,
./kernel_api/ping as ping_api
export filter_api, lightpush_api, store_api, relay_api, peer_exchange_api, ping_api

View File

@ -5,18 +5,18 @@ import presto
import import
waku/waku_node, waku/waku_node,
waku/discovery/waku_discv5, waku/discovery/waku_discv5,
waku/waku_api/message_cache, waku/rest_api/message_cache,
waku/waku_api/handlers, waku/rest_api/handlers,
waku/waku_api/rest/server, waku/rest_api/endpoint/server,
waku/waku_api/rest/debug/handlers as rest_debug_api, waku/rest_api/endpoint/debug/handlers as rest_debug_endpoint,
waku/waku_api/rest/relay/handlers as rest_relay_api, waku/rest_api/endpoint/relay/handlers as rest_relay_endpoint,
waku/waku_api/rest/filter/handlers as rest_filter_api, waku/rest_api/endpoint/filter/handlers as rest_filter_endpoint,
waku/waku_api/rest/legacy_lightpush/handlers as rest_legacy_lightpush_api, waku/rest_api/endpoint/legacy_lightpush/handlers as rest_legacy_lightpush_endpoint,
waku/waku_api/rest/lightpush/handlers as rest_lightpush_api, waku/rest_api/endpoint/lightpush/handlers as rest_lightpush_endpoint,
waku/waku_api/rest/store/handlers as rest_store_api, waku/rest_api/endpoint/store/handlers as rest_store_endpoint,
waku/waku_api/rest/legacy_store/handlers as rest_store_legacy_api, waku/rest_api/endpoint/legacy_store/handlers as rest_store_legacy_endpoint,
waku/waku_api/rest/health/handlers as rest_health_api, waku/rest_api/endpoint/health/handlers as rest_health_endpoint,
waku/waku_api/rest/admin/handlers as rest_admin_api, waku/rest_api/endpoint/admin/handlers as rest_admin_endpoint,
waku/waku_core/topics, waku/waku_core/topics,
waku/waku_relay/protocol waku/waku_relay/protocol
@ -180,7 +180,7 @@ proc startRestServerProtocolSupport*(
else: else:
none(DiscoveryHandler) none(DiscoveryHandler)
rest_filter_api.installFilterRestApiHandlers( rest_filter_endpoint.installFilterRestApiHandlers(
router, node, filterCache, filterDiscoHandler router, node, filterCache, filterDiscoHandler
) )
else: else:
@ -193,8 +193,8 @@ proc startRestServerProtocolSupport*(
else: else:
none(DiscoveryHandler) none(DiscoveryHandler)
rest_store_api.installStoreApiHandlers(router, node, storeDiscoHandler) rest_store_endpoint.installStoreApiHandlers(router, node, storeDiscoHandler)
rest_store_legacy_api.installStoreApiHandlers(router, node, storeDiscoHandler) rest_store_legacy_endpoint.installStoreApiHandlers(router, node, storeDiscoHandler)
## Light push API ## Light push API
## Install it either if client is mounted) ## Install it either if client is mounted)
@ -208,10 +208,12 @@ proc startRestServerProtocolSupport*(
else: else:
none(DiscoveryHandler) none(DiscoveryHandler)
rest_legacy_lightpush_api.installLightPushRequestHandler( rest_legacy_lightpush_endpoint.installLightPushRequestHandler(
router, node, lightDiscoHandler
)
rest_lightpush_endpoint.installLightPushRequestHandler(
router, node, lightDiscoHandler router, node, lightDiscoHandler
) )
rest_lightpush_api.installLightPushRequestHandler(router, node, lightDiscoHandler)
else: else:
restServerNotInstalledTab["lightpush"] = "/lightpush endpoints are not available." restServerNotInstalledTab["lightpush"] = "/lightpush endpoints are not available."

View File

@ -1,3 +0,0 @@
import ./waku_api/message_cache, ./waku_api/rest, ./waku_api/json_rpc
export message_cache, rest

View File

@ -31,7 +31,7 @@ proc computeDigest*(msg: WakuMessage): MessageDigest =
# Computes the hash # Computes the hash
return ctx.finish() return ctx.finish()
## Public API types ## API types
type type
#TODO Once Store v2 is removed, the cursor becomes the hash of the last message #TODO Once Store v2 is removed, the cursor becomes the hash of the last message

View File

@ -3,6 +3,6 @@ import
./node/waku_switch as switch, ./node/waku_switch as switch,
./node/waku_node as node, ./node/waku_node as node,
./node/health_monitor as health_monitor, ./node/health_monitor as health_monitor,
./node/api as api ./node/kernel_api as kernel_api
export net_config, switch, node, health_monitor, api export net_config, switch, node, health_monitor, kernel_api

3
waku/waku_rest.nim Normal file
View File

@ -0,0 +1,3 @@
import ./rest_api/message_cache, ./rest_api/endpoint, ./rest_api/json_rpc
export message_cache, rest

View File

@ -15,7 +15,7 @@ const
type WakuStoreResult*[T] = Result[T, string] type WakuStoreResult*[T] = Result[T, string]
## Public API types ## API types
type type
StoreQueryRequest* = object StoreQueryRequest* = object

View File

@ -29,7 +29,7 @@ proc computeDigest*(msg: WakuMessage): MessageDigest =
# Computes the hash # Computes the hash
return ctx.finish() return ctx.finish()
## Public API types ## API types
type type
HistoryCursor* = object HistoryCursor* = object