mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 23:31:32 +02:00
This commit introduces a websocket server via the --daemon argument.
``` ./wowlet --daemon 127.0.0.1:1234 --daemon-password "sekrit" ``` The wallet will start in the background and expose a websocket port that you can connect to using a websocket client. This way, you will be able to control the wallet via websockets. The commands are defined in wsserver.cpp, in the `processBinaryMessage()` function. - `openWallet` - opens a wallet by path/password. - `closeWallet` - close current wallet. - `addressList` - Returns a list of receive addresses. - `sendTransaction` - Creates and sends a transaction. - `createWallet` - Create a wallet by path/password. - `transactionHistory` - Returns the complete list of transactions - `addressBook` - Returns the complete list of address book entries. Messages sent back and forth between the server and client are JSON. There is a Python example client available over at https://git.wownero.com/wownero/wowlet-ws-client
This commit is contained in:
+4
-2
@@ -1,13 +1,13 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright (c) 2020-2021, The Monero Project.
|
||||
|
||||
#include "cli.h"
|
||||
|
||||
// libwalletqt
|
||||
#include "libwalletqt/TransactionHistory.h"
|
||||
#include "model/AddressBookModel.h"
|
||||
#include "model/TransactionHistoryModel.h"
|
||||
|
||||
#include "cli.h"
|
||||
|
||||
CLI::CLI(AppContext *ctx, QObject *parent) :
|
||||
QObject(parent),
|
||||
ctx(ctx) {
|
||||
@@ -22,6 +22,8 @@ void CLI::run() {
|
||||
if(!ctx->cmdargs->isSet("wallet-file")) return this->finishedError("--wallet-file argument missing");
|
||||
if(!ctx->cmdargs->isSet("password")) return this->finishedError("--password argument missing");
|
||||
ctx->onOpenWallet(ctx->cmdargs->value("wallet-file"), ctx->cmdargs->value("password"));
|
||||
} else if(mode == CLIMode::CLIDaemonize) {
|
||||
m_wsServer = new WSServer(ctx, QHostAddress(this->backgroundWebsocketAddress), this->backgroundWebsocketPort, this->backgroundWebsocketPassword, true, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user