Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release/0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Sep 3, 2018
2 parents 0fd6889 + ef085b6 commit 0d79fea
Show file tree
Hide file tree
Showing 40 changed files with 1,084 additions and 740 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
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
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ matrix:
cache:
directories:
- $HOME/.local
before_install: |
before_install:
- |
if [ "$TRAVIS_OS_NAME" = linux ]; then
echo "Checking format of sourcecode..."
find . -type f -name '*.cpp' -print0 -name '*.h' -print0 | xargs -r0 ./scripts/check_code_format.py --all --warn
fi
- |
if [ "$TRAVIS_OS_NAME" = linux ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get -q update
Expand All @@ -45,13 +51,17 @@ script: |
build/ethminer/ethminer --list-devices -U
if [ "$TRAVIS_OS_NAME" = linux ]; then ldd -v build/ethminer/ethminer; fi
if [ "$TRAVIS_OS_NAME" = osx ]; then otool -L build/ethminer/ethminer; fi
. build/ethminer/buildinfo.sh
mkdir package
mv build/ethminer.tar.gz package/$PROJECT_NAME-$PROJECT_VERSION-$SYSTEM_NAME-$SYSTEM_PROCESSOR.tar.gz
deploy:
- provider: releases
api_key:
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="
file_glob: true
file: build/ethminer-*.tar.gz
file: package/*
skip_cleanup: true
on:
tags: true
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

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

### Added

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

### Removed

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

## 0.15.0rc1

Expand Down
42 changes: 40 additions & 2 deletions docs/POOL_EXAMPLES_ETH.md
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.**
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
```
98 changes: 46 additions & 52 deletions ethminer/main.cpp
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>
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) << "/"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand All @@ -935,7 +929,7 @@ class MinerCLI
mgr.stop();
stop_io_service();

cnote << "Terminated !";
cnote << "Terminated!";
exit(0);
}

Expand Down
Loading

0 comments on commit 0d79fea

Please sign in to comment.