mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-01-02 05:03:08 +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
|
||||
liblogos-blockchain-module.so
|
||||
liblogos-blockchain-module.log
|
||||
|
||||
# Node
|
||||
nomos_db/
|
||||
13
library.cpp
13
library.cpp
@ -2,10 +2,17 @@
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <libnomos.h>
|
||||
#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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user