From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A8EFA1584AD for ; Wed, 07 May 2025 12:08:31 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 91FD73431D8 for ; Wed, 07 May 2025 12:08:31 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 05D0A110497; Wed, 07 May 2025 12:08:17 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id EF81911047E for ; Wed, 07 May 2025 12:08:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A5B2434316D for ; Wed, 07 May 2025 12:08:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0B4042859 for ; Wed, 07 May 2025 12:08:14 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1746549708.4e931ab8c9b53431799abb079c79bb0c6282f33f.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: net-p2p/p2pool/files/, net-p2p/p2pool/ X-VCS-Repository: repo/proj/guru X-VCS-Files: net-p2p/p2pool/files/p2pool-4.5-r1.confd net-p2p/p2pool/files/p2pool-4.5-r1.initd net-p2p/p2pool/p2pool-4.5-r1.ebuild X-VCS-Directories: net-p2p/p2pool/files/ net-p2p/p2pool/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: 4e931ab8c9b53431799abb079c79bb0c6282f33f X-VCS-Branch: master Date: Wed, 07 May 2025 12:08:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 71260335-79ff-4e1b-8afa-86523d29397d X-Archives-Hash: f1e51c0d1daba96c6097dbc0f92c96bf commit: 4e931ab8c9b53431799abb079c79bb0c6282f33f Author: Filip Kobierski pm me> AuthorDate: Tue May 6 16:28:04 2025 +0000 Commit: David Roman gmail com> CommitDate: Tue May 6 16:41:48 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4e931ab8 net-p2p/p2pool: add 4.5-r1 with improved openrc service files - conf.d: do not prefix umask - init.d - add name - wait for shutdown one second longer - sort variables (constants, read & generic, read & i2pd specific) - quote variables & use := instead of := - use SSD_{,IO}NICE for setting niceness - adjust whitespace - use `return 1` instead of `false` - simplify keeplog section Signed-off-by: Filip Kobierski pm.me> net-p2p/p2pool/files/p2pool-4.5-r1.confd | 27 ++++++++ net-p2p/p2pool/files/p2pool-4.5-r1.initd | 43 +++++++++++++ net-p2p/p2pool/p2pool-4.5-r1.ebuild | 102 +++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+) diff --git a/net-p2p/p2pool/files/p2pool-4.5-r1.confd b/net-p2p/p2pool/files/p2pool-4.5-r1.confd new file mode 100644 index 000000000..2bb1a51c8 --- /dev/null +++ b/net-p2p/p2pool/files/p2pool-4.5-r1.confd @@ -0,0 +1,27 @@ +# /etc/conf.d/p2pool: config file for /etc/init.d/p2pool + +# Wallet address to recieve the payouts. +# Note that it needs to be the primary address (start with 4) +P2POOL_WALLET="" + +# IP address of your Monero node +#P2POOL_HOST="127.0.0.1" + +#P2POOL_USER="monero" +#P2POOL_GROUP="monero" + +#P2POOL_DATADIR="/var/lib/p2pool" +#P2POOL_LOGLEVEL=1 + +#P2POOL_NICE=5 +#P2POOL_IONICE=2:4 # See START-STOP-DAEMON(8) for details + + +# Uncomment to have a persistent log. +# This is not recommended as it does not rotate. +#P2POOL_KEEPLOG=1 + +# Extra options passed to the daemon +#P2POOL_OPTS="--mini" + +#umask=007 \ No newline at end of file diff --git a/net-p2p/p2pool/files/p2pool-4.5-r1.initd b/net-p2p/p2pool/files/p2pool-4.5-r1.initd new file mode 100644 index 000000000..a881ad471 --- /dev/null +++ b/net-p2p/p2pool/files/p2pool-4.5-r1.initd @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="Decentralized Monero mining pool daemon" +name="P2Pool daemon" +command="/usr/bin/${RC_SVCNAME}" +command_background=1 +command_progress=1 +pidfile="/run/${RC_SVCNAME}.pid" +retry="SIGTERM/31/SIGKILL/5" # shutting down takes 30s + +command_user="${P2POOL_USER:-monero}:${P2POOL_GROUP:-monero}" +umask="${P2POOL_UMASK:=007}" +SSD_IONICELEVEL="${P2POOL_IONICE:=2:4}" +SSD_NICELEVEL="${P2POOL_NICE:=5}" + +P2POOL_HOST="${P2POOL_HOST:=127.0.0.1}" +P2POOL_DATADIR="${P2POOL_DATADIR:=/var/lib/p2pool}" +P2POOL_LOGLEVEL="${P2POOL_LOGLEVEL:=1}" + +command_args="--wallet ${P2POOL_WALLET} \ + --loglevel ${P2POOL_LOGLEVEL} \ + --data-dir ${P2POOL_DATADIR} \ + ${P2POOL_OPTS} \ +" + +depend() { + need net + [ ${P2POOL_HOST} = "127.0.0.1" ] && need monerod +} + +start_pre() { + if [ ! ${P2POOL_WALLET} ]; then + eerror "p2pool cannot be started without a wallet address" + eerror "Please set P2POOL_WALLET in /etc/conf.d/p2pool" + return 1 + fi + einfo "Will mine for wallet ${P2POOL_WALLET}" + checkpath --owner ${command_user} --directory ${P2POOL_DATADIR} + + [ $P2POOL_KEEPLOG ] || rm -f "${P2POOL_DATADIR}"/p2pool.log +} diff --git a/net-p2p/p2pool/p2pool-4.5-r1.ebuild b/net-p2p/p2pool/p2pool-4.5-r1.ebuild new file mode 100644 index 000000000..0003af673 --- /dev/null +++ b/net-p2p/p2pool/p2pool-4.5-r1.ebuild @@ -0,0 +1,102 @@ +# Copyright 2022-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +#TODO: enable/fix GRPC/TLS dependency and add it as USE flag (https://github.com/SChernykh/p2pool/issues/313) +# These features build fine in cmake outside of portage, I can't figure out how to link them here for the life of me. +# It's probably better to just re-write the CMakeLists.txt to dynamicially link with gRPC + +EAPI=8 + +inherit cmake verify-sig + +DESCRIPTION="Decentralized pool for Monero mining" +HOMEPAGE="https://p2pool.io" +SRC_URI=" + https://github.com/SChernykh/p2pool/releases/download/v${PV}/p2pool_source.tar.xz -> ${P}.tar.xz + verify-sig? ( https://github.com/SChernykh/p2pool/releases/download/v${PV}/sha256sums.txt.asc -> ${P}_shasums.asc ) +" + +LICENSE="BSD GPL-3+ ISC LGPL-3+ MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +#IUSE="grpc tls" +IUSE="daemon" + +DEPEND=" + dev-libs/libsodium:= + dev-libs/libuv:= + dev-libs/randomx + net-libs/zeromq:= + net-misc/curl + daemon? ( + acct-group/monero + acct-user/monero + ) +" +RDEPEND="${DEPEND}" +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-schernykh )" + +src_unpack() { + if use verify-sig; then + local VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/SChernykh.asc + pushd "${DISTDIR}" > /dev/null || die + verify-sig_verify_message ${P}_shasums.asc - | \ + tr \\r \\n | \ + tr '[:upper:]' '[:lower:]' | \ + sed -n '/p2pool_source/,$p' | \ + grep -m 1 sha256: | \ + sed "s/sha256: \(.*\)/\1 ${P}.tar.xz/" | \ + verify-sig_verify_unsigned_checksums - sha256 ${P}.tar.xz + assert + popd || die + fi + unpack ${P}.tar.xz + mv -T "${WORKDIR}"/{${PN},${P}} || die +} + +src_configure() { + local mycmakeargs=( + -DSTATIC_BINARY=OFF + -DSTATIC_LIBS=OFF + -DWITH_GRPC=OFF #$(usex grpc) + -DWITH_TLS=OFF #$(usex tls) + ) + cmake_src_configure +} + +src_install(){ + dobin "${BUILD_DIR}/p2pool" + + if use daemon; then + # data-dir + keepdir /var/lib/${PN} + fowners monero:monero /var/lib/${PN} + fperms 0755 /var/lib/${PN} + + # OpenRC + newconfd "${FILESDIR}"/${PN}-4.5-r1.confd ${PN} + newinitd "${FILESDIR}"/${PN}-4.5-r1.initd ${PN} + fi +} + +pkg_postinst() { + #Some important wisdom taken from P2Pool documentation + ewarn "P2Pool for Monero is now installed." + ewarn "You can run it by doing 'p2pool --host 127.0.0.1 --wallet YOUR_PRIMARY_ADDRESS'" + ewarn "Where 127.0.0.1 is the address of a local monero node (e.g. monerod)" + ewarn "" + ewarn "Once configured, point your RandomX miner (e.g. XMRig) at p2pool" + ewarn "For example 'xmrig -o 127.0.0.1:3333'" + ewarn "" + ewarn "You MUST use your primary address when using p2pool, just like solo mining." + ewarn "If you want privacy, create a new mainnet wallet for P2Pool mining." + ewarn "" + ewarn "Rewards will not be visible unless you use a wallet that supports P2Pool." + ewarn "See https://p2pool.io/#help and https://github.com/SChernykh/p2pool for more information." + + if use daemon; then + einfo "p2pool supports just OpenRC daemon right now." + einfo "To launch it set your wallet address in /etc/conf.d/${PN} and run" + einfo " # rc-service p2pool start" + fi +}