High performance Node.js (with native C addons) mining pool for CryptoNote based coins such as Electroneum, Monero, Bytecoin, QuazarCoin, HoneyPenny, etc.. Comes with lightweight example front-end script which uses the pool's AJAX API.
sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libunbound-dev
nvm install 0.10.48
. Once finished, type nvm use 0.10.48
.sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install screen
screen -S daemond
<--- Use to run the daemondscreen -S rpc
<---- Use to run rpcscreen -S website
< --- use to run websitescreen -list
<---- List screensscreen -x website
<--- reconnect to screen websiteCTRL + a
then CTRL + d
<----- detatch from a screen Those are legitimate requirements. If you use a different version of Node.js or Redis that may come with your system package manager then you will have problems. Follow the linked instructions to get the last stable versions.
Redis security warning: be sure firewall access to redis - an easy way is to
include bind 127.0.0.1
in your redis.conf
file. Also it's a good idea to learn about and understand software that
you are using - a good place to start with redis is data persistence.
Clone the repository and run npm update
for all the dependencies to be installed:
git clone https://github.com/electroneum/electroneum-pool.git pool
cd pool
npm update
Firstly, You'll need to download & compile the daemon source code found here
Secondly, Start a screen session, e.g screen -S daemon
. Then run ./electroneumd
wherever the compiled binaries are. This will download the blockchain. You'll need to wait until you're fully synced before continuing.
Thirdly, Once synced you'll need to create a wallet. Detatch from the screen session using CTRL + A, CTRL + D
(This works for me on putty). Open up another screen session, e.g screen -S wallet
. Then run ./electroneum-wallet-cli
wherever the compiled binaries are, This will take your through creating a wallet. Once generated, type exit
to close the wallet.
Lastly you need to start the wallet RPC server which makes the payments to your miners. This can be started using ./electroneum-wallet-rpc --wallet-file walletfilename --password walletfilepassword --rpc-bind-port 26969 --disable-rpc-login
walletfilename
& walletfilepassword
are what you supplied when generating the wallet. You can change the port, just remember to change it in the config.json file.
[Security Warning]We strongly recommend that you transfer funds out of this wallet regularly. This way, if your server is comprimised you won't lose all your profits. Bear in mind you'll need to leave enough to pay any outstanding payments to miners.
Warning for Cryptonote coins other than Electroneum: this software may or may not work with any given cryptonote coin. Be wary of altcoins that change the number of minimum coin units because you will have to reconfigure several config values to account for those changes. Unless you're offering a bounty reward - do not open an issue asking for help getting a coin other than electroneum working with this software.
Copy the config_example.json
file to config.json
then overview each options and change any to match your preferred setup.
Explanation for each field:
{
"coin": "electroneum",
"symbol": "ETN",
"logging": {
"files": {
"level": "info",
"directory": "logs",
"flushInterval": 5
},
"console": {
"level": "info",
"colors": true
}
},
"poolServer": {
"enabled": true,
"clusterForks": "auto",
"poolAddress": "WALLETADDRESSHERE",
"blockRefreshInterval": 1000,
"minerTimeout": 900,
"ports": [
{
"port": 3333,
"difficulty": 100,
"desc": "Low end hardware"
},
{
"port": 5555,
"difficulty": 2000,
"desc": "Mid range hardware"
},
{
"port": 7777,
"difficulty": 10000,
"desc": "High end hardware"
}
],
"varDiff": {
"minDiff": 2,
"maxDiff": 100000,
"targetTime": 100,
"retargetTime": 30,
"variancePercent": 30,
"maxJump": 100
},
"shareTrust": {
"enabled": true,
"min": 10,
"stepDown": 3,
"threshold": 10,
"penalty": 30
},
"banning": {
"enabled": true,
"time": 600,
"invalidPercent": 25,
"checkThreshold": 30
},
"slushMining": {
"enabled": false,
"weight": 300,
"lastBlockCheckRate": 1
}
},
"payments": {
"enabled": true,
"interval": 600,
"maxAddresses": 10,
"mixin": 0,
"transferFee": 1,
"minPayment": 10000,
"denomination": 100
},
"blockUnlocker": {
"enabled": true,
"interval": 30,
"depth": 20,
"poolFee": 1.8,
"devDonation": 0.1,
"coreDevDonation": 0.1
},
"api": {
"enabled": true,
"hashrateWindow": 600,
"updateInterval": 3,
"port": 8117,
"blocks": 30,
"payments": 30,
"password": "test"
},
"daemon": {
"host": "127.0.0.1",
"port": 26968
},
"wallet": {
"host": "127.0.0.1",
"port": 26969
},
"redis": {
"host": "127.0.0.1",
"port": 6379,
"auth": null
}
}
Your miners that are Windows users can use cryptonote-easy-miner
which will automatically generate their wallet address and stratup multiple threads of simpleminer. You can download
it and edit the config.ini
file to point to your own pool.
Inside the easyminer
folder, edit config.init
to point to your pool details
pool_host=example.com
pool_port=5555
Rezip and upload to your server or a file host. Then change the easyminerDownload
link in your config.json
file to
point to your zip file.
node init.js
The file config.json
is used by default but a file can be specified using the -config=file
command argument, for example:
node init.js -config=config_backup.json
This software contains four distinct modules:
pool
- Which opens ports for miners to connect and processes sharesapi
- Used by the website to display network, pool and miners' dataunlocker
- Processes block candidates and increases miners' balances when blocks are unlockedpayments
- Sends out payments to miners according to their balances stored in redisBy default, running the init.js
script will start up all four modules. You can optionally have the script start
only start a specific module by using the -module=name
command argument, for example:
node init.js -module=api
Example screenshot of running the pool in single module mode with tmux.
Simply host the contents of the website_example
directory on file server capable of serving simple static files.
Edit the variables in the website_example/config.js
file to use your pool's specific configuration.
Variable explanations:
/* Must point to the API setup in your config.json file. */
var api = "http://poolhost:8117";
/* Minimum units in a single coin, for Electroneum its 100. */
var coinUnits = 100;
/* Pool server host to instruct your miners to point to. */
var poolHost = "poolhost.com";
/* IRC Server and room used for embedded KiwiIRC chat. */
var irc = "irc.freenode.net/#electroneum";
/* Contact email address. */
var email = "support@poolhost.com";
/* Market stat display params from https://www.cryptonator.com/widget - Not used for Electroneum pool */
var cryptonatorWidget = ["XMR-BTC", "XMR-USD", "XMR-EUR", "XMR-GBP"];
/* Download link to cryptonote-easy-miner for Windows users. */
var easyminerDownload = "https://github.com/zone117x/cryptonote-easy-miner/releases/";
/* Used for front-end block links. */
var blockchainExplorer = "https://blockexplorer.electroneum.com/block/";
/* Used by front-end transaction links. */
var transactionExplorer = "https://blockexplorer.electroneum.com/tx";
The following files are included so that you can customize your pool website without having to make significant changes
to index.html
or other front-end files thus reducing the difficulty of merging updates with your own changes:
custom.css
for creating your own pool stylecustom.js
for changing the functionality of your pool websiteThen simply serve the files via nginx, Apache, Google Drive, or anything that can host static content.
You can configure the API to be accessible via SSL using various methods. Find an example for nginx below:
location /json_rpc {
proxy_pass http://127.0.0.1:26968/json_rpc;
}
location ~ ^/api/(.*) {
proxy_pass http://127.0.0.1:8117/$1$is_args$args;
}
By adding this you will need to make your api
variable in the website_example/config.js
include the /api. For example:
var api = "http://poolhost/api";
You no longer need to include the port in the variable because of the proxy connection.
When updating to the latest code its important to not only git pull
the latest from this repo, but to also update
the Node.js modules, and any config files that may have been changed.
git pull
to get the latest code.node_modules
directory with rm -r node_modules
.npm update
to force updating/reinstalling of the dependencies.config.json
to the latest example ones in this repo or the ones in the setup instructions where each config field is explained. You may need to modify or add any new changes.etnkCFXeExRaBhbDNq66TQ3rF9XSkMreei8t1jXfT2ndgY6bnsNEUtEKbEhba3YHk2CuPCpxZFrGNcAJ9Lv22ACY7eapPgQtNb
48rB9X6ygZQ4uNBSKJP3MKU9iFK87e8vejEi762eNdTPB61A9VayUnL75HHi2SER3gf5i9PXpiS2kiCwDyanvNm5S5Aq3WF
Released under the GNU General Public License v2