Thank you to JT-Grassie!
This is yet another frontend for his Monero mining pool. In the case that you are not mining XMR on P2Pool as you should, perhaps you prefer the flavor of running your own pool. That's why this code exists—to make XMR even more resilient. Before diving into this saga, you may want to look at the pics folder for some motivational spoilers.
This repository contains not only the frontend code but also a comprehensive guide on how to set up a Monero pool on an Ubuntu 24.04 server behind a standard retail router. Please note that this is not a one-click installation; adjustments will be necessary based on your specific environment.
- Utilizes Caddy as the web server and HAProxy for port management.
- Ensures compatibility with the latest versions of Ubuntu, latest monerod, and the latest browsers.
- Adapted from the original code of
supportxmr-gui.
-
Caddy Web Server: Install Caddy.
- Place the Caddyfile under
/etc/caddy/Caddyfile.
- Place the Caddyfile under
-
HAProxy: Install HAProxy using the following command:
sudo apt-get install haproxy
- Place the
haproxy.cfgfile in/etc/haproxy/haproxy.cfg. - Also, place the
cors.luafile in/etc/haproxy/cors.lua.
- Place the
-
Compile Monero from Source: To set up the mining pool, it is essential to compile Monero from source. Please follow the steps below in your user home directory:
-
Clone the Monero Repository:
git clone --recursive https://github.com/monero-project/monero
-
Checkout the Specific Version: Navigate to the Monero directory and checkout the last version of Monero with which I was able to run the pool:
cd monero && git checkout b089f9ee6
-
Initialize and Update Submodules: Ensure that all necessary submodules are initialized and updated:
git submodule init && git submodule update -
Compile Monero: Finally, compile the Monero source code. Adjust the number of jobs based on your CPU cores, but avoid using too many to prevent your system from becoming unresponsive:
make -j4 # Replace '4' with the number of CPU cores you wish to utilize.
-
For additional information and requirements, please refer to the Compiling Monero from Source section.
The frontend code is located in the src_web directory. Copy its contents to /var/www/.
-
Clone the Monero pool repository in your home directory:
git clone https://github.com/jtgrassie/monero-pool.git
-
Move the contents of
src_poolinto~/monero-pool/src/. -
Set the Monero root environment variable:
export MONERO_ROOT=/home/your_username/monero -
Navigate to the
~/monero-pool/directory and compile the pool:make -j4 # Adjust the number based on your CPU cores. Do not use too many cores, or your PC may start being unresponsive. -
Configure the
pool.conffile and copy it to~/monero-pool/build/debug/pool.conf. -
Edit the
rc.localfile to replace "your_username" with your hostname. Place thecaller.shfile in the appropriate home directory. This will ensure thatcaller.shexecutes at startup. -
Adjust the
caller.shfile to set the correctlocal_ipand ports, and update the paths tomonerodandmonero-wallet-rpc.
-
Copy the
50-cloud-init.yamlfile to/etc/netplan/50-cloud-init.yamland adjust it for your network interface,local_ip, and router IP (gateway). -
To enable HTTPS, use Certbot from Let's Encrypt. Once you have the certificates, concatenate them into one file (including the private key) and place it under
/etc/ssl/certs/cert.pem. Notice how thehaproxy.cfgfile has the lines:
Line 39: for the HTTPS:
bind :443 ssl crt /etc/ssl/certs/cert.pem
Line 55: for the SSL mining port:
bind :4343 ssl crt /etc/ssl/certs/cert.pem
-
Renewing the Certificate: To renew your certificate using Certbot, follow these steps:
sudo service caddy stop sudo service haproxy stop sudo certbot renew
As root, concatenate the full chain and private key into a single file:
cat /etc/letsencrypt/live/your_domain/fullchain.pem /etc/letsencrypt/live/your_domain/privkey.pem | sudo tee /etc/ssl/certs/cert.pem > /dev/null
-
Restart Services: After renewing the certificate, restart the services:
sudo service caddy start sudo service haproxy start
Purchasing a domain is your responsibility. Using a static IPv4 address simplifies the process. Direct the A-RECORD from your domain to your static IP. In this setup, it was done for both soontm.xyz and pool.xmr.soontm.xyz.
In the src_web/ directory, modify the script_min.js file at line 1496 to replace yourdomain.xyz with your actual domain:
document.cookie = 'wa=' + (v || '') + '; expires=' + d.toUTCString() + '; path=/' + '; Domain=yourdomain.xyz' + '; SameSite=Strict';- Forward the necessary ports on your router.
- Secure your server with SSH and enforce strict key-only logins.
- Disable root login and X11 forwarding in the
/etc/ssh/sshd_configfile.
This pool only supports mining using the self-select option from XMRig.
long live monero
pow or die
Please do contact me for critics, suggestions, questions, kudos, and even mobbing attempts are welcome.
@ irc monero-pt
A do nation is the best nation !
MONERO:
Or help me find my first block at soontm.xyz.
