fix!: rename module everywhere

This commit is contained in:
erhant 2026-06-16 15:42:53 +03:00
parent 97367242ce
commit 14a1b4affb
7 changed files with 45 additions and 34 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.20)
project(logos_execution_zone_indexer_module LANGUAGES CXX)
project(LEZIndexerModule LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -151,7 +151,7 @@ if(WIN32)
endif()
add_library(logos_core STATIC IMPORTED
src/i_logos_execution_zone_indexer_module.h)
src/i_lez_indexer_module.h)
set_target_properties(logos_core PROPERTIES
IMPORTED_LOCATION "${SDK_LIB}"
)
@ -160,17 +160,28 @@ add_library(logos_cpp_sdk INTERFACE)
target_include_directories(logos_cpp_sdk INTERFACE "${SDK_INC}")
# ---- Plugin ----
set(PLUGIN_TARGET logos_execution_zone_indexer_module)
set(PLUGIN_TARGET lez_indexer_module)
qt_add_plugin(${PLUGIN_TARGET} CLASS_NAME LogosExecutionZoneIndexerModule)
qt_add_plugin(${PLUGIN_TARGET} CLASS_NAME LezIndexerModule)
# A consumer (module-viewer / basecamp) derives the QtRO object name it INVOKES
# from the produced library's FILENAME, whereas logos_host REGISTERS the plugin
# under metadata.json `name`. They must be identical, and short macOS caps the
# QtRO `local:` socket path (sun_path) at 104 bytes, so a long name makes the host
# fail to listen. `PREFIX ""` drops the `lib` prefix so the file is exactly
# `lez_indexer_module.<ext>` == metadata `name` == `main` == name().
set_target_properties(${PLUGIN_TARGET} PROPERTIES
OUTPUT_NAME lez_indexer_module
PREFIX ""
)
target_sources(${PLUGIN_TARGET} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/logos_execution_zone_indexer_module.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/lez_indexer_module.cpp
)
set_property(TARGET ${PLUGIN_TARGET} PROPERTY PUBLIC_HEADER
${CMAKE_CURRENT_SOURCE_DIR}/src/i_logos_execution_zone_indexer_module.h
${CMAKE_CURRENT_SOURCE_DIR}/src/logos_execution_zone_indexer_module.h
${CMAKE_CURRENT_SOURCE_DIR}/src/i_lez_indexer_module.h
${CMAKE_CURRENT_SOURCE_DIR}/src/lez_indexer_module.h
)
target_include_directories(${PLUGIN_TARGET} PRIVATE
@ -188,7 +199,7 @@ target_link_libraries(${PLUGIN_TARGET} PRIVATE
)
target_compile_definitions(${PLUGIN_TARGET} PRIVATE
LOGOS_EXECUTION_ZONE_INDEXER_MODULE_METADATA_FILE="${CMAKE_CURRENT_SOURCE_DIR}/metadata.json"
LEZ_INDEXER_MODULE_METADATA_FILE="${CMAKE_CURRENT_SOURCE_DIR}/metadata.json"
)
add_dependencies(${PLUGIN_TARGET} logos_execution_zone_libs)

View File

@ -45,8 +45,8 @@
logosCore = logos-core.packages.${system}.default;
logosExecutionZoneIndexerPackage = logos-execution-zone.packages.${system}.indexer;
logosExecutionZoneIndexerModulePackage = pkgs.stdenv.mkDerivation {
pname = "logos-execution-zone-module";
lezIndexerModulePackage = pkgs.stdenv.mkDerivation {
pname = "lez-indexer-module";
version = "dev";
src = ./.;
@ -83,8 +83,8 @@
};
in
{
lib = logosExecutionZoneIndexerModulePackage;
default = logosExecutionZoneIndexerModulePackage;
lib = lezIndexerModulePackage;
default = lezIndexerModulePackage;
}
);
@ -92,7 +92,7 @@
system:
let
pkgs = mkPkgs system;
logosExecutionZoneIndexerModuleLib = self.packages.${system}.lib;
lezIndexerModuleLib = self.packages.${system}.lib;
logosModuleViewerPackage = logos-module-viewer.packages.${system}.default;
extension = if pkgs.stdenv.isDarwin then "dylib"
else if pkgs.stdenv.hostPlatform.isWindows then "dll"
@ -102,7 +102,7 @@
program =
"${pkgs.writeShellScriptBin "inspect-module" ''
exec ${logosModuleViewerPackage}/bin/logos-module-viewer \
--module ${logosExecutionZoneIndexerModuleLib}/lib/liblogos_execution_zone_indexer_module.${extension}
--module ${lezIndexerModuleLib}/lib/lez_indexer_module.${extension}
''}/bin/inspect-module";
};
in

View File

@ -7,7 +7,7 @@ configure:
${LOGOS_EXECUTION_ZONE_INDEXER_INCLUDE:+-DLOGOS_EXECUTION_ZONE_INDEXER_INCLUDE="$LOGOS_EXECUTION_ZONE_INDEXER_INCLUDE"}
build: configure
cmake --build build --parallel --target logos_execution_zone_indexer_module
cmake --build build --parallel --target lez_indexer_module
clean:
rm -rf build result

View File

@ -5,7 +5,7 @@
"author": "Logos Blockchain Team",
"type": "core",
"category": "blockchain",
"main": "liblogos_execution_zone_indexer_module",
"main": "lez_indexer_module",
"dependencies": [],
"capabilities": [],
"include": ["libnomos.dylib"]

View File

@ -2,9 +2,9 @@
#include <core/interface.h>
class ILogosExecutionZoneIndexerModule {
class ILezIndexerModule {
public:
virtual ~ILogosExecutionZoneIndexerModule() = default;
virtual ~ILezIndexerModule() = default;
// === Logos Core ===
@ -19,5 +19,5 @@ public:
) = 0;
};
#define ILogosExecutionZoneIndexerModule_iid "org.logos.ilogosexecutionzoneindexermodule"
Q_DECLARE_INTERFACE(ILogosExecutionZoneIndexerModule, ILogosExecutionZoneIndexerModule_iid)
#define ILezIndexerModule_iid "org.logos.ilezindexermodule"
Q_DECLARE_INTERFACE(ILezIndexerModule, ILezIndexerModule_iid)

View File

@ -1,4 +1,4 @@
#include "logos_execution_zone_indexer_module.h"
#include "lez_indexer_module.h"
#include <algorithm>
#include <QtCore/QDebug>
@ -7,9 +7,9 @@
#include <QtCore/QJsonObject>
#include <QtCore/QVariantMap>
LogosExecutionZoneIndexerModule::LogosExecutionZoneIndexerModule() = default;
LezIndexerModule::LezIndexerModule() = default;
LogosExecutionZoneIndexerModule::~LogosExecutionZoneIndexerModule() {
LezIndexerModule::~LezIndexerModule() {
if (indexer_service_ffi) {
OperationStatus operation_result = stop_indexer(indexer_service_ffi);
@ -24,23 +24,23 @@ LogosExecutionZoneIndexerModule::~LogosExecutionZoneIndexerModule() {
// === Plugin Interface ===
QString LogosExecutionZoneIndexerModule::name() const {
QString LezIndexerModule::name() const {
return "lez_indexer_module";
}
QString LogosExecutionZoneIndexerModule::version() const {
QString LezIndexerModule::version() const {
return "1.0.0";
}
// === Logos Core ===
void LogosExecutionZoneIndexerModule::initLogos(LogosAPI* logosApiInstance) {
void LezIndexerModule::initLogos(LogosAPI* logosApiInstance) {
logosAPI = logosApiInstance;
}
// === Indexer Lifecycle ===
int LogosExecutionZoneIndexerModule::start_indexer(const QString& config_path, uint16_t port) {
int LezIndexerModule::start_indexer(const QString& config_path, uint16_t port) {
if (!indexer_service_ffi) {
QByteArray utf8 = config_path.toUtf8();
const char* c_path = utf8.constData();

View File

@ -1,6 +1,6 @@
#pragma once
#include "i_logos_execution_zone_indexer_module.h"
#include "i_lez_indexer_module.h"
#ifdef __cplusplus
extern "C" {
@ -15,18 +15,18 @@ extern "C" {
#include <QString>
#include <QVariantList>
class LogosExecutionZoneIndexerModule : public QObject, public PluginInterface, public ILogosExecutionZoneIndexerModule {
class LezIndexerModule : public QObject, public PluginInterface, public ILezIndexerModule {
Q_OBJECT
Q_PLUGIN_METADATA(IID ILogosExecutionZoneIndexerModule_iid FILE LOGOS_EXECUTION_ZONE_INDEXER_MODULE_METADATA_FILE)
Q_INTERFACES(PluginInterface ILogosExecutionZoneIndexerModule)
Q_PLUGIN_METADATA(IID ILezIndexerModule_iid FILE LEZ_INDEXER_MODULE_METADATA_FILE)
Q_INTERFACES(PluginInterface ILezIndexerModule)
private:
LogosAPI* logosApi = nullptr;
IndexerServiceFFI* indexer_service_ffi = nullptr;
public:
LogosExecutionZoneIndexerModule();
~LogosExecutionZoneIndexerModule() override;
LezIndexerModule();
~LezIndexerModule() override;
// === Plugin Interface ===
[[nodiscard]] QString name() const override;
@ -40,7 +40,7 @@ public:
// Indexer Lifecycle
Q_INVOKABLE int start_indexer(const QString& config_path, uint16_t port) override;
signals:
void eventResponse(const QString& eventName, const QVariantList& data);
};