keva-stratum/README.md

213 lines
6.1 KiB
Markdown
Raw Normal View History

2019-04-20 19:47:02 +00:00
# keva-stratum
2015-07-05 09:49:07 +00:00
2019-04-20 23:07:25 +00:00
High performance CryptoNote mining stratum with Web-interface written in Golang. This project is forked from [monero-stratum](https://github.com/sammy007/monero-stratum), with the support for Kevacoin and simpler build process. It includes the part of Monero source code required for the project and does not need an external Monero source tree. It also builds on Windows through MSYS2.
2015-07-05 09:49:07 +00:00
2019-03-09 06:45:16 +00:00
[![Go Report Card](https://goreportcard.com/badge/github.com/kevacoin-project/keva-stratum)](https://goreportcard.com/report/github.com/kevacoin-project/keva-stratum)
2017-10-08 14:28:35 +00:00
2015-07-05 09:49:07 +00:00
**Stratum feature list:**
2016-12-07 12:33:42 +00:00
* Be your own pool
* Rigs availability monitoring
* Keep track of accepts, rejects, blocks stats
* Easy detection of sick rigs
* Daemon failover list
2016-08-07 04:05:02 +00:00
* Concurrent shares processing
2016-12-07 12:33:42 +00:00
* Beautiful Web-interface
2015-07-05 09:49:07 +00:00
2017-01-09 05:22:31 +00:00
![](https://cdn.pbrd.co/images/jRU3qJj83.png)
2017-01-09 05:17:45 +00:00
2016-12-06 09:37:21 +00:00
## Installation
2015-07-05 09:49:07 +00:00
Dependencies:
2018-03-14 16:24:37 +00:00
* go-1.6
2019-04-20 19:47:02 +00:00
* Everything required to build [Monero](https://github.com/monero-project/monero) or [Kevacoin](https://github.com/kevacoin-project/kevacoin). Follow their build instructions to install the dependencies for your system.
2015-07-05 09:49:07 +00:00
2016-12-06 09:37:21 +00:00
### Linux
2016-08-07 06:25:06 +00:00
2020-03-14 22:00:16 +00:00
Use Ubuntu 16.04 LTS or 18.04 LTS, or Ubuntu on Windows Linux Subsystem(WLS).
2015-07-05 09:49:07 +00:00
2017-06-23 03:56:24 +00:00
Install Golang and required packages:
2015-07-05 09:49:07 +00:00
2016-12-06 09:37:21 +00:00
sudo apt-get install golang
2019-04-20 23:02:38 +00:00
2015-07-05 09:49:07 +00:00
2017-06-23 03:56:24 +00:00
Clone stratum:
2015-07-05 09:49:07 +00:00
2019-03-09 06:45:16 +00:00
git clone https://github.com/kevacoin-project/keva-stratum.git
2019-04-20 19:47:02 +00:00
cd keva-stratum
2015-07-05 09:49:07 +00:00
2016-08-07 06:25:06 +00:00
Build stratum:
2019-04-20 23:02:38 +00:00
mkdir build
cd build
2019-11-06 04:17:10 +00:00
cmake ..
2017-06-23 03:56:24 +00:00
make
2016-08-07 06:25:06 +00:00
2020-03-14 22:00:16 +00:00
Run stratum:
2019-11-24 23:14:46 +00:00
2019-11-24 23:16:54 +00:00
./keva-stratum config.json
2020-03-14 22:00:16 +00:00
2019-11-24 23:12:52 +00:00
If you need to bind to privileged ports and don't want to run from `root`:
sudo apt-get install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' /path/to/keva-stratum
2020-03-14 22:00:16 +00:00
2017-06-23 03:56:24 +00:00
### Mac OS X
2016-08-07 06:25:06 +00:00
2019-04-20 19:47:02 +00:00
Install Golang and required packages:
brew update && brew install go
Clone stratum:
git clone https://github.com/kevacoin-project/keva-stratum.git
cd keva-stratum
Build stratum:
2015-07-05 09:49:07 +00:00
2019-04-20 23:02:38 +00:00
mkdir build
cd build
2019-11-06 04:12:53 +00:00
cmake ..
2016-12-06 09:37:21 +00:00
make
2015-07-05 09:49:07 +00:00
2020-03-14 22:00:16 +00:00
Run stratum:
2019-11-24 23:14:46 +00:00
2019-11-24 23:12:52 +00:00
./keva-stratum config.json
If you need to bind to privileged ports and don't want to run from `root`:
sudo apt-get install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' /path/to/keva-stratum
2015-07-05 09:49:07 +00:00
2019-04-20 19:47:02 +00:00
### Windows
2020-03-14 22:00:16 +00:00
If you are using Windows Linux Sytem (WLS), check the instruction under Linux.
2019-11-24 20:02:05 +00:00
2019-04-20 19:47:02 +00:00
Just like Monero, keva-stratum can be built on Windows using the MinGW toolchain within [MSYS2](https://www.msys2.org/) environment.
- Download and install the [MSYS2 installer](https://www.msys2.org/), either the 64-bit or the 32-bit package, depending on your system.
- Open the MSYS shell via the application `mingw32` (for 32-bit Windows) or `mingw64` (for 64-bit windows).
- Update packages using pacman:
pacman -Syu
- Install dependencies:
To build for 64-bit Windows:
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi
To build for 32-bit Windows:
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium mingw-w64-i686-hidapi
Install Golang:
pacman -S mingw-w64-x86_64-go
2017-06-23 03:56:24 +00:00
Clone stratum:
2019-03-09 06:45:16 +00:00
git clone https://github.com/kevacoin-project/keva-stratum.git
2019-04-20 19:47:02 +00:00
cd keva-stratum
2015-07-05 09:49:07 +00:00
2016-08-07 02:30:11 +00:00
Build stratum:
2015-07-05 09:49:07 +00:00
2019-04-20 23:02:38 +00:00
mkdir build
cd build
2020-03-14 22:00:16 +00:00
cmake -G "MSYS Makefiles" ..
2019-04-20 19:47:02 +00:00
**IMPORTANT: STOP AND CHECK**
Check the output of `cmake` and make sure it finds the `OpenSSL` library, and the library is **inside** your `MSYS2` directory. e.g. the output should be something like this:
-- Found OpenSSL: C:/msys64/mingw64/lib/libcrypto.dll.a (found version "1.1.1b")
If the `OpenSSL` is not inside your `MSYS2` directory, `cmake` is not using the correct `OpenSSL` library. e.g.
2019-04-20 23:02:38 +00:00
-- Found OpenSSL: C:/OpenSSL-Win64/lib/libeay32.lib (found version "1.0.2q")
2019-04-20 19:47:02 +00:00
In the above case, you need to adjust the search path so that `cmake` uses the correct library.
Now we are ready to build:
2017-06-23 03:56:24 +00:00
make
2019-04-20 19:47:02 +00:00
2020-03-14 22:00:16 +00:00
Run stratum:
2019-11-24 23:14:46 +00:00
2019-11-24 23:12:52 +00:00
keva-stratum.exe config.json
2016-12-07 11:56:15 +00:00
2019-11-24 20:02:05 +00:00
## Configuration (config.json)
2015-07-05 09:49:07 +00:00
2016-12-05 19:21:58 +00:00
Configuration is self-describing, just copy *config.example.json* to *config.json* and run stratum with path to config file as 1st argument.
2016-08-07 04:05:02 +00:00
```javascript
{
2016-12-07 12:33:42 +00:00
// Address for block rewards
2020-03-14 22:00:16 +00:00
"address": "YOUR-ADDRESS-NOT-EXCHANGE", // Use 'kevacoin-cli getnewaddress' to get the address
2016-12-07 12:33:42 +00:00
// Don't validate address
"bypassAddressValidation": true,
// Don't validate shares
"bypassShareValidation": true,
"threads": 2,
"estimationWindow": "15m",
"luckWindow": "24h",
"largeLuckWindow": "72h",
// Interval to poll daemon for new jobs
"blockRefreshInterval": "1s",
"stratum": {
// Socket timeout
"timeout": "15m",
"listen": [
{
"host": "0.0.0.0",
"port": 1111,
"diff": 5000,
"maxConn": 32768
},
{
"host": "0.0.0.0",
"port": 3333,
"diff": 10000,
"maxConn": 32768
}
]
},
"frontend": {
"enabled": true,
"listen": "0.0.0.0:8082",
"login": "admin",
"password": "",
"hideIP": false
},
"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "Main",
"host": "127.0.0.1",
"port": 18081,
2019-04-21 01:59:17 +00:00
"timeout": "10s",
2019-11-24 23:20:05 +00:00
"user": "yourusername", //The value should be the same as defined in kevacoin.config
"password": "yourpassword" //The value should be the same as defined in kevacoin.config
2016-08-07 04:05:02 +00:00
}
2016-12-07 12:33:42 +00:00
]
2016-08-07 04:05:02 +00:00
}
```
2015-07-05 09:49:07 +00:00
2019-04-21 02:01:42 +00:00
The `upstream` is used to point to the Kevacoin daemon `kevacoind`. The `user` and `password` under `upstream` are mandatory, and they must be the same as the ones specified in Kevacoin configuration file `kevacoin.conf`. You must use `anything.WorkerID` as username in your miner. Either disable address validation or use `<address>.WorkerID` as username. If there is no workerID specified your rig stats will be merged under `0` worker. If mining software contains dev fee rounds its stats will usually appear under `0` worker. This stratum acts like your own pool, the only exception is that you will get rewarded only after block found, shares only used for stats.
2017-11-08 03:05:18 +00:00
2015-07-05 09:49:07 +00:00
### License
Released under the GNU General Public License v2.
http://www.gnu.org/licenses/gpl-2.0.html