From 9a3740e726e234b4721723d93d8c335debba616e Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 14:43:42 +0100 Subject: [PATCH 1/6] Fix windows check in flake. --- flake.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 5a8b74a..a436cf3 100644 --- a/flake.nix +++ b/flake.nix @@ -94,10 +94,9 @@ pkgs = mkPkgs system; logosBlockchainModule = self.packages.${system}.logos-blockchain-module; logosModuleViewer = logos-module-viewer.packages.${system}.default; - extension = - if pkgs.stdenv.isDarwin then "dylib" - else if pkgs.stdenv.isWindows then "dll" - else "so"; + extension = if pkgs.stdenv.isDarwin then "dylib" + else if pkgs.stdenv.hostPlatform.isWindows then "dll" + else "so"; in { default = { From 3bad03ed4f17613e039701c5032d0c397291ca11 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 17:27:07 +0100 Subject: [PATCH 2/6] Make cmake paths more robust. --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f0a45f..089b7c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,13 +162,12 @@ set_target_properties(${PLUGIN_TARGET} PROPERTIES ) target_sources(${PLUGIN_TARGET} PRIVATE - src/logos_blockchain_module.cpp - src/logos_blockchain_module.h - metadata.json + ${CMAKE_CURRENT_SOURCE_DIR}/src/logos_blockchain_module.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/metadata.json ) -set_target_properties(${PLUGIN_TARGET} PROPERTIES - PUBLIC_HEADER "src/i_logos_blockchain_module.h" +set_property(TARGET ${PLUGIN_TARGET} PROPERTY PUBLIC_HEADER + ${CMAKE_CURRENT_SOURCE_DIR}/src/i_logos_blockchain_module.h ) target_include_directories(${PLUGIN_TARGET} PRIVATE From b2d7712deee0bf232e04356d4a039720235e32ea Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 17:27:25 +0100 Subject: [PATCH 3/6] Make interface pure C++. --- src/i_logos_blockchain_module.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/i_logos_blockchain_module.h b/src/i_logos_blockchain_module.h index d19df4a..ae59bee 100644 --- a/src/i_logos_blockchain_module.h +++ b/src/i_logos_blockchain_module.h @@ -11,25 +11,19 @@ extern "C" { } #endif -class ILogosBlockchainModule : public QObject, public PluginInterface { - Q_INTERFACES(PluginInterface) - +class ILogosBlockchainModule { public: - using QObject::QObject; - ~ILogosBlockchainModule() override = default; + virtual ~ILogosBlockchainModule() = default; // Logos Core - Q_INVOKABLE virtual void initLogos(LogosAPI* logosAPIInstance) = 0; + virtual void initLogos(LogosAPI* logosAPIInstance) = 0; // Node - Q_INVOKABLE virtual int start(const QString& config_path) = 0; - Q_INVOKABLE virtual int stop() = 0; - Q_INVOKABLE virtual int subscribe() = 0; - Q_INVOKABLE virtual int wallet_get_balance(const uint8_t* wallet_address, const HeaderId* optional_tip, BalanceResult* output_balance) = 0; - Q_INVOKABLE virtual int wallet_transfer_funds(const TransferFundsArguments* transfer_funds_arguments, Hash* output_hash) = 0; - - signals: - void eventResponse(const QString& eventName, const QVariantList& data); + virtual int start(const QString& config_path, const QString& deployment) = 0; + virtual int stop() = 0; + virtual int subscribe() = 0; + virtual int wallet_get_balance(const uint8_t* wallet_address, const HeaderId* optional_tip, BalanceResult* output_balance) = 0; + virtual int wallet_transfer_funds(const TransferFundsArguments* transfer_funds_arguments, Hash* output_hash) = 0; }; #define ILogosBlockchainModule_iid "org.logos.ilogosblockchainmodule" From 4d03f0919c04e4c6608e102ad8c548508067e24f Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 17:28:11 +0100 Subject: [PATCH 4/6] Add default behaviour to config_path and handle deployment in start. --- src/logos_blockchain_module.cpp | 29 ++++++++++++++++++++++++----- src/logos_blockchain_module.h | 12 +++++++++--- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/logos_blockchain_module.cpp b/src/logos_blockchain_module.cpp index d87e1fe..78c8457 100644 --- a/src/logos_blockchain_module.cpp +++ b/src/logos_blockchain_module.cpp @@ -23,19 +23,38 @@ void LogosBlockchainModule::initLogos(LogosAPI* logosAPIInstance) { logosAPI = logosAPIInstance; } -int LogosBlockchainModule::start(const QString& config_path) { +int LogosBlockchainModule::start(const QString& config_path, const QString& deployment) { if (node) { qWarning() << "Could not execute the operation: The node is already running."; return 1; } - const QByteArray path = config_path.toUtf8(); - const char* deployment = nullptr; + QString effective_config_path= config_path; - auto [value, error] = start_lb_node(path.constData(), deployment); + if (effective_config_path.isEmpty()) { + if (const char* env = std::getenv("LB_CONFIG_PATH"); env && *env) { + effective_config_path = QString::fromUtf8(env); + qInfo() << "Using config from LB_CONFIG_PATH:" << effective_config_path; + } else { + qCritical() << "Config path was not specified and LB_CONFIG_PATH is not set."; + return 2; + } + } + + qInfo() << "Starting the node with the configuration file:" << effective_config_path; + qInfo() << "Using deployment:" << (deployment.isEmpty() ? "" : deployment); + + const QByteArray config_path_buffer = effective_config_path.toUtf8(); + const char* config_path_ptr = effective_config_path.isEmpty() ? nullptr : config_path_buffer.constData(); + + const QByteArray deployment_buffer = deployment.toUtf8(); + const char* deployment_ptr = deployment.isEmpty() ? nullptr : deployment_buffer.constData(); + + auto [value, error] = start_lb_node(config_path_ptr, deployment_ptr); + qInfo() << "Start node returned with value and error."; if (!is_ok(&error)) { qCritical() << "Failed to start the node. Error:" << error; - return 2; + return 3; } node = value; diff --git a/src/logos_blockchain_module.h b/src/logos_blockchain_module.h index c6a0ce8..ef49baa 100644 --- a/src/logos_blockchain_module.h +++ b/src/logos_blockchain_module.h @@ -2,24 +2,30 @@ #include "i_logos_blockchain_module.h" -class LogosBlockchainModule final : public ILogosBlockchainModule { +class LogosBlockchainModule final : public QObject, public PluginInterface, public ILogosBlockchainModule { Q_OBJECT Q_PLUGIN_METADATA(IID ILogosBlockchainModule_iid FILE "../metadata.json") + Q_INTERFACES(PluginInterface) public: LogosBlockchainModule(); ~LogosBlockchainModule() override; + // Logos Core [[nodiscard]] QString name() const override; [[nodiscard]] QString version() const override; - Q_INVOKABLE void initLogos(LogosAPI*) override; - Q_INVOKABLE int start(const QString&) override; + + // Logos Blockchain + Q_INVOKABLE int start(const QString& config_path, const QString& deployment) override; Q_INVOKABLE int stop() override; Q_INVOKABLE int subscribe() override; Q_INVOKABLE int wallet_get_balance(const uint8_t*, const HeaderId*, BalanceResult*) override; Q_INVOKABLE int wallet_transfer_funds(const TransferFundsArguments*, Hash*) override; + signals: + void eventResponse(const QString& eventName, const QVariantList& data); + private: LogosBlockchainNode* node = nullptr; }; From 7671cf716538b5e10171d2ecb4d7081b67889209 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 17:33:33 +0100 Subject: [PATCH 5/6] Add missing sdp configs. --- config/testnet.config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/testnet.config.yaml b/config/testnet.config.yaml index 0c02996..0efded0 100644 --- a/config/testnet.config.yaml +++ b/config/testnet.config.yaml @@ -190,6 +190,11 @@ storage: mempool: recovery_path: ./resources/recovery/mempool.json sdp: + declaration: null + wallet_config: + max_tx_fee: 18446744073709551615 # u64::MAX + # SDP funding public key - matches the genesis note pk used for SDP transaction fees + funding_pk: "89b7314f5184bae9eb7fa511098eb321b97b8fbbdec611dda591e0c01e18331d" wallet: known_keys: - "0000000000000000000000000000000000000000000000000000000000000000" From d86b4b0292078503d268e0b932f813be5c49c1ad Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 2 Feb 2026 17:38:15 +0100 Subject: [PATCH 6/6] Undo stupid clang lint --- src/logos_blockchain_module.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/logos_blockchain_module.cpp b/src/logos_blockchain_module.cpp index 78c8457..9139fcc 100644 --- a/src/logos_blockchain_module.cpp +++ b/src/logos_blockchain_module.cpp @@ -32,7 +32,8 @@ int LogosBlockchainModule::start(const QString& config_path, const QString& depl QString effective_config_path= config_path; if (effective_config_path.isEmpty()) { - if (const char* env = std::getenv("LB_CONFIG_PATH"); env && *env) { + const char* env = std::getenv("LB_CONFIG_PATH"); + if (env && *env) { effective_config_path = QString::fromUtf8(env); qInfo() << "Using config from LB_CONFIG_PATH:" << effective_config_path; } else {