adding extra inputs for wownerod mining
This commit is contained in:
parent
7c4f99c85d
commit
87d7609022
|
@ -32,6 +32,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
|||
{Config::walletPath,{QS("walletPath"), ""}},
|
||||
{Config::xmrigPath,{QS("xmrigPath"), ""}},
|
||||
{Config::wownerodPath, {QS("wownerodPath"), ""}},
|
||||
{Config::extraArgs, {QS("extraArgs"), ""}},
|
||||
{Config::nodes,{QS("nodes"), "{}"}},
|
||||
{Config::websocketEnabled,{QS("websocketEnabled"), true}},
|
||||
{Config::nodeSource,{QS("nodeSource"), 0}},
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
walletPath,
|
||||
xmrigPath,
|
||||
wownerodPath,
|
||||
extraArgs,
|
||||
nodes,
|
||||
websocketEnabled,
|
||||
nodeSource,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "utils/xmrig.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
XmRig::XmRig(const QString &configDir, QObject *parent) :
|
||||
XmRig::XmRig(const QString &configDir, QObject *parent, QString extraArgs) :
|
||||
QObject(parent),
|
||||
m_statusTimer(new QTimer(this))
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ void XmRig::stop() {
|
|||
m_statusTimer->stop();
|
||||
}
|
||||
|
||||
bool XmRig::start(const QString &path, int threads) {
|
||||
bool XmRig::start(const QString &path, int threads, QString extraArgs) {
|
||||
m_ctx = MainWindow::getContext();
|
||||
|
||||
auto state = m_process.state();
|
||||
|
@ -72,6 +72,9 @@ bool XmRig::start(const QString &path, int threads) {
|
|||
arguments << "--start-mining" << m_ctx->currentWallet->address(0, 0);
|
||||
arguments << "--spendkey" << privateSpendKey;
|
||||
|
||||
// additional arguments to wownerod a user can define
|
||||
arguments << extraArgs;
|
||||
|
||||
QString cmd = QString("%1 %2").arg(path, arguments.join(" "));
|
||||
cmd = cmd.replace(privateSpendKey, "[redacted]");
|
||||
emit output(cmd.toUtf8());
|
||||
|
|
|
@ -27,10 +27,10 @@ class XmRig : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit XmRig(const QString &configDir, QObject *parent = nullptr);
|
||||
explicit XmRig(const QString &configDir, QObject *parent = nullptr, QString extraArgs = nullptr);
|
||||
void prepare();
|
||||
|
||||
bool start(const QString &path, int threads);
|
||||
bool start(const QString &path, int threads, QString extraArgs);
|
||||
void stop();
|
||||
|
||||
DaemonMiningState daemonMiningState = DaemonMiningState::idle;
|
||||
|
|
|
@ -63,6 +63,10 @@ XMRigWidget::XMRigWidget(AppContext *ctx, QWidget *parent) :
|
|||
if(!path.isEmpty())
|
||||
ui->lineEdit_path->setText(path);
|
||||
|
||||
auto extraArgs = config()->get(Config::extraArgs).toString();
|
||||
if(!extraArgs.isEmpty())
|
||||
ui->extraArgs->setText(extraArgs);
|
||||
|
||||
connect(ui->lineEdit_path, &QLineEdit::textChanged, [=] {
|
||||
config()->set(Config::wownerodPath, ui->lineEdit_path->text().trimmed());
|
||||
});
|
||||
|
@ -208,7 +212,8 @@ void XMRigWidget::onClearClicked() {
|
|||
|
||||
void XMRigWidget::onStartClicked() {
|
||||
auto binPath = config()->get(Config::wownerodPath).toString();
|
||||
if(!m_ctx->XMRig->start(binPath, m_threads)) return;
|
||||
auto extraArgs = config()->get(Config::extraArgs).toString();
|
||||
if(!m_ctx->XMRig->start(binPath, m_threads, extraArgs)) return;
|
||||
|
||||
ui->btn_start->setEnabled(false);
|
||||
ui->btn_stop->setEnabled(true);
|
||||
|
|
|
@ -227,13 +227,31 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="extraArgs_label">
|
||||
<property name="text">
|
||||
<string>Extra Args</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="extraArgs">
|
||||
<property name="placeholderText">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_threads">
|
||||
<property name="text">
|
||||
<string>CPU threads</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QSlider" name="threadSlider">
|
||||
|
|
Loading…
Reference in New Issue