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
9201a732
There was an error fetching the commit references. Please try again later.
Commit
9201a732
authored
7 years ago
by
fireice-uk
Browse files
Options
Downloads
Patches
Plain Diff
Add option to enable web interface from cli
parent
52c30579
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
xmrstak/cli/cli-miner.cpp
+55
-3
55 additions, 3 deletions
xmrstak/cli/cli-miner.cpp
xmrstak/config.tpl
+1
-1
1 addition, 1 deletion
xmrstak/config.tpl
xmrstak/jconf.cpp
+4
-1
4 additions, 1 deletion
xmrstak/jconf.cpp
xmrstak/params.hpp
+4
-0
4 additions, 0 deletions
xmrstak/params.hpp
with
64 additions
and
5 deletions
xmrstak/cli/cli-miner.cpp
+
55
−
3
View file @
9201a732
...
...
@@ -85,6 +85,9 @@ void help()
#ifndef CONF_NO_CUDA
cout
<<
" --noNVIDIA disable the NVIDIA miner backend"
<<
endl
;
cout
<<
" --nvidia FILE NVIDIA backend miner config file"
<<
endl
;
#endif
#ifndef CONF_NO_HTTPD
cout
<<
" -i --httpd HTTP_PORT HTTP interface port"
<<
endl
;
#endif
cout
<<
" "
<<
endl
;
cout
<<
"The following options can be used for automatic start without a guided config,"
<<
endl
;
...
...
@@ -209,6 +212,28 @@ void do_guided_config()
currency
=
tmp
;
}
auto
&
http_port
=
params
::
inst
().
httpd_port
;
if
(
http_port
==
params
::
httpd_port_unset
)
{
#if defined(CONF_NO_HTTPD)
http_port
=
params
::
httpd_port_disabled
;
#else
std
::
cout
<<
"- Do you want to use the HTTP interface?"
<<
std
::
endl
;
std
::
cout
<<
"Unlike the screen display, browser interface is not affected by the GPU lag."
<<
std
::
endl
;
std
::
cout
<<
"If you don't want to use it, please enter 0, otherwise enter port number that the miner should listen on"
<<
std
::
endl
;
int32_t
port
;
while
(
!
(
std
::
cin
>>
port
)
||
port
<
0
||
port
>
65535
)
{
std
::
cin
.
clear
();
std
::
cin
.
ignore
(
INT_MAX
,
'\n'
);
std
::
cout
<<
"Invalid port number. Please enter a number between 0 and 65535."
<<
std
::
endl
;
}
http_port
=
port
;
#endif
}
auto
&
pool
=
params
::
inst
().
poolURL
;
bool
userSetPool
=
true
;
if
(
pool
.
empty
())
...
...
@@ -306,6 +331,7 @@ void do_guided_config()
configTpl
.
replace
(
"POOLCONF"
,
pool_table
);
configTpl
.
replace
(
"CURRENCY"
,
currency
);
configTpl
.
replace
(
"HTTP_PORT"
,
std
::
to_string
(
http_port
));
configTpl
.
write
(
params
::
inst
().
configFile
);
std
::
cout
<<
"Configuration stored in file '"
<<
params
::
inst
().
configFile
<<
"'"
<<
std
::
endl
;
}
...
...
@@ -504,6 +530,28 @@ int main(int argc, char *argv[])
}
params
::
inst
().
configFile
=
argv
[
i
];
}
else
if
(
opName
.
compare
(
"-i"
)
==
0
||
opName
.
compare
(
"--httpd"
)
==
0
)
{
++
i
;
if
(
i
>=
argc
)
{
printer
::
inst
()
->
print_msg
(
L0
,
"No argument for parameter '-i/--httpd' given"
);
win_exit
();
return
1
;
}
char
*
endp
=
nullptr
;
long
int
ret
=
strtol
(
argv
[
i
],
&
endp
,
10
);
if
(
endp
==
nullptr
||
ret
<
0
||
ret
>
65535
)
{
printer
::
inst
()
->
print_msg
(
L0
,
"Argument for parameter '-i/--httpd' must be a number between 0 and 65535"
);
win_exit
();
return
1
;
}
params
::
inst
().
httpd_port
=
ret
;
}
else
if
(
opName
.
compare
(
"--noUAC"
)
==
0
)
{
uacDialog
=
false
;
...
...
@@ -546,16 +594,20 @@ int main(int argc, char *argv[])
return
1
;
}
#ifndef CONF_NO_HTTPD
if
(
jconf
::
inst
()
->
GetHttpdPort
()
!=
0
)
if
(
jconf
::
inst
()
->
GetHttpdPort
()
!=
uint16_t
(
params
::
httpd_port_disabled
))
{
#ifdef CONF_NO_HTTPD
printer
::
inst
()
->
print_msg
(
L0
,
"HTTPD port is enabled but this binary was compiled without HTTP support!"
);
win_exit
();
return
1
;
#else
if
(
!
httpd
::
inst
()
->
start_daemon
())
{
win_exit
();
return
1
;
}
}
#endif
}
printer
::
inst
()
->
print_str
(
"-------------------------------------------------------------------
\n
"
);
printer
::
inst
()
->
print_str
(
get_version_str_short
().
c_str
());
...
...
This diff is collapsed.
Click to expand it.
xmrstak/config.tpl
+
1
−
1
View file @
9201a732
...
...
@@ -159,7 +159,7 @@ POOLCONF],
*
* httpd_port - Port we should listen on. Default, 0, will switch off the server.
*/
"httpd_port" :
0
,
"httpd_port" :
HTTP_PORT
,
/*
* HTTP Authentication
...
...
This diff is collapsed.
Click to expand it.
xmrstak/jconf.cpp
+
4
−
1
View file @
9201a732
...
...
@@ -242,7 +242,10 @@ uint64_t jconf::GetAutohashTime()
uint16_t
jconf
::
GetHttpdPort
()
{
return
prv
->
configValues
[
iHttpdPort
]
->
GetUint
();
if
(
xmrstak
::
params
::
inst
().
httpd_port
==
xmrstak
::
params
::
httpd_port_unset
)
return
prv
->
configValues
[
iHttpdPort
]
->
GetUint
();
else
return
uint16_t
(
xmrstak
::
params
::
inst
().
httpd_port
);
}
const
char
*
jconf
::
GetHttpUsername
()
...
...
This diff is collapsed.
Click to expand it.
xmrstak/params.hpp
+
4
−
0
View file @
9201a732
...
...
@@ -31,6 +31,10 @@ struct params
std
::
string
poolUsername
;
bool
nicehashMode
=
false
;
static
constexpr
int32_t
httpd_port_unset
=
-
1
;
static
constexpr
int32_t
httpd_port_disabled
=
0
;
int32_t
httpd_port
=
httpd_port_unset
;
std
::
string
currency
;
std
::
string
configFile
;
...
...
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