mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 05:53:11 +00:00
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:
parent
262d33e394
commit
1762548741
@ -240,7 +240,7 @@ proc stop*(cmb: Chat2MatterBridge) {.async: (raises: [Exception]).} =
|
||||
{.pop.}
|
||||
# @TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
|
||||
when isMainModule:
|
||||
import waku/common/utils/nat, waku/waku_api/message_cache
|
||||
import waku/common/utils/nat, waku/rest_api/message_cache
|
||||
|
||||
let
|
||||
rng = newRng()
|
||||
|
||||
@ -14,7 +14,7 @@ import
|
||||
libp2p/wire
|
||||
|
||||
import
|
||||
../../tools/confutils/cli_args,
|
||||
tools/confutils/cli_args,
|
||||
waku/[
|
||||
node/peer_manager,
|
||||
waku_lightpush/common,
|
||||
|
||||
@ -11,7 +11,7 @@ import
|
||||
confutils
|
||||
|
||||
import
|
||||
../../tools/confutils/cli_args,
|
||||
tools/confutils/cli_args,
|
||||
waku/[
|
||||
common/enr,
|
||||
common/logging,
|
||||
|
||||
@ -77,7 +77,7 @@ proc maintainSubscription(
|
||||
some(filterPubsubTopic), filterContentTopic, actualFilterPeer
|
||||
)
|
||||
).errorOr:
|
||||
await sleepAsync(subscriptionMaintenanceMs)
|
||||
await sleepAsync(SubscriptionMaintenanceMs)
|
||||
if noFailedSubscribes > 0:
|
||||
noFailedSubscribes -= 1
|
||||
notice "subscribe request successful."
|
||||
|
||||
@ -11,7 +11,7 @@ import
|
||||
libp2p/wire
|
||||
|
||||
import
|
||||
../wakunode2/cli_args,
|
||||
tools/confutils/cli_args,
|
||||
waku/[
|
||||
common/enr,
|
||||
waku_node,
|
||||
|
||||
@ -8,6 +8,8 @@ import
|
||||
results,
|
||||
libp2p/peerid
|
||||
|
||||
from std/sugar import `=>`
|
||||
|
||||
import ./tester_message, ./lpt_metrics
|
||||
|
||||
type
|
||||
|
||||
@ -6,7 +6,7 @@ import
|
||||
json_serialization/std/options,
|
||||
json_serialization/lexer
|
||||
|
||||
import ../../waku/waku_api/rest/serdes
|
||||
import waku/rest_api/endpoint/serdes
|
||||
|
||||
type ProtocolTesterMessage* = object
|
||||
sender*: string
|
||||
|
||||
@ -14,7 +14,7 @@ import
|
||||
common/logging,
|
||||
factory/waku,
|
||||
node/health_monitor,
|
||||
waku_api/rest/builder as rest_server_builder,
|
||||
rest_api/endpoint/builder as rest_server_builder,
|
||||
waku_core/message/default_values,
|
||||
]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{.push raises: [].}
|
||||
|
||||
import ../../apps/wakunode2/cli_args
|
||||
import tools/confutils/cli_args
|
||||
import waku/[common/logging, factory/[waku, networks_config]]
|
||||
import
|
||||
std/[options, strutils, os, sequtils],
|
||||
|
||||
@ -6,7 +6,7 @@ import
|
||||
../../../waku/discovery/waku_discv5,
|
||||
../../../waku/waku_core/peers,
|
||||
../../../waku/node/waku_node,
|
||||
../../../waku/node/api,
|
||||
../../../waku/node/kernel_api,
|
||||
../../alloc
|
||||
|
||||
type DiscoveryMsgType* = enum
|
||||
|
||||
@ -2,13 +2,15 @@ import std/[options, json, strutils, net]
|
||||
import chronos, chronicles, results, confutils, confutils/std/net
|
||||
|
||||
import
|
||||
../../../waku/node/peer_manager/peer_manager,
|
||||
../../../tools/confutils/cli_args,
|
||||
../../../waku/factory/waku,
|
||||
../../../waku/factory/node_factory,
|
||||
../../../waku/factory/networks_config,
|
||||
../../../waku/factory/app_callbacks,
|
||||
../../../waku/waku_api/rest/builder,
|
||||
waku/node/peer_manager/peer_manager,
|
||||
tools/confutils/cli_args,
|
||||
waku/factory/waku,
|
||||
waku/factory/node_factory,
|
||||
waku/factory/networks_config,
|
||||
waku/factory/app_callbacks,
|
||||
waku/rest_api/endpoint/builder
|
||||
|
||||
import
|
||||
../../alloc
|
||||
|
||||
type NodeLifecycleMsgType* = enum
|
||||
|
||||
@ -8,7 +8,7 @@ import
|
||||
../../../../waku/waku_core/subscription/push_handler,
|
||||
../../../../waku/node/peer_manager/peer_manager,
|
||||
../../../../waku/node/waku_node,
|
||||
../../../../waku/node/api,
|
||||
../../../../waku/node/kernel_api,
|
||||
../../../../waku/waku_core/topics/pubsub_topic,
|
||||
../../../../waku/waku_core/topics/content_topic,
|
||||
../../../alloc
|
||||
|
||||
@ -1,16 +1,18 @@
|
||||
import std/[net, sequtils, strutils]
|
||||
import chronicles, chronos, stew/byteutils, results
|
||||
import
|
||||
../../../../waku/waku_core/message/message,
|
||||
../../../../waku/factory/[validator_signed, waku],
|
||||
../../../../tools/confutils/cli_args,
|
||||
../../../../waku/waku_node,
|
||||
../../../../waku/waku_core/message,
|
||||
../../../../waku/waku_core/time, # Timestamp
|
||||
../../../../waku/waku_core/topics/pubsub_topic,
|
||||
../../../../waku/waku_core/topics,
|
||||
../../../../waku/waku_relay/protocol,
|
||||
../../../../waku/node/peer_manager,
|
||||
waku/waku_core/message/message,
|
||||
waku/factory/[validator_signed, waku],
|
||||
tools/confutils/cli_args,
|
||||
waku/waku_node,
|
||||
waku/waku_core/message,
|
||||
waku/waku_core/time, # Timestamp
|
||||
waku/waku_core/topics/pubsub_topic,
|
||||
waku/waku_core/topics,
|
||||
waku/waku_relay/protocol,
|
||||
waku/node/peer_manager
|
||||
|
||||
import
|
||||
../../../alloc
|
||||
|
||||
type RelayMsgType* = enum
|
||||
|
||||
@ -12,7 +12,7 @@ import
|
||||
waku_core,
|
||||
node/peer_manager,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
waku_filter_v2,
|
||||
waku_filter_v2/client,
|
||||
waku_filter_v2/subscriptions,
|
||||
|
||||
@ -12,7 +12,7 @@ import
|
||||
waku_core,
|
||||
node/peer_manager,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
waku_lightpush_legacy,
|
||||
waku_lightpush_legacy/common,
|
||||
waku_lightpush_legacy/protocol_metrics,
|
||||
|
||||
@ -6,7 +6,7 @@ import
|
||||
waku/[
|
||||
common/paging,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
node/peer_manager,
|
||||
waku_core,
|
||||
waku_store_legacy,
|
||||
|
||||
@ -12,7 +12,7 @@ import
|
||||
waku_core,
|
||||
node/peer_manager,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
waku_lightpush,
|
||||
waku_rln_relay,
|
||||
],
|
||||
|
||||
@ -14,7 +14,7 @@ import
|
||||
import
|
||||
waku/[
|
||||
waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
discovery/waku_discv5,
|
||||
waku_peer_exchange,
|
||||
node/peer_manager,
|
||||
|
||||
@ -17,7 +17,7 @@ import
|
||||
waku_core,
|
||||
node/peer_manager,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
discovery/waku_discv5,
|
||||
waku_filter_v2/common,
|
||||
waku_relay/protocol,
|
||||
|
||||
@ -17,7 +17,7 @@ import
|
||||
node/peer_manager,
|
||||
waku_core,
|
||||
waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
common/error_handling,
|
||||
waku_rln_relay,
|
||||
waku_rln_relay/rln,
|
||||
|
||||
@ -16,7 +16,7 @@ import
|
||||
waku_core/topics/sharding,
|
||||
waku_store_legacy/common,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
common/paging,
|
||||
waku_core,
|
||||
waku_store/common,
|
||||
|
||||
@ -6,7 +6,7 @@ import
|
||||
waku/[
|
||||
common/paging,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
node/peer_manager,
|
||||
waku_core,
|
||||
waku_core/message/digest,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{.used.}
|
||||
|
||||
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()
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import
|
||||
factory/conf_builder/conf_builder,
|
||||
factory/waku,
|
||||
node/waku_node,
|
||||
node/api,
|
||||
node/kernel_api,
|
||||
node/peer_manager,
|
||||
],
|
||||
../testlib/[wakucore, testasync, assertions, futures, wakunode, testutils],
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import std/[options, sequtils, json], testutils/unittests, results, chronos
|
||||
|
||||
import
|
||||
waku/node/[peer_manager, waku_node, api],
|
||||
waku/node/[peer_manager, waku_node, kernel_api],
|
||||
waku/waku_core,
|
||||
waku/waku_filter_v2/[common, client, subscriptions, protocol, rpc_codec],
|
||||
../testlib/[wakucore, testasync, testutils, futures, sequtils, wakunode],
|
||||
|
||||
@ -14,12 +14,12 @@ import
|
||||
waku_node,
|
||||
waku_filter_v2/client,
|
||||
node/peer_manager,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/admin/types,
|
||||
waku_api/rest/admin/handlers as admin_api,
|
||||
waku_api/rest/admin/client as admin_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/admin/types,
|
||||
rest_api/endpoint/admin/handlers as admin_rest_interface,
|
||||
rest_api/endpoint/admin/client as admin_rest_client,
|
||||
waku_relay,
|
||||
waku_peer_exchange,
|
||||
],
|
||||
|
||||
@ -11,8 +11,8 @@ import
|
||||
waku/[
|
||||
waku_node,
|
||||
node/waku_node as waku_node2,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/debug/handlers as debug_api,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/debug/handlers as debug_rest_interface,
|
||||
],
|
||||
../testlib/common,
|
||||
../testlib/wakucore,
|
||||
|
||||
@ -12,11 +12,11 @@ import
|
||||
waku_node,
|
||||
node/waku_node as waku_node2,
|
||||
# TODO: Remove after moving `git_version` to the app code.
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/debug/handlers as debug_api,
|
||||
waku_api/rest/debug/client as debug_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/debug/handlers as debug_rest_interface,
|
||||
rest_api/endpoint/debug/client as debug_rest_client,
|
||||
],
|
||||
../testlib/common,
|
||||
../testlib/wakucore,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{.used.}
|
||||
|
||||
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 "DebugWakuInfo - decode":
|
||||
|
||||
@ -9,21 +9,21 @@ import
|
||||
libp2p/crypto/crypto
|
||||
import
|
||||
waku/[
|
||||
waku_api/message_cache,
|
||||
rest_api/message_cache,
|
||||
waku_core,
|
||||
waku_node,
|
||||
node/peer_manager,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/filter/types,
|
||||
waku_api/rest/filter/handlers as filter_api,
|
||||
waku_api/rest/filter/client as filter_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/filter/types,
|
||||
rest_api/endpoint/filter/handlers as filter_rest_interface,
|
||||
rest_api/endpoint/filter/client as filter_rest_client,
|
||||
waku_relay,
|
||||
waku_filter_v2/subscriptions,
|
||||
waku_filter_v2/common,
|
||||
waku_api/rest/relay/handlers as relay_api,
|
||||
waku_api/rest/relay/client as relay_api_client,
|
||||
rest_api/endpoint/relay/handlers as relay_rest_interface,
|
||||
rest_api/endpoint/relay/client as relay_rest_client,
|
||||
],
|
||||
../testlib/wakucore,
|
||||
../testlib/wakunode
|
||||
|
||||
@ -13,11 +13,11 @@ import
|
||||
waku_node,
|
||||
node/waku_node as waku_node2,
|
||||
# TODO: Remove after moving `git_version` to the app code.
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/health/handlers as health_api,
|
||||
waku_api/rest/health/client as health_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/health/handlers as health_rest_interface,
|
||||
rest_api/endpoint/health/client as health_rest_client,
|
||||
waku_rln_relay,
|
||||
node/health_monitor,
|
||||
],
|
||||
|
||||
@ -10,17 +10,17 @@ import
|
||||
|
||||
import
|
||||
waku/[
|
||||
waku_api/message_cache,
|
||||
rest_api/message_cache,
|
||||
waku_core,
|
||||
waku_node,
|
||||
node/peer_manager,
|
||||
waku_lightpush/common,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/lightpush/types,
|
||||
waku_api/rest/lightpush/handlers as lightpush_api,
|
||||
waku_api/rest/lightpush/client as lightpush_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/lightpush/types,
|
||||
rest_api/endpoint/lightpush/handlers as lightpush_rest_interface,
|
||||
rest_api/endpoint/lightpush/client as lightpush_rest_client,
|
||||
waku_relay,
|
||||
common/rate_limit/setting,
|
||||
],
|
||||
|
||||
@ -10,17 +10,17 @@ import
|
||||
|
||||
import
|
||||
waku/[
|
||||
waku_api/message_cache,
|
||||
rest_api/message_cache,
|
||||
waku_core,
|
||||
waku_node,
|
||||
node/peer_manager,
|
||||
waku_lightpush_legacy/common,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/legacy_lightpush/types,
|
||||
waku_api/rest/legacy_lightpush/handlers as lightpush_api,
|
||||
waku_api/rest/legacy_lightpush/client as lightpush_api_client,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/legacy_lightpush/types,
|
||||
rest_api/endpoint/legacy_lightpush/handlers as lightpush_rest_interface,
|
||||
rest_api/endpoint/legacy_lightpush/client as lightpush_rest_client,
|
||||
waku_relay,
|
||||
common/rate_limit/setting,
|
||||
],
|
||||
|
||||
@ -12,13 +12,13 @@ import
|
||||
common/base64,
|
||||
waku_core,
|
||||
waku_node,
|
||||
waku_api/message_cache,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/relay/types,
|
||||
waku_api/rest/relay/handlers as relay_api,
|
||||
waku_api/rest/relay/client as relay_api_client,
|
||||
rest_api/message_cache,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/relay/types,
|
||||
rest_api/endpoint/relay/handlers as relay_rest_interface,
|
||||
rest_api/endpoint/relay/client as relay_rest_client,
|
||||
waku_relay,
|
||||
waku_rln_relay,
|
||||
],
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
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 "RelayWakuMessage - decode":
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{.used.}
|
||||
|
||||
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
|
||||
suite "Waku v2 Rest API - Serdes":
|
||||
suite "decode":
|
||||
|
||||
@ -17,12 +17,12 @@ import
|
||||
waku_core/time,
|
||||
waku_node,
|
||||
node/peer_manager,
|
||||
waku_api/rest/server,
|
||||
waku_api/rest/client,
|
||||
waku_api/rest/responses,
|
||||
waku_api/rest/store/handlers as store_api,
|
||||
waku_api/rest/store/client as store_api_client,
|
||||
waku_api/rest/store/types,
|
||||
rest_api/endpoint/server,
|
||||
rest_api/endpoint/client,
|
||||
rest_api/endpoint/responses,
|
||||
rest_api/endpoint/store/handlers as store_rest_interface,
|
||||
rest_api/endpoint/store/client as store_rest_client,
|
||||
rest_api/endpoint/store/types,
|
||||
waku_archive,
|
||||
waku_archive/driver/queue_driver,
|
||||
waku_archive/driver/sqlite_driver,
|
||||
@ -34,7 +34,7 @@ import
|
||||
../testlib/wakunode
|
||||
|
||||
logScope:
|
||||
topics = "waku node rest store_api test"
|
||||
topics = "waku node rest store_rest_interface test"
|
||||
|
||||
proc put(
|
||||
store: ArchiveDriver, pubsubTopic: PubsubTopic, message: WakuMessage
|
||||
|
||||
@ -34,7 +34,9 @@ import
|
||||
|
||||
import ./envvar as confEnvvarDefs, ./envvar_net as confEnvvarNet
|
||||
|
||||
export confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet, ProtectedShard
|
||||
export
|
||||
confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet, ProtectedShard,
|
||||
DefaultMaxWakuMessageSizeStr
|
||||
|
||||
logScope:
|
||||
topics = "waku cli args"
|
||||
|
||||
3
waku/api.nim
Normal file
3
waku/api.nim
Normal file
@ -0,0 +1,3 @@
|
||||
import ./api/[api, api_conf, entry_nodes]
|
||||
|
||||
export api, api_conf, entry_nodes
|
||||
@ -28,9 +28,9 @@ import
|
||||
../node/health_monitor,
|
||||
../node/waku_metrics,
|
||||
../node/delivery_monitor/delivery_monitor,
|
||||
../waku_api/message_cache,
|
||||
../waku_api/rest/server,
|
||||
../waku_api/rest/builder as rest_server_builder,
|
||||
../rest_api/message_cache,
|
||||
../rest_api/endpoint/server,
|
||||
../rest_api/endpoint/builder as rest_server_builder,
|
||||
../waku_archive,
|
||||
../waku_relay/protocol,
|
||||
../discovery/waku_dnsdisc,
|
||||
|
||||
@ -9,7 +9,7 @@ import
|
||||
|
||||
import
|
||||
../waku_rln_relay/rln_relay,
|
||||
../waku_api/rest/builder,
|
||||
../rest_api/endpoint/builder,
|
||||
../discovery/waku_discv5,
|
||||
../node/waku_metrics,
|
||||
../common/logging,
|
||||
|
||||
@ -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
|
||||
@ -8,7 +8,7 @@ import
|
||||
|
||||
import
|
||||
../waku_node,
|
||||
../api,
|
||||
../kernel_api,
|
||||
../../waku_rln_relay,
|
||||
../../waku_relay,
|
||||
../peer_manager,
|
||||
|
||||
9
waku/node/kernel_api.nim
Normal file
9
waku/node/kernel_api.nim
Normal 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
|
||||
@ -5,18 +5,18 @@ import presto
|
||||
import
|
||||
waku/waku_node,
|
||||
waku/discovery/waku_discv5,
|
||||
waku/waku_api/message_cache,
|
||||
waku/waku_api/handlers,
|
||||
waku/waku_api/rest/server,
|
||||
waku/waku_api/rest/debug/handlers as rest_debug_api,
|
||||
waku/waku_api/rest/relay/handlers as rest_relay_api,
|
||||
waku/waku_api/rest/filter/handlers as rest_filter_api,
|
||||
waku/waku_api/rest/legacy_lightpush/handlers as rest_legacy_lightpush_api,
|
||||
waku/waku_api/rest/lightpush/handlers as rest_lightpush_api,
|
||||
waku/waku_api/rest/store/handlers as rest_store_api,
|
||||
waku/waku_api/rest/legacy_store/handlers as rest_store_legacy_api,
|
||||
waku/waku_api/rest/health/handlers as rest_health_api,
|
||||
waku/waku_api/rest/admin/handlers as rest_admin_api,
|
||||
waku/rest_api/message_cache,
|
||||
waku/rest_api/handlers,
|
||||
waku/rest_api/endpoint/server,
|
||||
waku/rest_api/endpoint/debug/handlers as rest_debug_endpoint,
|
||||
waku/rest_api/endpoint/relay/handlers as rest_relay_endpoint,
|
||||
waku/rest_api/endpoint/filter/handlers as rest_filter_endpoint,
|
||||
waku/rest_api/endpoint/legacy_lightpush/handlers as rest_legacy_lightpush_endpoint,
|
||||
waku/rest_api/endpoint/lightpush/handlers as rest_lightpush_endpoint,
|
||||
waku/rest_api/endpoint/store/handlers as rest_store_endpoint,
|
||||
waku/rest_api/endpoint/legacy_store/handlers as rest_store_legacy_endpoint,
|
||||
waku/rest_api/endpoint/health/handlers as rest_health_endpoint,
|
||||
waku/rest_api/endpoint/admin/handlers as rest_admin_endpoint,
|
||||
waku/waku_core/topics,
|
||||
waku/waku_relay/protocol
|
||||
|
||||
@ -180,7 +180,7 @@ proc startRestServerProtocolSupport*(
|
||||
else:
|
||||
none(DiscoveryHandler)
|
||||
|
||||
rest_filter_api.installFilterRestApiHandlers(
|
||||
rest_filter_endpoint.installFilterRestApiHandlers(
|
||||
router, node, filterCache, filterDiscoHandler
|
||||
)
|
||||
else:
|
||||
@ -193,8 +193,8 @@ proc startRestServerProtocolSupport*(
|
||||
else:
|
||||
none(DiscoveryHandler)
|
||||
|
||||
rest_store_api.installStoreApiHandlers(router, node, storeDiscoHandler)
|
||||
rest_store_legacy_api.installStoreApiHandlers(router, node, storeDiscoHandler)
|
||||
rest_store_endpoint.installStoreApiHandlers(router, node, storeDiscoHandler)
|
||||
rest_store_legacy_endpoint.installStoreApiHandlers(router, node, storeDiscoHandler)
|
||||
|
||||
## Light push API
|
||||
## Install it either if client is mounted)
|
||||
@ -208,10 +208,12 @@ proc startRestServerProtocolSupport*(
|
||||
else:
|
||||
none(DiscoveryHandler)
|
||||
|
||||
rest_legacy_lightpush_api.installLightPushRequestHandler(
|
||||
rest_legacy_lightpush_endpoint.installLightPushRequestHandler(
|
||||
router, node, lightDiscoHandler
|
||||
)
|
||||
rest_lightpush_endpoint.installLightPushRequestHandler(
|
||||
router, node, lightDiscoHandler
|
||||
)
|
||||
rest_lightpush_api.installLightPushRequestHandler(router, node, lightDiscoHandler)
|
||||
else:
|
||||
restServerNotInstalledTab["lightpush"] = "/lightpush endpoints are not available."
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
import ./waku_api/message_cache, ./waku_api/rest, ./waku_api/json_rpc
|
||||
|
||||
export message_cache, rest
|
||||
@ -31,7 +31,7 @@ proc computeDigest*(msg: WakuMessage): MessageDigest =
|
||||
# Computes the hash
|
||||
return ctx.finish()
|
||||
|
||||
## Public API types
|
||||
## API types
|
||||
|
||||
type
|
||||
#TODO Once Store v2 is removed, the cursor becomes the hash of the last message
|
||||
|
||||
@ -3,6 +3,6 @@ import
|
||||
./node/waku_switch as switch,
|
||||
./node/waku_node as node,
|
||||
./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
3
waku/waku_rest.nim
Normal file
@ -0,0 +1,3 @@
|
||||
import ./rest_api/message_cache, ./rest_api/endpoint, ./rest_api/json_rpc
|
||||
|
||||
export message_cache, rest
|
||||
@ -15,7 +15,7 @@ const
|
||||
|
||||
type WakuStoreResult*[T] = Result[T, string]
|
||||
|
||||
## Public API types
|
||||
## API types
|
||||
|
||||
type
|
||||
StoreQueryRequest* = object
|
||||
|
||||
@ -29,7 +29,7 @@ proc computeDigest*(msg: WakuMessage): MessageDigest =
|
||||
# Computes the hash
|
||||
return ctx.finish()
|
||||
|
||||
## Public API types
|
||||
## API types
|
||||
|
||||
type
|
||||
HistoryCursor* = object
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user