mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-01-02 13:13:06 +00:00
Bring library to a base working state.
This commit is contained in:
parent
8a19f7cf43
commit
256ddb9f3f
3
.gitignore
vendored
3
.gitignore
vendored
@ -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/
|
||||||
13
library.cpp
13
library.cpp
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user