Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
azure-cloud-mining-script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
azure-cloud-mining-script
Commits
42383a28
There was an error fetching the commit references. Please try again later.
Commit
42383a28
authored
7 years ago
by
Unknown
Committed by
fireice-uk
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow pool settings to be fully set from CLI options
parent
a142161a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xmrstak/cli/cli-miner.cpp
+51
-4
51 additions, 4 deletions
xmrstak/cli/cli-miner.cpp
xmrstak/params.hpp
+1
-0
1 addition, 0 deletions
xmrstak/params.hpp
with
52 additions
and
4 deletions
xmrstak/cli/cli-miner.cpp
+
51
−
4
View file @
42383a28
...
...
@@ -87,6 +87,7 @@ void help()
cout
<<
" "
<<
endl
;
cout
<<
"The Following options temporary overwrites the config entries of
\n
the pool with the highest weight:"
<<
endl
;
cout
<<
" -o, --url URL pool url and port, e.g. pool.usxmrpool.com:3333"
<<
endl
;
cout
<<
" -O, --tls-url URL TLS pool url and port, e.g. pool.usxmrpool.com:10443"
<<
endl
;
cout
<<
" -u, --user USERNAME pool user name or wallet address"
<<
endl
;
cout
<<
" -p, --pass PASSWD pool password, in the most cases x or empty
\"\"
"
<<
endl
;
cout
<<
"
\n
"
<<
endl
;
...
...
@@ -162,6 +163,15 @@ std::string get_multipool_entry(bool& final)
",
\"
tls_fingerprint
\"
:
\"\"
,
\"
pool_weight
\"
: "
+
std
::
to_string
(
pool_weight
)
+
" },
\n
"
;
}
inline
void
prompt_once
(
bool
&
prompted
)
{
if
(
!
prompted
)
{
std
::
cout
<<
"Please enter:"
<<
std
::
endl
;
prompted
=
true
;
}
}
void
do_guided_config
(
bool
userSetPasswd
)
{
using
namespace
xmrstak
;
...
...
@@ -173,10 +183,13 @@ void do_guided_config(bool userSetPasswd)
configEditor
configTpl
{};
configTpl
.
set
(
std
::
string
(
tpl
));
std
::
cout
<<
"Please enter:"
<<
std
::
endl
;
bool
prompted
=
false
;
auto
&
currency
=
params
::
inst
().
currency
;
if
(
currency
.
empty
())
{
prompt_once
(
prompted
);
std
::
string
tmp
;
#if defined(CONF_NO_AEON)
tmp
=
"monero"
;
...
...
@@ -196,6 +209,8 @@ void do_guided_config(bool userSetPasswd)
bool
userSetPool
=
true
;
if
(
pool
.
empty
())
{
prompt_once
(
prompted
);
userSetPool
=
false
;
if
(
currency
==
"monero"
)
std
::
cout
<<
"- Pool address: e.g. pool.usxmrpool.com:3333"
<<
std
::
endl
;
...
...
@@ -207,6 +222,8 @@ void do_guided_config(bool userSetPasswd)
auto
&
userName
=
params
::
inst
().
poolUsername
;
if
(
userName
.
empty
())
{
prompt_once
(
prompted
);
std
::
cout
<<
"- Username (wallet address or pool login):"
<<
std
::
endl
;
std
::
cin
>>
userName
;
}
...
...
@@ -214,18 +231,35 @@ void do_guided_config(bool userSetPasswd)
auto
&
passwd
=
params
::
inst
().
poolPasswd
;
if
(
passwd
.
empty
()
&&
(
!
userSetPasswd
))
{
prompt_once
(
prompted
);
// clear everything from stdin to allow an empty password
std
::
cin
.
clear
();
std
::
cin
.
ignore
(
INT_MAX
,
'\n'
);
std
::
cout
<<
"- Password (mostly empty or x):"
<<
std
::
endl
;
getline
(
std
::
cin
,
passwd
);
}
bool
tls
;
#ifdef CONF_NO_TLS
bool
tls
=
false
;
tls
=
false
;
#else
bool
tls
=
read_yes_no
(
"- Does this pool port support TLS/SSL? Use no if unknown. (y/N)"
);
if
(
!
userSetPool
)
{
prompt_once
(
prompted
);
tls
=
read_yes_no
(
"- Does this pool port support TLS/SSL? Use no if unknown. (y/N)"
);
}
else
tls
=
params
::
inst
().
poolUseTls
;
#endif
bool
nicehash
=
read_yes_no
(
"- Do you want to use nicehash on this pool? (y/n)"
);
bool
nicehash
;
if
(
!
userSetPool
)
{
prompt_once
(
prompted
);
nicehash
=
read_yes_no
(
"- Do you want to use nicehash on this pool? (y/n)"
);
}
else
nicehash
=
false
;
bool
multipool
;
if
(
!
userSetPool
)
...
...
@@ -428,6 +462,19 @@ int main(int argc, char *argv[])
return
1
;
}
params
::
inst
().
poolURL
=
argv
[
i
];
params
::
inst
().
poolUseTls
=
false
;
}
else
if
(
opName
.
compare
(
"-O"
)
==
0
||
opName
.
compare
(
"--tls-url"
)
==
0
)
{
++
i
;
if
(
i
>=
argc
)
{
printer
::
inst
()
->
print_msg
(
L0
,
"No argument for parameter '-O/--tls-url' given"
);
win_exit
();
return
1
;
}
params
::
inst
().
poolURL
=
argv
[
i
];
params
::
inst
().
poolUseTls
=
true
;
}
else
if
(
opName
.
compare
(
"-u"
)
==
0
||
opName
.
compare
(
"--user"
)
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
xmrstak/params.hpp
+
1
−
0
View file @
42383a28
...
...
@@ -24,6 +24,7 @@ struct params
bool
useNVIDIA
;
bool
useCPU
;
bool
poolUseTls
;
std
::
string
poolURL
;
std
::
string
poolPasswd
;
std
::
string
poolUsername
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment