Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 0d79fea

Browse files
committedSep 3, 2018
Merge remote-tracking branch 'origin/master' into release/0.16
2 parents 0fd6889 + ef085b6 commit 0d79fea

40 files changed

+1084
-740
lines changed
 

‎.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Declare files that will always have LF line endings on checkout.
2+
*.bash text eol=lf
3+
*.cpp text eol=lf
4+
*.h text eol=lf
5+
*.py text eol=lf
6+
*.sh text eol=lf

‎.travis.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ matrix:
2323
cache:
2424
directories:
2525
- $HOME/.local
26-
before_install: |
26+
before_install:
27+
- |
28+
if [ "$TRAVIS_OS_NAME" = linux ]; then
29+
echo "Checking format of sourcecode..."
30+
find . -type f -name '*.cpp' -print0 -name '*.h' -print0 | xargs -r0 ./scripts/check_code_format.py --all --warn
31+
fi
32+
- |
2733
if [ "$TRAVIS_OS_NAME" = linux ]; then
2834
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
2935
sudo apt-get -q update
@@ -45,13 +51,17 @@ script: |
4551
build/ethminer/ethminer --list-devices -U
4652
if [ "$TRAVIS_OS_NAME" = linux ]; then ldd -v build/ethminer/ethminer; fi
4753
if [ "$TRAVIS_OS_NAME" = osx ]; then otool -L build/ethminer/ethminer; fi
54+
. build/ethminer/buildinfo.sh
55+
mkdir package
56+
mv build/ethminer.tar.gz package/$PROJECT_NAME-$PROJECT_VERSION-$SYSTEM_NAME-$SYSTEM_PROCESSOR.tar.gz
57+
4858
4959
deploy:
5060
- provider: releases
5161
api_key:
5262
secure: "KfYTW8o20BUEZc57vF3H4+qXgpDsMeWk3N4IQtNKkdhFzEUzQaXi1WHRtvcR5kq+rvDiXwy0fELglDZpCSa4wfQvM5fKlb7WPQgkyRZyCpwnXlqvb6dL8KxJekQHZ5fFpzc/ow0dx/UqzJgv+cWDnBEK/gl+9j+vt9oq1nV1LSaxmtO3Qs7y+ffq5Tbzo06q6/CfeyOZi23g+AYtnoEBKwYqa807atWM6cJpudPmyhYHQFgaQZMfzk44z/MnJb7nxtkqcx57KWaY2EHlFj6yrHMcXWyM8j+P0ZBwUbOpHkWvBpgmDKR2J3u0WmiJDDo3E6K0g9QgbAnF5+yqvpBC5kaSHAaicJ3+7ghSgo18Eea0BkLbmb0t93h5NJfRhg0GDjgG3LkHao9ALM35x3OXG38JI6bOLd6jSV2Vkg8qLWAZjP1TUb/4VTIFnyITSv+xrY7ZP9D0XcRybZ5Z0YnaI/J6NFJct9ICAlQ6cHkS0MO6PICTSbZbKhbDZP0Lt6iDDUeje5+uvPAl0uuzuciSqEM77JWYN/edOXurgkfljEny3P96AW70gUUBTVEE+4tjng4DMLHCH/1Jg/WfMPfSVC3AUR0WbvjMki6veMt37fy8Jys8gFpwZbMG3cCSkYXDDFWF/Q+p2v6pX76CZZz+LxO2XcZ7x4bw+c7AGzRWV7c="
5363
file_glob: true
54-
file: build/ethminer-*.tar.gz
64+
file: package/*
5565
skip_cleanup: true
5666
on:
5767
tags: true

‎CHANGELOG.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
99
### Fixed
1010

1111
- Eliminated duplicate solutions with stratum2 on difficulty changes.
12-
- Restored proper behavior of -P argument to identify workernames and emails
12+
- Restored proper behavior of `-P` argument to identify workernames and emails
1313

1414
### Added
1515

1616
- Basic API authentication to protect exposure of API port to the internet [#1228](https://github.com/ethereum-mining/ethminer/pull/1228).
1717
- Add `ispaused` information into response of `miner_getstathr` API query [#1232](https://github.com/ethereum-mining/ethminer/pull/1232).
1818
- API responses return "ethminer-" as version prefix. [#1300](https://github.com/ethereum-mining/ethminer/pull/1300).
19-
- Stratum mode autodetection. No need to specify stratum+tcp or stratum1+tcp or stratum2+tcp
19+
- Stratum mode autodetection. No need to specify `stratum+tcp` or `stratum1+tcp` or `stratum2+tcp`
2020
- Connection failed due to login errors (wrong address or worker) are marked Unrecoverable and no longer used
21-
- Replaced opencl kernel with opensource jawawawa opencl kernel
21+
- Replaced OpenCL kernel with opensource jawawawa OpenCL kernel
2222
- Added support for jawawawa AMD binary kernels
23-
- AMD auto kernel selection. Try bin first, if not fall back to opencl.
23+
- AMD auto kernel selection. Try bin first, if not fall back to OpenCL.
2424
- API: New method `miner_setverbosity`. [#1382](https://github.com/ethereum-mining/ethminer/pull/1382).
2525
- Implemented fast job switch algorithm on AMD reducing switch time to 1-2 milliseconds.
2626
- Added localization support for output number formatting
2727

2828
### Removed
2929

30-
- Command line argument --stratum-email : any information needed to authenticate on the pool **MUST BE** set using `-P` argument
30+
- Command line argument `--stratum-email`: any information needed to authenticate on the pool **MUST BE** set using the `-P` argument
3131

3232
## 0.15.0rc1
3333

‎docs/POOL_EXAMPLES_ETH.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
# Pool Examples for ETH
22

3-
This is a collection of examples how to connect ethminer to your favorite ETH pool (alphabetic order).
3+
Pool connection definition is issued via `-P` argument which has this syntax
44

5-
* Stratum connection is preferred than getwork connection due to its better network latency.
5+
```
6+
-P scheme://user[.workername][:password]@hostname:port[/...]
7+
```
8+
__values in square brackets are optional__
9+
10+
where `scheme` can be any of:
11+
12+
* `http` for getwork mode (geth)
13+
* `stratum+tcp` for plain stratum mode
14+
* `stratum1+tcp` for plain stratum eth-proxy compatible mode
15+
* `stratum2+tcp` for plain stratum NiceHash compatible mode
16+
17+
## Secure socket comunications for stratum only
18+
19+
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)
20+
To enable it simply replace tcp with either:
21+
22+
* `tls` to enable secure socket communication
23+
* `ssl` or `tls12` to enable secure socket communication **allowing only TLS 1.2** encryption
24+
25+
thus your connection scheme changes to `-P stratum+tls://[...]` or `-P stratum+tls12://[...]`. Same applies for `stratum1` and `stratum2`
26+
27+
## Only for version 0.16+ (older versions not affected)
28+
29+
Stratum autodetection has been introduced to mitigate user's duty to guess/find which stratum flavour to apply (stratum or stratum1 or stratum2).
30+
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.
31+
32+
## Common samples
33+
34+
Here you can find a collection of samples to connect to most commonly used ethash pools. (alphabetic order).
35+
36+
* Stratum connection is **always to be preferred** over **getwork** when pool offers it due to its better network latency.
637
* If possible the samples use a protocol which supports reporting of hashrate (`--report-hashrate`) if pool supports this.
738

839
**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
3768
| [nanopool.org](#nanopoolorg) | <https://nanopool.org/> | <https://eth.nanopool.org/help> |
3869
| [nicehash.com](#nicehashcom) | <https://www.nicehash.com/> | <https://www.nicehash.com/help/which-stratum-servers-are-available> |
3970
| [sparkpool.com](#sparkpoolcom) | <https://sparkpool.com/> | <https://eth.sparkpool.com/> |
71+
| [whalesburg.com](#whalesburgcom) | <https://whalesburg.com/> | <https://whalesburg.com/start_mining/> |
4072

4173
### 2miners.com
4274

@@ -170,3 +202,9 @@ Without email:
170202
-P stratum1+tcp://ETH_WALLET.WORKERNAME@na-west.sparkpool.com:3333
171203
-P stratum1+tcp://ETH_WALLET.WORKERNAME@tw.sparkpool.com:3333
172204
```
205+
206+
### whalesburg.com
207+
208+
```
209+
-P stratum1+tcp://ETH_WALLET.WORKERNAME@proxy.pool.whalesburg.com:8082
210+
```

‎ethminer/main.cpp

+46-52
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
This file is part of cpp-ethereum.
2+
This file is part of ethminer.
33
4-
cpp-ethereum is free software: you can redistribute it and/or modify
4+
ethminer is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
66
the Free Software Foundation, either version 3 of the License, or
77
(at your option) any later version.
88
9-
cpp-ethereum is distributed in the hope that it will be useful,
9+
ethminer is distributed in the hope that it will be useful,
1010
but WITHOUT ANY WARRANTY; without even the implied warranty of
1111
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
GNU General Public License for more details.
1313
1414
You should have received a copy of the GNU General Public License
15-
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
15+
along with ethminer. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

1818
#include <CLI/CLI.hpp>
@@ -267,7 +267,7 @@ class MinerCLI
267267

268268
#if API_CORE
269269
app.add_option("--api-bind", m_api_bind,
270-
"Set the api address:port the miner should listen to. Use negative port number for "
270+
"Set the API address:port the miner should listen to. Use negative port number for "
271271
"readonly mode",
272272
true)
273273
->group(APIGroup)
@@ -283,20 +283,20 @@ class MinerCLI
283283
return string("");
284284
});
285285
app.add_option("--api-port", m_api_port,
286-
"Set the api port, the miner should listen to. Use 0 to disable. Use negative "
286+
"Set the API port, the miner should listen to. Use 0 to disable. Use negative "
287287
"numbers for readonly mode",
288288
true)
289289
->group(APIGroup)
290290
->check(CLI::Range(-65535, 65535));
291291

292292
app.add_option("--api-password", m_api_password,
293-
"Set the password to protect interaction with Api server. If not set any connection "
293+
"Set the password to protect interaction with API server. If not set, any connection "
294294
"is granted access. "
295-
"Be advised passwords are sent unencrypted over plain tcp !!")
295+
"Be advised passwords are sent unencrypted over plain TCP!!")
296296
->group(APIGroup);
297297

298298
app.add_option("--http-bind", m_http_bind,
299-
"Set the web api address:port the miner should listen to.", true)
299+
"Set the web API address:port the miner should listen to.", true)
300300
->group(APIGroup)
301301
->check([this](const string& bind_arg) -> string {
302302
string errormsg;
@@ -308,7 +308,7 @@ class MinerCLI
308308
if (port < 0)
309309
{
310310
throw CLI::ValidationError("--http-bind",
311-
"the web api does not have read/write modes, specify a positive port "
311+
"the web API does not have read/write modes, specify a positive port "
312312
"number between 1-65535");
313313
}
314314
this->m_http_port = static_cast<uint16_t>(port);
@@ -318,7 +318,7 @@ class MinerCLI
318318
});
319319

320320
app.add_option("--http-port", m_http_port,
321-
"Set the web api port, the miner should listen to. Use 0 to disable. Data shown "
321+
"Set the web API port, the miner should listen to. Use 0 to disable. Data shown "
322322
"depends on hwmon setting",
323323
true)
324324
->group(APIGroup)
@@ -469,39 +469,34 @@ class MinerCLI
469469
->check(CLI::Range(30, 100));
470470

471471
stringstream ssHelp;
472-
ssHelp << "Pool URL Specification:" << endl
473-
<< " URL takes the form: scheme://user[:password]@hostname:port[/emailaddress]."
474-
<< endl
475-
<< " for getwork use one of the following schemes:" << endl
476-
<< " " << URI::KnownSchemes(ProtocolFamily::GETWORK) << endl
477-
<< " for stratum use one of the following schemes: " << endl
478-
<< " " << URI::KnownSchemes(ProtocolFamily::STRATUM) << endl
479-
<< " Stratum variants:" << endl
480-
<< " stratum: official stratum spec: ethpool, ethermine, coinotron, mph, "
481-
"nanopool (default)"
482-
<< endl
483-
<< " stratum1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for "
484-
"hashrate reporting to work with nanopool)"
485-
<< endl
486-
<< " stratum2: EthereumStratum/1.0.0: nicehash" << endl
487-
<< " Example 1: "
488-
"stratum+ssl://0x012345678901234567890234567890123.miner1@ethermine.org:5555"
489-
<< endl
490-
<< " Example 2: "
491-
"stratum1+tcp://0x012345678901234567890234567890123.miner1@nanopool.org:9999/"
492-
"john.doe@gmail.com"
493-
<< endl
494-
<< " Example 3: "
495-
"stratum1+tcp://0x012345678901234567890234567890123@nanopool.org:9999/miner1/"
496-
"john.doe@gmail.com"
497-
<< endl
498-
<< endl
499-
<< "Environment Variables:" << endl
500-
<< " NO_COLOR - set to any value to disable color output. Unset to re-enable "
501-
"color output."
502-
<< endl
503-
<< " SYSLOG - set to any value to strip time and disable color from output, "
504-
"for logging under systemd";
472+
ssHelp
473+
<< "Pool URL Specification:" << endl
474+
<< " URL takes the form: scheme://user[.workername][:password]@hostname:port[/...]."
475+
<< endl
476+
<< " where scheme can be any of:" << endl
477+
<< " getwork for getWork mode" << endl
478+
<< " stratum for stratum mode" << endl
479+
<< " stratums for secure stratum mode" << endl
480+
<< " stratumss for secure stratum mode with strong TLS12 verification" << endl
481+
<< endl
482+
<< " Example 1:"
483+
" stratums://0x012345678901234567890234567890123.miner1@ethermine.org:5555"
484+
<< endl
485+
<< " Example 2:"
486+
" stratum://0x012345678901234567890234567890123.miner1@nanopool.org:9999/"
487+
"john.doe@gmail.com"
488+
<< endl
489+
<< " Example 3:"
490+
" stratum://0x012345678901234567890234567890123@nanopool.org:9999/miner1/"
491+
"john.doe@gmail.com"
492+
<< endl
493+
<< endl
494+
<< "Environment Variables:" << endl
495+
<< " NO_COLOR - set to any value to disable color output. Unset to re-enable "
496+
"color output."
497+
<< endl
498+
<< " SYSLOG - set to any value to strip time and disable color from output, "
499+
"for logging under systemd";
505500
app.footer(ssHelp.str());
506501

507502
try
@@ -747,7 +742,7 @@ class MinerCLI
747742
genesis.setNumber(m_benchmarkBlock);
748743
genesis.setDifficulty(u256(1) << 64);
749744

750-
Farm f(m_io_service);
745+
Farm f(m_io_service, m_show_hwmonitors, m_show_power);
751746
map<string, Farm::SealerDescriptor> sealers;
752747
#if ETH_ETHASHCL
753748
sealers["opencl"] = Farm::SealerDescriptor{&CLMiner::instances,
@@ -794,11 +789,11 @@ class MinerCLI
794789
auto mp = f.miningProgress();
795790
if (!i)
796791
continue;
797-
auto rate = mp.rate();
792+
auto rate = uint64_t(mp.hashRate);
798793

799794
cout << rate << endl;
800795
results.push_back(rate);
801-
mean += rate;
796+
mean += uint64_t(rate);
802797
}
803798
sort(results.begin(), results.end());
804799
cout << "min/mean/max: " << results.front() << "/" << (mean / _trials) << "/"
@@ -858,7 +853,7 @@ class MinerCLI
858853
}
859854

860855
// sealers, m_minerType
861-
Farm f(m_io_service);
856+
Farm f(m_io_service, m_show_hwmonitors, m_show_power);
862857
f.setSealers(sealers);
863858

864859
PoolManager mgr(m_io_service, client, f, m_minerType, m_maxFarmRetries, m_failovertimeout);
@@ -910,9 +905,8 @@ class MinerCLI
910905
}
911906
if (mgr.isConnected())
912907
{
913-
auto mp = f.miningProgress(m_show_hwmonitors, m_show_power);
914-
minelog << mp << ' ' << f.getSolutionStats() << ' '
915-
<< f.farmLaunchedFormatted();
908+
auto mp = f.miningProgress();
909+
minelog << mp << ' ' << f.getSolutionStats() << ' ' << f.farmLaunchedFormatted();
916910

917911
#if ETH_DBUS
918912
dbusint.send(toString(mp).c_str());
@@ -935,7 +929,7 @@ class MinerCLI
935929
mgr.stop();
936930
stop_io_service();
937931

938-
cnote << "Terminated !";
932+
cnote << "Terminated!";
939933
exit(0);
940934
}
941935

0 commit comments

Comments
 (0)
This repository has been archived.