Run and mine on a p2pool Node | sethforprivacy.com


This guide will aim to make it very simple and straightforward for you to start and run your own Monero node and p2pool instance for decentralized and fee-less mining of Monero



Onion Details



Page Clicks: 0

First Seen: 03/12/2024

Last Indexed: 10/23/2024

Domain Index Total: 84



Onion Content



Table of Contents Pre-requisites Recommended hardware Why run your own Monero node? Why run and mine on p2pool instead of a “normal” Monero pool? Update and install required packages Initial hardening via UFW Download and run monerod and p2pool via Docker If you already run a Monero node Connect your miners to p2pool Viewing your mining stats Payouts Checking payouts Handling payouts Sweeping all payouts with Feather Wallet Resolving issues Alternative ways to run p2pool Disclaimer Conclusion Info While this guide is still useful for those who want to mine on multiple machines or “Uncle Jim” p2pool mining for others, if you just have a single machine to mine on I’d recommend using Gupax instead. Gupax is a FANTASTIC all-in-one Monero mining app for desktop that simplifies the entire process. NOTE: Much of the beginning of this guide is taken from my related guide, “Run a Monero Node” , but is necessary here as running your own node is usually required for p2pool usage. This guide will aim to make it very simple and straightforward for you to start and run your own Monero node and p2pool instance for decentralized and fee-less mining of Monero. p2pool is a huge breakthrough that allows individual miners full control over the mining process, removing trust in pools and pool operators and allowing anyone to mine in a decentralized fashion while keeping payout variance down as opposed to solo mining. Note that once you have this up and running on a VPS or personal hardware, you will want to mine against your p2pool node as the “pool” in your mining configuration. For more on mining Monero generally, including setting up XMRig, see my other guide, “Mining Monero” . For more information on why you would want to use p2pool instead of a normal pool for mining, please see: Why run and mine on p2pool instead of a “normal” Monero pool? NOTE: If you’re attempting to run p2pool on Windows, see the following two guides/videos on how to do that. This guide focuses on Linux usage. Mining Monero with P2Pool - Windows; Quick start guide Windows installer for p2pool Pre-requisites # I will assume in this guide that you have purchased and SSH’d into the VPS/host of your choosing, but if you need help with those first steps here are a few good links to follow: Hosting services accepting Monero These are some options available for hosting a VPS while paying with Monero, and each come with pro’s and con’s. Joe’s Datacenter A solid and cheap VPS and dedicated server provider based out of the US, they accept Bitcoin but do not accept Monero (yet!) and are a great choice for a high-performance node. Simple Linode deployment guide If you use Linode, please consider using my referral link so we both get free credits. If you’re using your own hardware at home, this guide will still generally apply to you assuming you are running Ubuntu/Debian. Recommended hardware # Pruned Node 1 2+ vCPUs/cores 4GB+ RAM 75GB+ SSD Why run your own Monero node? # The Monero network relies on a distributed web of Monero nodes, each of which validate transactions, propagate transactions to the rest of the network, and helps new nodes easily and quickly synchronize to the current state of the network. Running a Monero node for yourself not only helps to give you the stronger network-level privacy guarantees, but also helps to increase the decentralization, stability, and speed of the Monero network. Each node can expose two different services, each of which has a positive impact on the network in a unique way: Peer-to-Peer (p2p) port (default 18080): this port allows other nodes on the network to connect to your node to download the blockchain and to send you any transactions they validate that you do not yet have. It also increases overall network privacy, as your node participates in the Dandelion++ propagation of transactions. Remote Procedure Call (RPC) port (default 18089 for restricted): Exposing this port (especially with the public-node arg) allows other users on the network, especially those using mobile wallets or the GUI wallet in “Simple” mode, to connect to your node to sync their wallets, without needing to run their own full node locally. You can choose to either setup a node via systemd and binaries or deploy monerod as a Docker container below. Deploying via Docker has a few key benefits, namely a simple and cross-OS compatible install along with automatic updates via Watchtower . Why run and mine on p2pool instead of a “normal” Monero pool? # Mining on Monero has always been one of the most decentralized PoW networks in the cryptocurrency space, but an issue that has plagued Monero (and all other PoW cryptocurrencies) is that even if miners themselves are numerous and diverse geographically, pools used by those miners are generally very few, geographically similar, and entirely centralized. The pool operator of a normal mining pool controls the block template produced by all of the miners pointing to it, allowing them to leverage the hashrate for nefarious purposes if they so choose. Normal pools are also custodians of funds as all mined funds are sent first to the pool, and then the pool (hopefully) pays out from those funds to miners according to their work. Pools and their operators are one of the most vulnerable aspects of Monero mining, but thankfully the Monero community (particularly sech1 [also known as SChernykh ]) have built out a p2pool implementation, from scratch, with many improvements over past attempts at p2pool on Bitcoin and other blockchains. Running p2pool allows you to participate in a second blockchain that is used to decentralize the normal pool functionality, while contributing work as a whole to the main Monero network. For more details on p2pool and why you should use it, see this knowledge article from LocalMonero: P2Pool and Its Role in Decentralizing Monero Mining Update and install required packages # Install a few tools we will need later: 1 2 sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install -y ufw curl Install Docker: 1 2 3 4 curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo usermod -aG docker $USER su - $USER Install Docker Compose: 1 2 sudo apt-get update sudo apt-get install docker-compose-plugin Note: This command downloads a script and runs as root directly from Docker. Please make sure you are comfortable doing this, and be wary of doing this on a personal computer. If you’d like to avoid that, please follow the official docs here to install from the repository. Initial hardening via UFW # We will want to make sure that the system is hardened in a simple way by making sure that the firewall is locked down to only allow access to the ports necessary for SSH and monerod , using UFW. A great intro to getting started with UFW is available on DigitalOcean . Run the following commands to add some basic UFW rules and enable the firewall: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # Deny all non-explicitly allowed ports sudo ufw default deny incoming sudo ufw default allow outgoing # Allow SSH access sudo ufw allow ssh # Allow monerod p2p port sudo ufw allow 18080/tcp # Allow monerod restricted RPC port sudo ufw allow 18089/tcp # Allow p2pool p2p port sudo ufw allow 37889/tcp # Allow p2pool stratum port sudo ufw allow 3333/tcp # Enable UFW sudo ufw enable Download and run monerod and p2pool via Docker # This section will use a simple Docker Compose configuration file that tells Docker exactly how each part needs to be configured and connected together. This allows us to simplify down the launch of monerod and p2pool down to a few simple commands. If you would like to inspect the source code behind the image used here or build it yourself, please see the below links: monerod Source Repository p2pool Source Repository Copy and paste the below configuration file wherever you would like on the host, for this guide I will use ~/p2pool : 1 2 mkdir ~/p2pool nano ~/p2pool/docker-compose.yml To escape from the nano shell and save the file, hit ctrl+x . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 version : '3.5' services : monerod : image : ghcr.io/sethforprivacy/simple-monerod:latest restart : unless-stopped container_name : monerod volumes : bitmonero:/home/monero ports : 18080 : 18080 - 18084 : 18084 - 18089 : 18089 command : >- --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --public-node --no-igd --enable-dns-blocklist --prune-blockchain --zmq-pub=tcp://0.0.0.0:18084 --in-peers=50 --out-peers=50 p2pool : image : ghcr.io/sethforprivacy/p2pool:latest restart : unless-stopped container_name : p2pool tty : true stdin_open : true volumes : p2pool-data:/home/p2pool - /dev/hugepages:/dev/hugepages:rw ports : 3333 : 3333 - 37889 : 37889 command : >- --wallet "468ydghFfthE3UTc53eF5MP9UyrMcUiAHP5kizVYJsej5XGaXBoAAEzUHCcUF7t3E3RrYAX8Rs1ujhBdcvMpZSbH8qkb55R" --stratum "0.0.0.0:3333" --p2p "0.0.0.0:37889" --zmq-port "18084" --loglevel "0" --addpeers "65.21.227.114:37889,node.sethforprivacy.com:37889" --host "monerod" --rpc-port "18089" tor : image : goldy/tor-hidden-service:latest container_name : tor restart : unless-stopped links : monerod - p2pool environment : MONEROD_TOR_SERVICE_HOSTS : 18089 : monerod:18089 MONEROD_TOR_SERVICE_VERSION : '3' P2POOL_TOR_SERVICE_HOSTS : 3333 : p2pool:3333 P2POOL_TOR_SERVICE_VERSION : '3' volumes : tor-keys:/var/lib/tor/hidden_service/ watchtower : image : containrrr/watchtower:latest container_name : watchtower restart : unless-stopped volumes : "/var/run/docker.sock:/var/run/docker.sock" volumes : bitmonero : tor-keys : p2pool-data : NOTE: Be sure to replace the Monero address (468y…b55R) with your own primary address (an address starting with 4), or else you’ll be making generous hashrate donations to me! If you’d like to use the smaller side-chain (which will allow faster shares but less commonly found blocks, rewards over time will be roughly equal!), you can simple add --mini in the command: section of the p2pool service like so: 1 2 3 4 5 command : >- --wallet "468ydghFfthE3UTc53eF5MP9UyrMcUiAHP5kizVYJsej5XGaXBoAAEzUHCcUF7t3E3RrYAX8Rs1ujhBdcvMpZSbH8qkb55R" --stratum "0.0.0.0:3333" --loglevel "0" --p2p "0.0.0.0:37888" --host "monerod" --rpc-port "18089" --mini Explanations of the containers used in the above docker-compose.yml file: monerod : The Monero daemon is the process that connects to the Monero blockchain, synchronizes with other nodes on the network, and validates and keeps track of transactions happening in the Monero blockchain. p2pool : The p2pool daemon connects to monerod for Monero’s blockchain data needed for mining, and connects to the p2pool blockchain for synchronization and publishing work you accomplish via mining. tor : This is a container that publishes your monerod and p2pool d...