Bring library to a base working state.

This commit is contained in:
Alejandro Cabeza Romero 2025-12-19 17:31:26 +01:00
parent 8a19f7cf43
commit 256ddb9f3f
No known key found for this signature in database
GPG Key ID: DA3D14AE478030FD
3 changed files with 14 additions and 11 deletions

3
.gitignore vendored
View File

@ -11,3 +11,6 @@ cmake-build-debug
# Artifacts # Artifacts
liblogos-blockchain-module.so liblogos-blockchain-module.so
liblogos-blockchain-module.log liblogos-blockchain-module.log
# Node
nomos_db/

View File

@ -2,10 +2,17 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#ifdef __cplusplus
extern "C" {
#endif
#include <libnomos.h>
#ifdef __cplusplus
}
#endif
class LogosBlockchainModule : public LogosBlockchainModuleAPI { class LogosBlockchainModule : public LogosBlockchainModuleAPI {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID LogosBlockchainModuleInterface_iid FILE "metadata.json") Q_PLUGIN_METADATA(IID LogosBlockchainModuleInterface_iid FILE "metadata.json")
Q_INTERFACES(PluginInterface)
private: private:
NomosNode* node = nullptr; NomosNode* node = nullptr;
@ -24,7 +31,7 @@ public:
logosAPI = logosAPIInstance; logosAPI = logosAPIInstance;
} }
Q_INVOKABLE int start(const QString& config_path) override { Q_INVOKABLE int start(const QString& config_path) override {
if (node) { if (node) {
qWarning() << "Node already started"; qWarning() << "Node already started";
return 1; return 1;
@ -43,7 +50,7 @@ public:
return 0; return 0;
} }
Q_INVOKABLE void stop() override { Q_INVOKABLE void stop() override {
if (!node) { if (!node) {
qWarning() << "Node not running"; qWarning() << "Node not running";
return; return;

View File

@ -3,16 +3,9 @@
#include <core/interface.h> #include <core/interface.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <libnomos.h>
#ifdef __cplusplus
}
#endif
class LogosBlockchainModuleAPI : public QObject, public PluginInterface { class LogosBlockchainModuleAPI : public QObject, public PluginInterface {
Q_OBJECT Q_OBJECT
Q_INTERFACES(PluginInterface)
public: public:
using QObject::QObject; using QObject::QObject;