This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
forked from ethereum-mining/ethminer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release/0.16
- Loading branch information
Showing
40 changed files
with
1,084 additions
and
740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Declare files that will always have LF line endings on checkout. | ||
*.bash text eol=lf | ||
*.cpp text eol=lf | ||
*.h text eol=lf | ||
*.py text eol=lf | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cable
updated
7 files
+4 −4 | CableBuildInfo.cmake | |
+1 −1 | bootstrap.cmake | |
+22 −9 | buildinfo/buildinfo.cmake | |
+10 −0 | buildinfo/buildinfo.json.in | |
+31 −4 | buildinfo/gitinfo.cmake | |
+12 −0 | toolchains/cxx11-fpic.cmake | |
+9 −0 | toolchains/cxx11-pic.cmake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,39 @@ | ||
# Pool Examples for ETH | ||
|
||
This is a collection of examples how to connect ethminer to your favorite ETH pool (alphabetic order). | ||
Pool connection definition is issued via `-P` argument which has this syntax | ||
|
||
* Stratum connection is preferred than getwork connection due to its better network latency. | ||
``` | ||
-P scheme://user[.workername][:password]@hostname:port[/...] | ||
``` | ||
__values in square brackets are optional__ | ||
|
||
where `scheme` can be any of: | ||
|
||
* `http` for getwork mode (geth) | ||
* `stratum+tcp` for plain stratum mode | ||
* `stratum1+tcp` for plain stratum eth-proxy compatible mode | ||
* `stratum2+tcp` for plain stratum NiceHash compatible mode | ||
|
||
## Secure socket comunications for stratum only | ||
|
||
Ethminer supports secure socket communications (where pool implements and offers it) to avoid the risk of a [man-in-the-middle attack](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) | ||
To enable it simply replace tcp with either: | ||
|
||
* `tls` to enable secure socket communication | ||
* `ssl` or `tls12` to enable secure socket communication **allowing only TLS 1.2** encryption | ||
|
||
thus your connection scheme changes to `-P stratum+tls://[...]` or `-P stratum+tls12://[...]`. Same applies for `stratum1` and `stratum2` | ||
|
||
## Only for version 0.16+ (older versions not affected) | ||
|
||
Stratum autodetection has been introduced to mitigate user's duty to guess/find which stratum flavour to apply (stratum or stratum1 or stratum2). | ||
If you want to let ethminer do the tests for you simply enter scheme as `stratum://` (note `+tcp` is missing) or `stratums://` for secure socket or `stratumss://` for secure socket **allowing only TLS 1.2** encryption. | ||
|
||
## Common samples | ||
|
||
Here you can find a collection of samples to connect to most commonly used ethash pools. (alphabetic order). | ||
|
||
* Stratum connection is **always to be preferred** over **getwork** when pool offers it due to its better network latency. | ||
* If possible the samples use a protocol which supports reporting of hashrate (`--report-hashrate`) if pool supports this. | ||
|
||
**Check for updates in the pool connection settings visiting the pools homepage.** | ||
|
@@ -37,6 +68,7 @@ The servers are listed in alphabetical order. To get best results reorder them f | |
| [nanopool.org](#nanopoolorg) | <https://nanopool.org/> | <https://eth.nanopool.org/help> | | ||
| [nicehash.com](#nicehashcom) | <https://www.nicehash.com/> | <https://www.nicehash.com/help/which-stratum-servers-are-available> | | ||
| [sparkpool.com](#sparkpoolcom) | <https://sparkpool.com/> | <https://eth.sparkpool.com/> | | ||
| [whalesburg.com](#whalesburgcom) | <https://whalesburg.com/> | <https://whalesburg.com/start_mining/> | | ||
|
||
### 2miners.com | ||
|
||
|
@@ -170,3 +202,9 @@ Without email: | |
-P stratum1+tcp://[email protected]:3333 | ||
-P stratum1+tcp://[email protected]:3333 | ||
``` | ||
|
||
### whalesburg.com | ||
|
||
``` | ||
-P stratum1+tcp://[email protected]:8082 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
/* | ||
This file is part of cpp-ethereum. | ||
This file is part of ethminer. | ||
cpp-ethereum is free software: you can redistribute it and/or modify | ||
ethminer is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
cpp-ethereum is distributed in the hope that it will be useful, | ||
ethminer is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. | ||
along with ethminer. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <CLI/CLI.hpp> | ||
|
@@ -267,7 +267,7 @@ class MinerCLI | |
|
||
#if API_CORE | ||
app.add_option("--api-bind", m_api_bind, | ||
"Set the api address:port the miner should listen to. Use negative port number for " | ||
"Set the API address:port the miner should listen to. Use negative port number for " | ||
"readonly mode", | ||
true) | ||
->group(APIGroup) | ||
|
@@ -283,20 +283,20 @@ class MinerCLI | |
return string(""); | ||
}); | ||
app.add_option("--api-port", m_api_port, | ||
"Set the api port, the miner should listen to. Use 0 to disable. Use negative " | ||
"Set the API port, the miner should listen to. Use 0 to disable. Use negative " | ||
"numbers for readonly mode", | ||
true) | ||
->group(APIGroup) | ||
->check(CLI::Range(-65535, 65535)); | ||
|
||
app.add_option("--api-password", m_api_password, | ||
"Set the password to protect interaction with Api server. If not set any connection " | ||
"Set the password to protect interaction with API server. If not set, any connection " | ||
"is granted access. " | ||
"Be advised passwords are sent unencrypted over plain tcp !!") | ||
"Be advised passwords are sent unencrypted over plain TCP!!") | ||
->group(APIGroup); | ||
|
||
app.add_option("--http-bind", m_http_bind, | ||
"Set the web api address:port the miner should listen to.", true) | ||
"Set the web API address:port the miner should listen to.", true) | ||
->group(APIGroup) | ||
->check([this](const string& bind_arg) -> string { | ||
string errormsg; | ||
|
@@ -308,7 +308,7 @@ class MinerCLI | |
if (port < 0) | ||
{ | ||
throw CLI::ValidationError("--http-bind", | ||
"the web api does not have read/write modes, specify a positive port " | ||
"the web API does not have read/write modes, specify a positive port " | ||
"number between 1-65535"); | ||
} | ||
this->m_http_port = static_cast<uint16_t>(port); | ||
|
@@ -318,7 +318,7 @@ class MinerCLI | |
}); | ||
|
||
app.add_option("--http-port", m_http_port, | ||
"Set the web api port, the miner should listen to. Use 0 to disable. Data shown " | ||
"Set the web API port, the miner should listen to. Use 0 to disable. Data shown " | ||
"depends on hwmon setting", | ||
true) | ||
->group(APIGroup) | ||
|
@@ -469,39 +469,34 @@ class MinerCLI | |
->check(CLI::Range(30, 100)); | ||
|
||
stringstream ssHelp; | ||
ssHelp << "Pool URL Specification:" << endl | ||
<< " URL takes the form: scheme://user[:password]@hostname:port[/emailaddress]." | ||
<< endl | ||
<< " for getwork use one of the following schemes:" << endl | ||
<< " " << URI::KnownSchemes(ProtocolFamily::GETWORK) << endl | ||
<< " for stratum use one of the following schemes: " << endl | ||
<< " " << URI::KnownSchemes(ProtocolFamily::STRATUM) << endl | ||
<< " Stratum variants:" << endl | ||
<< " stratum: official stratum spec: ethpool, ethermine, coinotron, mph, " | ||
"nanopool (default)" | ||
<< endl | ||
<< " stratum1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for " | ||
"hashrate reporting to work with nanopool)" | ||
<< endl | ||
<< " stratum2: EthereumStratum/1.0.0: nicehash" << endl | ||
<< " Example 1: " | ||
"stratum+ssl://[email protected]:5555" | ||
<< endl | ||
<< " Example 2: " | ||
"stratum1+tcp://[email protected]:9999/" | ||
"[email protected]" | ||
<< endl | ||
<< " Example 3: " | ||
"stratum1+tcp://[email protected]:9999/miner1/" | ||
"[email protected]" | ||
<< endl | ||
<< endl | ||
<< "Environment Variables:" << endl | ||
<< " NO_COLOR - set to any value to disable color output. Unset to re-enable " | ||
"color output." | ||
<< endl | ||
<< " SYSLOG - set to any value to strip time and disable color from output, " | ||
"for logging under systemd"; | ||
ssHelp | ||
<< "Pool URL Specification:" << endl | ||
<< " URL takes the form: scheme://user[.workername][:password]@hostname:port[/...]." | ||
<< endl | ||
<< " where scheme can be any of:" << endl | ||
<< " getwork for getWork mode" << endl | ||
<< " stratum for stratum mode" << endl | ||
<< " stratums for secure stratum mode" << endl | ||
<< " stratumss for secure stratum mode with strong TLS12 verification" << endl | ||
<< endl | ||
<< " Example 1:" | ||
" stratums://[email protected]:5555" | ||
<< endl | ||
<< " Example 2:" | ||
" stratum://[email protected]:9999/" | ||
"[email protected]" | ||
<< endl | ||
<< " Example 3:" | ||
" stratum://[email protected]:9999/miner1/" | ||
"[email protected]" | ||
<< endl | ||
<< endl | ||
<< "Environment Variables:" << endl | ||
<< " NO_COLOR - set to any value to disable color output. Unset to re-enable " | ||
"color output." | ||
<< endl | ||
<< " SYSLOG - set to any value to strip time and disable color from output, " | ||
"for logging under systemd"; | ||
app.footer(ssHelp.str()); | ||
|
||
try | ||
|
@@ -747,7 +742,7 @@ class MinerCLI | |
genesis.setNumber(m_benchmarkBlock); | ||
genesis.setDifficulty(u256(1) << 64); | ||
|
||
Farm f(m_io_service); | ||
Farm f(m_io_service, m_show_hwmonitors, m_show_power); | ||
map<string, Farm::SealerDescriptor> sealers; | ||
#if ETH_ETHASHCL | ||
sealers["opencl"] = Farm::SealerDescriptor{&CLMiner::instances, | ||
|
@@ -794,11 +789,11 @@ class MinerCLI | |
auto mp = f.miningProgress(); | ||
if (!i) | ||
continue; | ||
auto rate = mp.rate(); | ||
auto rate = uint64_t(mp.hashRate); | ||
|
||
cout << rate << endl; | ||
results.push_back(rate); | ||
mean += rate; | ||
mean += uint64_t(rate); | ||
} | ||
sort(results.begin(), results.end()); | ||
cout << "min/mean/max: " << results.front() << "/" << (mean / _trials) << "/" | ||
|
@@ -858,7 +853,7 @@ class MinerCLI | |
} | ||
|
||
// sealers, m_minerType | ||
Farm f(m_io_service); | ||
Farm f(m_io_service, m_show_hwmonitors, m_show_power); | ||
f.setSealers(sealers); | ||
|
||
PoolManager mgr(m_io_service, client, f, m_minerType, m_maxFarmRetries, m_failovertimeout); | ||
|
@@ -910,9 +905,8 @@ class MinerCLI | |
} | ||
if (mgr.isConnected()) | ||
{ | ||
auto mp = f.miningProgress(m_show_hwmonitors, m_show_power); | ||
minelog << mp << ' ' << f.getSolutionStats() << ' ' | ||
<< f.farmLaunchedFormatted(); | ||
auto mp = f.miningProgress(); | ||
minelog << mp << ' ' << f.getSolutionStats() << ' ' << f.farmLaunchedFormatted(); | ||
|
||
#if ETH_DBUS | ||
dbusint.send(toString(mp).c_str()); | ||
|
@@ -935,7 +929,7 @@ class MinerCLI | |
mgr.stop(); | ||
stop_io_service(); | ||
|
||
cnote << "Terminated !"; | ||
cnote << "Terminated!"; | ||
exit(0); | ||
} | ||
|
||
|
Oops, something went wrong.