From 256ddb9f3f0ee47153fa0c6f9e9cad707ede6aad Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Dec 2025 17:31:26 +0100 Subject: [PATCH] Bring library to a base working state. --- .gitignore | 3 +++ library.cpp | 13 ++++++++++--- library.h | 9 +-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 1d576e8..08b6374 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ cmake-build-debug # Artifacts liblogos-blockchain-module.so liblogos-blockchain-module.log + +# Node +nomos_db/ \ No newline at end of file diff --git a/library.cpp b/library.cpp index 1951c0f..89ca09f 100644 --- a/library.cpp +++ b/library.cpp @@ -2,10 +2,17 @@ #include +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + class LogosBlockchainModule : public LogosBlockchainModuleAPI { Q_OBJECT Q_PLUGIN_METADATA(IID LogosBlockchainModuleInterface_iid FILE "metadata.json") - Q_INTERFACES(PluginInterface) private: NomosNode* node = nullptr; @@ -24,7 +31,7 @@ public: logosAPI = logosAPIInstance; } - Q_INVOKABLE int start(const QString& config_path) override { + Q_INVOKABLE int start(const QString& config_path) override { if (node) { qWarning() << "Node already started"; return 1; @@ -43,7 +50,7 @@ public: return 0; } - Q_INVOKABLE void stop() override { + Q_INVOKABLE void stop() override { if (!node) { qWarning() << "Node not running"; return; diff --git a/library.h b/library.h index 60e6e7c..21a2023 100644 --- a/library.h +++ b/library.h @@ -3,16 +3,9 @@ #include -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - class LogosBlockchainModuleAPI : public QObject, public PluginInterface { Q_OBJECT + Q_INTERFACES(PluginInterface) public: using QObject::QObject;