This a step by step guide on how to setup your own crypto-currency mining pool. This guide is going over how to setup an Monero mining pool . This is meant to setup a mining pool for a SINGLE CRYPTO CURRENCY. This is not a guide for a Multipool!!!!
If you want to see what it looks like before you set it all up, head to the Monero Mining Pool.
For this guide purpose I will be using Monero Crypto Currency .
- 4 Gb Ram
- 2 CPU Cores (with AES_NI)
- 60 Gb SSD-Backed Storage – If you’re doing a multi-server install, the leaf nodes do not need this much storage. They just need enough storage to hold the blockchain for your node. The pool comes configured to use up to 24Gb of storage for LMDB. Assuming you have the longRunner worker running, it should never get near this size, but be aware that it /can/ bloat readily if things error, so be ready for this!
- Notably, this happens to be approximately the size of a 4Gb linode instance, which is where the majority of automated deployment testing happened!
- Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
- WinSCP (http://winscp.net/eng/download.php)
- If you’re planning on using e-mail, you’ll want to setup an account at https://mailgun.com (It’s free for 10k e-mails/month!), so you can notify miners. This also serves as the backend for password reset emails, along with other sorts of e-mails from the pool, including pool startup, pool Monerod daemon lags, etc so it’s highly suggested!
- Pre-Generate the wallets, or don’t, it’s up to you! You’ll need the addresses after the install is complete, so I’d suggest making sure you have them available. Information on suggested setups are found below.
- If you’re going to be offering PPS, PLEASE make sure you load the pool wallet with XMR before you get too far along. Your pool will trigger PPS payments on its own, and fairly readily, so you need some float in there!
- Make a non-root user, and run the installer from there!
Deployment via Installer
- Add your user to
/etc/sudoers, this must be done so the script can sudo up and do it’s job. We suggest passwordless sudo. Suggested line:
<USER> ALL=(ALL) NOPASSWD:ALL. Our sample builds use:
pooldaemon ALL=(ALL) NOPASSWD:ALL
- Run the deploy script as a NON-ROOT USER. This is very important! This script will install the pool to whatever user it’s running under! Also. Go get a coffee, this sucker bootstraps the monero installation.
curl -L https://raw.githubusercontent.com/Snipa22/nodejs-pool/master/deployment/deploy.bash | bash
Once it’s complete, change as
config.json appropriate. It is pre-loaded for a local install of everything, running on 127.0.0.1. This will work perfectly fine if you’re using a single node setup. You’ll also want to set
bind_ip to the external IP of the pool server, and
hostname to the resolvable hostname for the pool server.
pool_id is mostly used for multi-server installations to provide unique identifiers in the backend. You will also want to run: source ~/.bashrc This will activate NVM and get things working for the following pm2 steps.
- You’ll need to change the API endpoint for the frontend code in the
poolui/build/globals.default.js— This will usually be
http(s)://<your server FQDN>/apiunless you tweak caddy!
- The default database directory
/home/<username>/pool_db/is already been created during startup. If you change the
db_storage_pathjust make sure your user has write permissions for new path. Run:
pm2 restart apito reload the API for usage.
- Hop into the web interface (Should be at
http://<your server IP>/admin.html), then login with
Administrator/Password123, MAKE SURE TO CHANGE THIS PASSWORD ONCE YOU LOGIN. <- This step is currently not active, we’re waiting for the frontend to catch up! Head down to the Manual SQL Configuration to take a look at what needs to be done by hand for now.
- From the admin panel, you can configure all of your pool’s settings for addresses, payment thresholds, etc.
- Once you’re happy with the settings, go ahead and start all the pool daemons, commands follow.
pm2 start init.js –name=blockManager –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=blockManager
pm2 start init.js –name=worker –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=worker
pm2 start init.js –name=payments –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=payments
pm2 start init.js –name=remoteShare –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=remoteShare
pm2 start init.js –name=longRunner –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=longRunner
pm2 start init.js –name=pool –log-date-format=“YYYY-MM-DD HH:mm Z“ — –module=pool
pm2 restart api
Assumptions for the installer
The installer assumes that you will be running a single-node instance and using a clean Ubuntu 16.04 server install. The following system defaults are set:
- MySQL Username: pool
- MySQL Password: 98erhfiuehw987fh23d
- MySQL Host: 127.0.0.1
- MySQL root access is only permitted as the root user, the password is in
- SSL Certificate is generated, self-signed, but is valid for Claymore Miners.
- The server installs and deploys Caddy as it’s choice of web server!
The following raw binaries MUST BE AVAILABLE FOR IT TO BOOTSTRAP:
I’ve confirmed that the default server 16.04 installation has these requirements.
The pool comes pre-configured with values for Monero (XMR), these may need to be changed depending on the exact requirements of your coin. Other coins will likely be added down the road, and most likely will have configuration.sqls provided to overwrite the base configurations for their needs, but can be configured within the frontend as well.
The pool ALSO applies a series of patches: Fluffy Blocks, Additional Open P2P Connections, 128 Txn Bug Fix. If you don’t like these, replace the auto-installed monerod fixes!
The pool is designed to have a dual-wallet design, one which is a fee wallet, one which is the live pool wallet. The fee wallet is the default target for all fees owed to the pool owner. PM2 can also manage your wallet daemon, and that is the suggested run state.
- Generate your wallets using
- Make sure to save your regeneration stuff!
- For the pool wallet, store the password in a file, the suggestion is
- Change the mode of the file with chmod to 0400:
chmod 0400 ~/wallet_pass
- Start the wallet using PM2:
--rpc-bind-port 18082 --password-file ~/wallet_pass --wallet-file
<Your wallet name here> --disable-rpc-login --trusted-daemon
- If you don’t use PM2, then throw the wallet into a screen and have fun.
Pretty similar to the above, you may wish to dig through a few other things for sanity sake, but the installer scripts should give you a good idea of what to expect from the ground up.
Manual SQL Configuration
Until the full frontend is released, the following SQL information needs to be updated by hand in order to bring your pool online, in module/item format. You can also edit the values in sample_config.sql, then import them into SQL directly via an update.
Critical/Must be done:
Nice to have:
SQL import command: sudo mysql pool < ~/nodejs-pool/sample_config.sql (Adjust name/path as needed!)
The shareHost configuration is designed to be pointed at wherever the leafApi endpoint exists. For xmrpool.net, we use https://api.xmrpool.net/leafApi. If you’re using the automated setup script, you can use:
http://<your IP>/leafApi, as Caddy will proxy it. If you’re just using localhost and a local pool serv, http://127.0.0.1:8000/leafApi will do you quite nicely
Additional ports can be added as desired, samples can be found at the end of base.sql. If you’re not comfortable with the MySQL command line, I highly suggest MySQL Workbench or a similar piece of software (I use datagrip!). Your root MySQL password can be found in
Final Manual Steps
Until the main frontend is done, we suggest running the following SQL line:
DELETE FROM pool.users WHERE username = 'Administrator';
This will remove the administrator user until there’s an easier way to change the password. Alternatively, you can change the password to something not known by the public:
UPDATE pool.users SET email='your new password here' WHERE username='Administrator';
The email field is used as the default password field until the password is changed, at which point, it’s hashed and dumped into the password field instead, and using the email field as a password is disabled.
You should take a look at the wiki for specific configuration settings in the system.
BTC :- 18xRnsa828YALPgbvjRXQuQ63QqikPbKxq
LTC :- MD7kAo4hhgJnpmsqeVqzvrnhKguq6Vg2hx
ETH :- 0xe8d07BcC280C564983670dd7e8512e3A5db30593