From 26c2b96cfe8f035c06c51df734deedc8b041dad7 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:27:39 +0200 Subject: [PATCH] chore: rename modules (#3469) --- library/libwaku.nim | 28 +++++++++---------- .../waku_thread.nim => waku_context.nim} | 6 ++-- .../requests/debug_node_request.nim | 6 ++-- .../requests/discovery_request.nim | 12 ++++---- .../requests/node_lifecycle_request.nim | 16 +++++------ .../requests/peer_manager_request.nim | 8 +++--- .../requests/ping_request.nim | 2 +- .../requests/protocols/filter_request.nim | 20 ++++++------- .../requests/protocols/lightpush_request.nim | 20 ++++++------- .../requests/protocols/relay_request.nim | 20 ++++++------- .../requests/protocols/store_request.nim | 18 ++++++------ .../waku_thread_request.nim | 4 +-- 12 files changed, 80 insertions(+), 80 deletions(-) rename library/{waku_thread/waku_thread.nim => waku_context.nim} (98%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/debug_node_request.nim (93%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/discovery_request.nim (95%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/node_lifecycle_request.nim (91%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/peer_manager_request.nim (97%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/ping_request.nim (94%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/protocols/filter_request.nim (88%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/protocols/lightpush_request.nim (85%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/protocols/relay_request.nim (91%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/requests/protocols/store_request.nim (92%) rename library/{waku_thread/inter_thread_communication => waku_thread_requests}/waku_thread_request.nim (98%) diff --git a/library/libwaku.nim b/library/libwaku.nim index bc1614af8..ad3afa134 100644 --- a/library/libwaku.nim +++ b/library/libwaku.nim @@ -16,17 +16,17 @@ import waku/waku_core/subscription/push_handler, waku/waku_relay, ./events/json_message_event, - ./waku_thread/waku_thread, - ./waku_thread/inter_thread_communication/requests/node_lifecycle_request, - ./waku_thread/inter_thread_communication/requests/peer_manager_request, - ./waku_thread/inter_thread_communication/requests/protocols/relay_request, - ./waku_thread/inter_thread_communication/requests/protocols/store_request, - ./waku_thread/inter_thread_communication/requests/protocols/lightpush_request, - ./waku_thread/inter_thread_communication/requests/protocols/filter_request, - ./waku_thread/inter_thread_communication/requests/debug_node_request, - ./waku_thread/inter_thread_communication/requests/discovery_request, - ./waku_thread/inter_thread_communication/requests/ping_request, - ./waku_thread/inter_thread_communication/waku_thread_request, + ./waku_context, + ./waku_thread_requests/requests/node_lifecycle_request, + ./waku_thread_requests/requests/peer_manager_request, + ./waku_thread_requests/requests/protocols/relay_request, + ./waku_thread_requests/requests/protocols/store_request, + ./waku_thread_requests/requests/protocols/lightpush_request, + ./waku_thread_requests/requests/protocols/filter_request, + ./waku_thread_requests/requests/debug_node_request, + ./waku_thread_requests/requests/discovery_request, + ./waku_thread_requests/requests/ping_request, + ./waku_thread_requests/waku_thread_request, ./alloc, ./ffi_types, ../waku/factory/app_callbacks @@ -54,7 +54,7 @@ proc handleRequest( callback: WakuCallBack, userData: pointer, ): cint = - waku_thread.sendRequestToWakuThread(ctx, requestType, content, callback, userData).isOkOr: + waku_context.sendRequestToWakuThread(ctx, requestType, content, callback, userData).isOkOr: let msg = "libwaku error: " & $error callback(RET_ERR, unsafeAddr msg[0], cast[csize_t](len(msg)), userData) return RET_ERR @@ -111,7 +111,7 @@ proc waku_new( return nil ## Create the Waku thread that will keep waiting for req from the main thread. - var ctx = waku_thread.createWakuContext().valueOr: + var ctx = waku_context.createWakuContext().valueOr: let msg = "Error in createWakuContext: " & $error callback(RET_ERR, unsafeAddr msg[0], cast[csize_t](len(msg)), userData) return nil @@ -145,7 +145,7 @@ proc waku_destroy( initializeLibrary() checkLibwakuParams(ctx, callback, userData) - waku_thread.destroyWakuContext(ctx).isOkOr: + waku_context.destroyWakuContext(ctx).isOkOr: let msg = "libwaku error: " & $error callback(RET_ERR, unsafeAddr msg[0], cast[csize_t](len(msg)), userData) return RET_ERR diff --git a/library/waku_thread/waku_thread.nim b/library/waku_context.nim similarity index 98% rename from library/waku_thread/waku_thread.nim rename to library/waku_context.nim index 37c37e6df..2dd9e9c95 100644 --- a/library/waku_thread/waku_thread.nim +++ b/library/waku_context.nim @@ -9,9 +9,9 @@ import waku/node/peer_manager, waku/waku_relay/[protocol, topic_health], waku/waku_core/[topics/pubsub_topic, message], - ./inter_thread_communication/[waku_thread_request, requests/debug_node_request], - ../ffi_types, - ../events/[ + ./waku_thread_requests/[waku_thread_request, requests/debug_node_request], + ./ffi_types, + ./events/[ json_message_event, json_topic_health_change_event, json_connection_change_event, json_waku_not_responding_event, ] diff --git a/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim b/library/waku_thread_requests/requests/debug_node_request.nim similarity index 93% rename from library/waku_thread/inter_thread_communication/requests/debug_node_request.nim rename to library/waku_thread_requests/requests/debug_node_request.nim index 0bd9235b6..c9aa5a743 100644 --- a/library/waku_thread/inter_thread_communication/requests/debug_node_request.nim +++ b/library/waku_thread_requests/requests/debug_node_request.nim @@ -8,9 +8,9 @@ import libp2p/peerid, metrics import - ../../../../waku/factory/waku, - ../../../../waku/node/waku_node, - ../../../../waku/node/health_monitor + ../../../waku/factory/waku, + ../../../waku/node/waku_node, + ../../../waku/node/health_monitor type DebugNodeMsgType* = enum RETRIEVE_LISTENING_ADDRESSES diff --git a/library/waku_thread/inter_thread_communication/requests/discovery_request.nim b/library/waku_thread_requests/requests/discovery_request.nim similarity index 95% rename from library/waku_thread/inter_thread_communication/requests/discovery_request.nim rename to library/waku_thread_requests/requests/discovery_request.nim index 4eb193728..8fec0dd9f 100644 --- a/library/waku_thread/inter_thread_communication/requests/discovery_request.nim +++ b/library/waku_thread_requests/requests/discovery_request.nim @@ -1,12 +1,12 @@ import std/json import chronos, chronicles, results, strutils, libp2p/multiaddress import - ../../../../waku/factory/waku, - ../../../../waku/discovery/waku_dnsdisc, - ../../../../waku/discovery/waku_discv5, - ../../../../waku/waku_core/peers, - ../../../../waku/node/waku_node, - ../../../alloc + ../../../waku/factory/waku, + ../../../waku/discovery/waku_dnsdisc, + ../../../waku/discovery/waku_discv5, + ../../../waku/waku_core/peers, + ../../../waku/node/waku_node, + ../../alloc type DiscoveryMsgType* = enum GET_BOOTSTRAP_NODES diff --git a/library/waku_thread/inter_thread_communication/requests/node_lifecycle_request.nim b/library/waku_thread_requests/requests/node_lifecycle_request.nim similarity index 91% rename from library/waku_thread/inter_thread_communication/requests/node_lifecycle_request.nim rename to library/waku_thread_requests/requests/node_lifecycle_request.nim index 0f912aaa3..21765838e 100644 --- a/library/waku_thread/inter_thread_communication/requests/node_lifecycle_request.nim +++ b/library/waku_thread_requests/requests/node_lifecycle_request.nim @@ -2,14 +2,14 @@ import std/[options, json, strutils, net] import chronos, chronicles, results, confutils, confutils/std/net import - ../../../../waku/node/peer_manager/peer_manager, - ../../../../waku/factory/external_config, - ../../../../waku/factory/waku, - ../../../../waku/factory/node_factory, - ../../../../waku/factory/networks_config, - ../../../../waku/factory/app_callbacks, - ../../../../waku/waku_api/rest/builder, - ../../../alloc + ../../../waku/node/peer_manager/peer_manager, + ../../../waku/factory/external_config, + ../../../waku/factory/waku, + ../../../waku/factory/node_factory, + ../../../waku/factory/networks_config, + ../../../waku/factory/app_callbacks, + ../../../waku/waku_api/rest/builder, + ../../alloc type NodeLifecycleMsgType* = enum CREATE_NODE diff --git a/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim b/library/waku_thread_requests/requests/peer_manager_request.nim similarity index 97% rename from library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim rename to library/waku_thread_requests/requests/peer_manager_request.nim index deb520366..1acc78595 100644 --- a/library/waku_thread/inter_thread_communication/requests/peer_manager_request.nim +++ b/library/waku_thread_requests/requests/peer_manager_request.nim @@ -1,10 +1,10 @@ import std/[sequtils, strutils] import chronicles, chronos, results, options, json import - ../../../../waku/factory/waku, - ../../../../waku/node/waku_node, - ../../../alloc, - ../../../../waku/node/peer_manager + ../../../waku/factory/waku, + ../../../waku/node/waku_node, + ../../alloc, + ../../../waku/node/peer_manager type PeerManagementMsgType* {.pure.} = enum CONNECT_TO diff --git a/library/waku_thread/inter_thread_communication/requests/ping_request.nim b/library/waku_thread_requests/requests/ping_request.nim similarity index 94% rename from library/waku_thread/inter_thread_communication/requests/ping_request.nim rename to library/waku_thread_requests/requests/ping_request.nim index 4467f9659..53d33968e 100644 --- a/library/waku_thread/inter_thread_communication/requests/ping_request.nim +++ b/library/waku_thread_requests/requests/ping_request.nim @@ -1,7 +1,7 @@ import std/[json, strutils] import chronos, results import libp2p/[protocols/ping, switch, multiaddress, multicodec] -import ../../../../waku/[factory/waku, waku_core/peers, node/waku_node], ../../../alloc +import ../../../waku/[factory/waku, waku_core/peers, node/waku_node], ../../alloc type PingRequest* = object peerAddr: cstring diff --git a/library/waku_thread/inter_thread_communication/requests/protocols/filter_request.nim b/library/waku_thread_requests/requests/protocols/filter_request.nim similarity index 88% rename from library/waku_thread/inter_thread_communication/requests/protocols/filter_request.nim rename to library/waku_thread_requests/requests/protocols/filter_request.nim index 452a0c7c3..274ec32ea 100644 --- a/library/waku_thread/inter_thread_communication/requests/protocols/filter_request.nim +++ b/library/waku_thread_requests/requests/protocols/filter_request.nim @@ -1,16 +1,16 @@ import options, std/[strutils, sequtils] import chronicles, chronos, results import - ../../../../../waku/waku_filter_v2/client, - ../../../../../waku/waku_core/message/message, - ../../../../../waku/factory/waku, - ../../../../../waku/waku_filter_v2/common, - ../../../../../waku/waku_core/subscription/push_handler, - ../../../../../waku/node/peer_manager/peer_manager, - ../../../../../waku/node/waku_node, - ../../../../../waku/waku_core/topics/pubsub_topic, - ../../../../../waku/waku_core/topics/content_topic, - ../../../../alloc + ../../../../waku/waku_filter_v2/client, + ../../../../waku/waku_core/message/message, + ../../../../waku/factory/waku, + ../../../../waku/waku_filter_v2/common, + ../../../../waku/waku_core/subscription/push_handler, + ../../../../waku/node/peer_manager/peer_manager, + ../../../../waku/node/waku_node, + ../../../../waku/waku_core/topics/pubsub_topic, + ../../../../waku/waku_core/topics/content_topic, + ../../../alloc type FilterMsgType* = enum SUBSCRIBE diff --git a/library/waku_thread/inter_thread_communication/requests/protocols/lightpush_request.nim b/library/waku_thread_requests/requests/protocols/lightpush_request.nim similarity index 85% rename from library/waku_thread/inter_thread_communication/requests/protocols/lightpush_request.nim rename to library/waku_thread_requests/requests/protocols/lightpush_request.nim index f167cd239..bc3d9de2c 100644 --- a/library/waku_thread/inter_thread_communication/requests/protocols/lightpush_request.nim +++ b/library/waku_thread_requests/requests/protocols/lightpush_request.nim @@ -1,16 +1,16 @@ import options import chronicles, chronos, results import - ../../../../../waku/waku_core/message/message, - ../../../../../waku/waku_core/codecs, - ../../../../../waku/factory/waku, - ../../../../../waku/waku_core/message, - ../../../../../waku/waku_core/time, # Timestamp - ../../../../../waku/waku_core/topics/pubsub_topic, - ../../../../../waku/waku_lightpush_legacy/client, - ../../../../../waku/waku_lightpush_legacy/common, - ../../../../../waku/node/peer_manager/peer_manager, - ../../../../alloc + ../../../../waku/waku_core/message/message, + ../../../../waku/waku_core/codecs, + ../../../../waku/factory/waku, + ../../../../waku/waku_core/message, + ../../../../waku/waku_core/time, # Timestamp + ../../../../waku/waku_core/topics/pubsub_topic, + ../../../../waku/waku_lightpush_legacy/client, + ../../../../waku/waku_lightpush_legacy/common, + ../../../../waku/node/peer_manager/peer_manager, + ../../../alloc type LightpushMsgType* = enum PUBLISH diff --git a/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim b/library/waku_thread_requests/requests/protocols/relay_request.nim similarity index 91% rename from library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim rename to library/waku_thread_requests/requests/protocols/relay_request.nim index cfff1442c..279a1efb4 100644 --- a/library/waku_thread/inter_thread_communication/requests/protocols/relay_request.nim +++ b/library/waku_thread_requests/requests/protocols/relay_request.nim @@ -1,16 +1,16 @@ import std/[net, sequtils, strutils] import chronicles, chronos, stew/byteutils, results import - ../../../../../waku/waku_core/message/message, - ../../../../../waku/factory/[external_config, validator_signed, waku], - ../../../../../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, - ../../../../alloc + ../../../../waku/waku_core/message/message, + ../../../../waku/factory/[external_config, validator_signed, waku], + ../../../../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, + ../../../alloc type RelayMsgType* = enum SUBSCRIBE diff --git a/library/waku_thread/inter_thread_communication/requests/protocols/store_request.nim b/library/waku_thread_requests/requests/protocols/store_request.nim similarity index 92% rename from library/waku_thread/inter_thread_communication/requests/protocols/store_request.nim rename to library/waku_thread_requests/requests/protocols/store_request.nim index 57786a581..3fe1e2f13 100644 --- a/library/waku_thread/inter_thread_communication/requests/protocols/store_request.nim +++ b/library/waku_thread_requests/requests/protocols/store_request.nim @@ -1,15 +1,15 @@ import std/[json, sugar, strutils, options] import chronos, chronicles, results, stew/byteutils import - ../../../../../waku/factory/waku, - ../../../../alloc, - ../../../../utils, - ../../../../../waku/waku_core/peers, - ../../../../../waku/waku_core/time, - ../../../../../waku/waku_core/message/digest, - ../../../../../waku/waku_store/common, - ../../../../../waku/waku_store/client, - ../../../../../waku/common/paging + ../../../../waku/factory/waku, + ../../../alloc, + ../../../utils, + ../../../../waku/waku_core/peers, + ../../../../waku/waku_core/time, + ../../../../waku/waku_core/message/digest, + ../../../../waku/waku_store/common, + ../../../../waku/waku_store/client, + ../../../../waku/common/paging type StoreReqType* = enum REMOTE_QUERY ## to perform a query to another Store node diff --git a/library/waku_thread/inter_thread_communication/waku_thread_request.nim b/library/waku_thread_requests/waku_thread_request.nim similarity index 98% rename from library/waku_thread/inter_thread_communication/waku_thread_request.nim rename to library/waku_thread_requests/waku_thread_request.nim index bcfb84198..50462fba7 100644 --- a/library/waku_thread/inter_thread_communication/waku_thread_request.nim +++ b/library/waku_thread_requests/waku_thread_request.nim @@ -5,8 +5,8 @@ import std/json, results import chronos, chronos/threadsync import - ../../../waku/factory/waku, - ../../ffi_types, + ../../waku/factory/waku, + ../ffi_types, ./requests/node_lifecycle_request, ./requests/peer_manager_request, ./requests/protocols/relay_request,