]> Liquid.me.uk: Repositories - local/commitdiff
new file: net-misc/xmrig/files/xmrig.initd
authorRalphred <ralphred@liquid.me.uk>
Tue, 18 Feb 2025 21:47:04 +0000 (21:47 +0000)
committerRalphred <ralphred@liquid.me.uk>
Tue, 18 Feb 2025 21:47:04 +0000 (21:47 +0000)
new file:   net-misc/xmrig/files/xmrigd.1.initd
new file:   net-misc/xmrig/files/xmrigd.confd
new file:   net-misc/xmrig/xmrig-6.21.1.ebuild
modified:   net-p2p/monero/files/monerod.conf
modified:   net-p2p/monero/files/monerod.confd
modified:   net-p2p/monero/files/monerod.initd
new file:   net-p2p/p2pool/files/p2pool.confd
new file:   net-p2p/p2pool/files/p2pool.initd
new file:   net-p2p/p2pool/p2pool-4.3.ebuild

30 files changed:
net-misc/xmrig/Manifest [new file with mode: 0644]
net-misc/xmrig/files/xmrig-6.12.2-nonotls.patch [new file with mode: 0644]
net-misc/xmrig/files/xmrig.initd [new file with mode: 0755]
net-misc/xmrig/files/xmrig.service [new file with mode: 0644]
net-misc/xmrig/files/xmrigd.1.initd [new file with mode: 0755]
net-misc/xmrig/files/xmrigd.confd [new file with mode: 0644]
net-misc/xmrig/xmrig-6.21.1.ebuild [new file with mode: 0644]
net-p2p/monero/Manifest
net-p2p/monero/files/monero-0.17.1.7-linkjobs.patch [deleted file]
net-p2p/monero/files/monero-0.17.2.0-boost-176.patch [deleted file]
net-p2p/monero/files/monero-0.17.3.2-unbundle-dependencies.patch [moved from net-p2p/monero/files/monero-0.17.3.0-unbundle-dependencies.patch with 100% similarity]
net-p2p/monero/files/monero-0.18.3.3-miniupnp-api-18.patch [new file with mode: 0644]
net-p2p/monero/files/monero-0.18.3.3-unbundle-dependencies.patch [moved from net-p2p/monero/files/monero-0.17.1.7-unbundle-dependencies.patch with 75% similarity]
net-p2p/monero/files/monero-0.18.3.4-boost-1.85.patch [new file with mode: 0644]
net-p2p/monero/files/monerod.conf
net-p2p/monero/files/monerod.confd
net-p2p/monero/files/monerod.initd
net-p2p/monero/metadata.xml
net-p2p/monero/monero-0.17.2.0.ebuild [deleted file]
net-p2p/monero/monero-0.17.2.3.ebuild [deleted file]
net-p2p/monero/monero-0.17.3.0.ebuild [deleted file]
net-p2p/monero/monero-0.18.3.4-r1.ebuild [moved from net-p2p/monero/monero-0.17.3.2.ebuild with 83% similarity]
net-p2p/monero/monero-9999.ebuild [deleted file]
net-p2p/p2pool/Manifest [new file with mode: 0644]
net-p2p/p2pool/files/SChernykh.asc [new file with mode: 0644]
net-p2p/p2pool/files/flags.cmake [new file with mode: 0644]
net-p2p/p2pool/files/p2pool.confd [new file with mode: 0644]
net-p2p/p2pool/files/p2pool.initd [new file with mode: 0755]
net-p2p/p2pool/metadata.xml [new file with mode: 0644]
net-p2p/p2pool/p2pool-4.3.ebuild [new file with mode: 0644]

diff --git a/net-misc/xmrig/Manifest b/net-misc/xmrig/Manifest
new file mode 100644 (file)
index 0000000..3f01e33
--- /dev/null
@@ -0,0 +1,5 @@
+DIST xmrig-6.21.1.tar.gz 2416545 BLAKE2B 72ecdfc8c999aee91aef4f540211c5d5a6f1992c76211162a623e89391cedfcc2d5540f291d9915ee4180b83f58ef7f2eb1e3aff8dee49c72f41f90878d7ef62 SHA512 a9267708e61084db7116381adb2256a04c30eba0c84b571764cc73ccafc9276f55b6665529eb7b9c1785d582d0d280ced6ee7ca88a5e98f9bbdef2a9176a9794
+DIST xmrig-6.21.3.tar.gz 2426720 BLAKE2B 11563169e51402313399109860e04dd13dfc9911504db571968d6a97112990ebb68a3019da836a4ac19a589c94ab4b5f2ebcbadce59452c278ea923e8abf475a SHA512 91e92f61e385b75715b0b00fcb772bf997f3db19ef47f43c4bda3662aec6276273551ac915a7a6eeef253deb8da5b0ec0b45e02f0b84211ab8f0f5a37f34c87e
+DIST xmrig-6.22.0.tar.gz 2428500 BLAKE2B 3f675f909a5875c85a22eed8a89022d4895a1a6e7ec258ec87c624c5150487376b065bef4f50c0bafb062e07003ad3910c34634ec2266c458d7284014181daf3 SHA512 12eac61ea8b33a2932a0fdbd7a4ccbbf4f046578ecfd67adad4e7729f9de740060d11025d7ab6f17d7e19586ee59f041e761e3bb42c6fd766ea7029c15d97b42
+DIST xmrig-6.22.1.tar.gz 2434991 BLAKE2B 69ca78c3f0c8adefb8b33a58e4e55739810fd3ce61ea636d8e1d29fe92f786eafa6368b77f3e5d9123964dc72be78b2df2a468ea9c56a649faf66a16c05c8b77 SHA512 4ebeaea8d4439f0f682a46c25a86ebc0e6129eb6a89d1c8036c05973e61b385c62200dc7ed702f4f6f52d2ad546953d0d941447ba1e3db54fec1adaecba20ea6
+DIST xmrig-6.22.2.tar.gz 2435360 BLAKE2B c9b81ee93a008639709751b3924461d29216f8daa4beb3db96d983812efa5083926624aaea14d20692c3a3740a1ca178383b8b7cce0c1ad78a16f0299f891561 SHA512 4e25364737456711b09d5ed68e0d26b74cc2f4f4408ff5d02e0063bf67d6f38db5fe9af5d099dc4fd4b3f668baf2023cb816c049d38588ba1b54a8a2c0393269
diff --git a/net-misc/xmrig/files/xmrig-6.12.2-nonotls.patch b/net-misc/xmrig/files/xmrig-6.12.2-nonotls.patch
new file mode 100644 (file)
index 0000000..f58c7e2
--- /dev/null
@@ -0,0 +1,23 @@
+From ee98bfe01a94d021d81ed4c2bb11ec91c0bd81c8 Mon Sep 17 00:00:00 2001
+From: Matt Smith <matt@offtopica.uk>
+Date: Sun, 7 Jun 2020 13:20:04 +0100
+Subject: [PATCH] Don't suffix binary with -notls
+
+---
+ cmake/OpenSSL.cmake | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/cmake/OpenSSL.cmake b/cmake/OpenSSL.cmake
+index 89805301..c01c940a 100644
+--- a/cmake/OpenSSL.cmake
++++ b/cmake/OpenSSL.cmake
+@@ -54,6 +54,4 @@ else()
+             src/base/net/http/HttpServer.h
+             )
+     endif()
+-
+-    set(CMAKE_PROJECT_NAME "${CMAKE_PROJECT_NAME}-notls")
+ endif()
+-- 
+2.27.0
+
diff --git a/net-misc/xmrig/files/xmrig.initd b/net-misc/xmrig/files/xmrig.initd
new file mode 100755 (executable)
index 0000000..6ce04de
--- /dev/null
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+
+depend() {
+       need net
+       need xmrigdaemon
+}
+
+start() {
+       ebegin "Starting XMRig Virtual Service"
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping XMRig Virtual Service"
+       einfo "Looking for any XMRig daemons to stop"
+    for file in /etc/init.d/xmrigd.*;do rc-service $basename ${file} --nodeps stop 2>/dev/null;done
+    eend $?
+}
+
+start_pre() {
+       [[ -e /etc/init.d/${RC_SVCNAME}d.$(nproc) ]] && exit
+       ewarn "${RC_SVCNAME}d.$(nproc) does not exist"
+       einfo "Preparing xmrigd service files"
+       for x in $(seq 2 $(nproc));do
+               ln -s /etc/init.d/xmrigd.1 /etc/init.d/xmrigd.${x}
+       done
+       eend $?
+}
diff --git a/net-misc/xmrig/files/xmrig.service b/net-misc/xmrig/files/xmrig.service
new file mode 100644 (file)
index 0000000..5b5c4c3
--- /dev/null
@@ -0,0 +1,35 @@
+[Unit]
+Description=XMRig Monero Miner
+After=network-online.target
+AssertFileNotEmpty=/etc/xmrig/config.json
+
+[Service]
+ExecStartPre=+/usr/bin/randomx_boost.sh
+ExecStartPre=+/usr/bin/enable_1gb_pages.sh
+ExecStartPre=/usr/bin/xmrig --config=/etc/xmrig/config.json --dry-run
+ExecStart=/usr/bin/xmrig --config=/etc/xmrig/config.json
+StandardOutput=journal
+StandardError=journal
+DynamicUser=true
+Nice=19
+CPUSchedulingPolicy=idle
+PrivateTmp=true
+ProtectHome=true
+ProtectSystem=strict
+NoNewPrivileges=true
+# PrivateDevices=true # https://github.com/systemd/systemd/issues/13857
+CapabilityBoundingSet=
+#ProtectClock=true # https://github.com/systemd/systemd/issues/20835
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
+RestrictNamespaces=true
+PrivateUsers=true
+ConfigurationDirectory=xmrig
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/net-misc/xmrig/files/xmrigd.1.initd b/net-misc/xmrig/files/xmrigd.1.initd
new file mode 100755 (executable)
index 0000000..54fe4c1
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+name="${RC_SVCNAME/xmr/XMR} Cypto Miner Daemon"
+description="Mines crypto curreny"
+pidfile="/var/run/xmrig.pid"
+command=/usr/bin/xmrig
+command_args="${XMRIG_ARGS} ${RC_SVCNAME/xmrigd./--threads=}"
+supervisor=supervise-daemon
+command_user="${XMRIG_USR}:${XMRIG_GRP}"
+respawn_max="3"
+respawn_period="40"
+
+depend() {
+       need net
+       provide xmrigdaemon
+}
+
+start_pre() {
+    einfo "Looking for any other XMRig daemons to stop"
+    for file in /etc/init.d/xmrigd.*;do [[ $RC_SVCNAME != $(basename $file) ]] && rc-service $basename ${file} stop --nodeps 2>/dev/null;done
+}
+
+stop_post() {
+       echo "stopped stopped  miner    speed 10s/60s/15m 0 0 0 H/s max 0 H/s">>/var/log/xmrig.log
+}
diff --git a/net-misc/xmrig/files/xmrigd.confd b/net-misc/xmrig/files/xmrigd.confd
new file mode 100644 (file)
index 0000000..1f43c2c
--- /dev/null
@@ -0,0 +1,3 @@
+XMRIG_ARGS="-o 10.0.0.254:3333 --log-file=/var/log/xmrig.log --verbose"
+XMRIG_USR=root
+XMRIG_GRP=root
diff --git a/net-misc/xmrig/xmrig-6.21.1.ebuild b/net-misc/xmrig/xmrig-6.21.1.ebuild
new file mode 100644 (file)
index 0000000..b6cc3de
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic systemd toolchain-funcs
+
+DESCRIPTION="RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner"
+HOMEPAGE="https://xmrig.com https://github.com/xmrig/xmrig"
+
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
+       inherit git-r3
+else
+       SRC_URI="https://github.com/xmrig/xmrig/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+       KEYWORDS="amd64 arm64"
+fi
+
+LICENSE="Apache-2.0 GPL-3+ MIT"
+SLOT="0"
+IUSE="cpu_flags_x86_sse4_1 donate hwloc opencl +ssl"
+
+DEPEND="
+       dev-libs/libuv:=
+       hwloc? ( >=sys-apps/hwloc-2.5.0:= )
+       opencl? ( virtual/opencl )
+       ssl? ( dev-libs/openssl:= )
+"
+RDEPEND="
+       ${DEPEND}
+       !arm64? ( sys-apps/msr-tools )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.12.2-nonotls.patch
+)
+
+src_prepare() {
+       if ! use donate ; then
+               sed -i 's/1;/0;/g' src/donate.h || die
+       fi
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       # JIT broken with FORTIFY_SOURCE=3
+       # Bug #913420
+       if tc-enables-fortify-source; then
+               filter-flags -D_FORTIFY_SOURCE=3
+               append-cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+       fi
+
+       local mycmakeargs=(
+               -DWITH_SSE4_1=$(usex cpu_flags_x86_sse4_1)
+               -DWITH_HWLOC=$(usex hwloc)
+               -DWITH_TLS=$(usex ssl)
+               -DWITH_OPENCL=$(usex opencl)
+               -DWITH_CUDA=OFF
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       default
+       keepdir /etc/xmrig
+       systemd_dounit "${FILESDIR}"/xmrig.service
+       dobin "${BUILD_DIR}/xmrig"
+       dobin "${S}/scripts/enable_1gb_pages.sh"
+       dobin "${S}/scripts/randomx_boost.sh"
+}
index f3852be985d7839b3a01fdc0743bdc32a9755049..f9cccb695b4d08a6d61e8d09a1175ff103332954 100644 (file)
@@ -1,18 +1 @@
-AUX monero-0.17.1.7-linkjobs.patch 1541 BLAKE2B e8aff4f66664f47c03fee44fe3354828cadf48b70724b3a9c5a1b257dacb1f3a8f61de391074ec2251c926298e25949bd3022e38323aef5d1ee232c9c727ea69 SHA512 e2e1307510c63b9069c0c4b3770637346b909e4445dcdb8d2b2dc7a67758f1b9984cbbee3cab9feafc1df929a1d2cdddff34cf577cd45090114086fdbfdc7544
-AUX monero-0.17.1.7-unbundle-dependencies.patch 3705 BLAKE2B 115a7b27ac0ee32d57f8d4f77b6d5219edb7e7152f058c9cd7039176031883f5b12e19b65cbda0312a72248313ef4d44ac5069ae3357ac3af9aaf3f7b197cb26 SHA512 c3a36596edd70fabcb66e9503bb1d5f6481ad768466a1e9efa42c268e8a3b05b993a3310b209da91b87590a01ee344bd3835e60c339287771f330812d45a86b6
-AUX monero-0.17.2.0-boost-176.patch 778 BLAKE2B ba799a7a0d6c13765cf0825114a857095ef9390dea98069b0a26540680dc8bd54b3b9bbe3e5099e8260996e60960a97e4cc33ea32aaf611b80cf7c2ce22d98ad SHA512 c67ab4d4e7449d3690663647aa14411cce90ded9c9aa8bcd600ddbd3cd7633b3f5ec346c3c3c587951e9b1c380c99490764d70421ee0a9abb0fcc470e1f76c48
-AUX monero-0.17.3.0-unbundle-dependencies.patch 3809 BLAKE2B bc629c1061fad475ec26d040aef3615dab3a01bc4fc6c4f9e34834d61abce0e1cca4e61cd7a55884ced5c803c50035d7657d58a53803c0bd3bbd0ef0da10dd56 SHA512 cddd5e831ecea0ce1a0bb863431fa3853b8fd8235e1368c1b1db2751bf66d6850cdfd48f45a98d87a0b7192021297837f82c64386ef7a1393b711820c7de4714
-AUX monerod.conf 301 BLAKE2B 48e8545ac02afbb8edd32d1457afcd52c30380ba03e526c982eb91ce9fa0c5733fdbc9547fd7a01f525176122bc201f5e8f5bc88125bbaf6bf762c0f5df7a220 SHA512 ca7fa3003f8e87c66e3a1986555327e1ce767d694daa506a8889aea8fe8b646cfece54bee1a1d029c66e32aa7845501059c2810bb030c445f3dfa46c43704d41
-AUX monerod.confd 213 BLAKE2B 25a6f44d2d1bdbc21990e18e19239ce8b75a9d0228978c352e142e939b5db3f2c6ceed22f39ac7ad956e377fc9a062616d4d6677c7f0ba05d7683593867cb01b SHA512 68eb1575297a992023a14db60239ac0b031b2a10cfd207252aba16d709d721fd89451aba05635c3f5a5351109317f32ca3acc66c1203098a1f13e91007b33073
-AUX monerod.initd 527 BLAKE2B 7af13d433bb025b86c52fbabdcd24d8940baf889ae931b7492f5766357f861d92cc53e6bcbf276f0bcd46827ca48fa188dea2052bc0d1727ad5ab02259701167 SHA512 796c99f4ec060e289433d9ac6df6550aea75f37ab06eca7470014ff576e4686559c123f749be452af4c4ebd84236238cbba33259fba2d3a05d8f25517bde4e5a
-AUX monerod.service 329 BLAKE2B e4390612e1e37cb47164967cc086eb32b1dac61ceba621d376ae87220245284d83dd0895e786daf1652ff40c0161f713cd4f124ae7b2d57306208d5886c8aeb3 SHA512 38eb172bcd46c98a5aaa8f7c0d8bf011c183fd4d09f9d38c14679a4a0ee628d58c6dde6cce181745b053576e3b8907038d75ec3bcb3b0bb03e62c606573038b3
-DIST monero-0.17.2.0.tar.gz 10622184 BLAKE2B c439e447f524a08a7ee79420873b7cf393f5cd3269460944aac30a315ac7c273c12fd809d86d41445bfc7e8c2feb0538d4e9fc1dadeb55f7e09f2920778f07a7 SHA512 85b764f1fc25127e7ca4ada67b1d832a9604c4cf65b160d689650e7ca7bbc36b73d8b26c5409fabdaad7369684997447cd812d1c521fad19d24f5b35f4789a1e
-DIST monero-0.17.2.3.tar.gz 10640501 BLAKE2B 15c7b92e7d00788214953c09af96d578e79c65ba9263d2a9ea19cfb9cc65e77d15770b873a10b77aae9e908dce74162d3577ed241600ebd57098b860bfd8f114 SHA512 7f3363c2cb66fa90a47a4cbb03b367182afa63af21d40bf07ea57cd91e4805684ec4795c0390bc966626a3b7b3c0a47167036873f5d1ea4b487a3d02bf01aaa4
-DIST monero-0.17.3.0.tar.gz 10659302 BLAKE2B fe73172e490f119a3d3730e3c11afd386e54fa22e12ac69d6f5e420d5409ba8201289feb01041520b374768325ea82132108972f68ef59114f414451232daea6 SHA512 97a40f594aaa6f588a3ad982142a0ea4f4410d208dd5ff43b09c70baadd32f87e92eac97abd800f25298e8d0613ae85f68605f586ceccf9dc078fcb189d7511a
-DIST monero-0.17.3.2.tar.gz 10685156 BLAKE2B f313ec0e5e224797448a43ad46d4e990174eec6cdceec6dc9a25d62f014a775172e103d05a33558404bd84a8443ba6ada0c27f81a3a83fe630d16cbad97602f5 SHA512 2d34e0525b2ca1d7bddb8ea51776b49fec4fb866a1c1239c347460ed3369af2f430be32da45666f16c369cebef099f285971c0e806d75d60354f195c5f93891d
-EBUILD monero-0.17.2.0.ebuild 2957 BLAKE2B 3fa353b8dfc213ff02a5f124506b5a77cce6377699f6300b688b4beb05d510c4cedbfc62bb849066b1ad6187012c05d19afdf17f22b1049ac671cea6d7c397ba SHA512 fef4ea14e996f9014271adbd896e8eeaffb3824d24682a9cc7309f855d0cbb58b73234887e6169b4a96a6fea01ec7cdf5881c93fd9c72104e5ce508081324a1a
-EBUILD monero-0.17.2.3.ebuild 2957 BLAKE2B 3fa353b8dfc213ff02a5f124506b5a77cce6377699f6300b688b4beb05d510c4cedbfc62bb849066b1ad6187012c05d19afdf17f22b1049ac671cea6d7c397ba SHA512 fef4ea14e996f9014271adbd896e8eeaffb3824d24682a9cc7309f855d0cbb58b73234887e6169b4a96a6fea01ec7cdf5881c93fd9c72104e5ce508081324a1a
-EBUILD monero-0.17.3.0.ebuild 2879 BLAKE2B 553f1ff48b03bfbda99fe0d165b954e7dd1a028347eb4081499f42c5d0be8f9d46397040d6ed63b2c2d6c5346a69219499b91a8bf86727096cf7501b140fc958 SHA512 56a1ff0dfa45d617b47d160359701698f2bb0edc924dcc5e516631cb579e2482263dad4c2347551af6cca39271beacabf3cfb513674f0dadcf036251d201f1eb
-EBUILD monero-0.17.3.2.ebuild 2934 BLAKE2B a9db5d6028fa4460fb71c473e2c6e043ce795fb2561027d090c2ae04f8762f8cfc587d8d22eda6276136cb2cd293ce96978515f278c30e2d3a73951b41e2ea4a SHA512 43717d94f48655830046dac0a88f5e43d287294ddee60cb92022d62290b3d7f7177639f362309865be8116fc74b0e887600f4e9412353a31ef60d97635a5d397
-EBUILD monero-9999.ebuild 2910 BLAKE2B 5d5bf8340279b2be61eccc0ccd925c2b9563d9fa33e1dafa29711621c88e0020af26afa035817e01af0f1af4d247da345e7cb227ea37fdccaf8789d868235675 SHA512 aa0ec0f1be6a3337428da58bea5a475fbc9ba14fed27339e00ef2eeec2c2aacd25a6b51d054016e5a338cbc25449fef73350dbdd0e9fc4d908fd21cb564532d6
-MISC metadata.xml 1131 BLAKE2B ce2528cd7a73dd991d234aa4d58b5e4aab039cb51746c04af63f243c7d00c701b7cc5236df48c42f5d58c309624c36d11c532095ea6719f14dceb6542e4e7630 SHA512 a05eb919706ddae56a82a5ac71c6484e2bfd8d14f9d736e83b7099e4a7d1bf92b22ed96e9e4929ce67349971c60521ae3b5bcd1139725fbd5323d65e33283736
+DIST monero-0.18.3.4.tar.gz 14039924 BLAKE2B cb60f1db4f482bac3b3f5fa606bf1c78103b14f927d4636e5fda4aa96dcc08a9f990355ceb1cdc8c253245a0a2a1c98cf4fd7101d13d78ac6e7d1450192fc2db SHA512 f2708bf7698410c1509ae41148c298e352b3401e1df900b7152c25cb5ceb2f5bde68274fd37b1a328e932be50bdf93fe364561c520a15e3df7de2cdbd20d1be8
diff --git a/net-p2p/monero/files/monero-0.17.1.7-linkjobs.patch b/net-p2p/monero/files/monero-0.17.1.7-linkjobs.patch
deleted file mode 100644 (file)
index d0f59a6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-From 12a78e5e745556c29e45b7716a8b038ecfbff800 Mon Sep 17 00:00:00 2001
-From: Matt Smith <matt@offtopica.uk>
-Date: Wed, 5 Aug 2020 18:39:44 +0100
-Subject: [PATCH] cmake: Use job pool feature to limit concurrent jobs
-
-Add two new options, MONERO_PARALLEL_COMPILE_JOBS and
-MONERO_PARALLEL_LINK_JOBS to try and prevent running out of memory when
-building everything.
-
-Requires >= cmake 3.0.0, and the use of the Ninja generator.
-
-Useful links:
-
-* https://cmake.org/cmake/help/latest/prop_gbl/JOB_POOLS.html
-* https://reviews.llvm.org/D6304
----
- CMakeLists.txt | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f63c07a35d..3729a6b659 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -55,6 +55,20 @@ else()
-       message(STATUS "ccache deselected")
- endif()
-+if (${CMAKE_VERSION} VERSION_GREATER "3.0.0" AND CMAKE_MAKE_PROGRAM MATCHES "ninja")
-+  set(MONERO_PARALLEL_COMPILE_JOBS "" CACHE STRING "The maximum number of concurrent compilation jobs.")
-+  if (MONERO_PARALLEL_COMPILE_JOBS)
-+    set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${MONERO_PARALLEL_COMPILE_JOBS})
-+    set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
-+  endif ()
-+
-+  set(MONERO_PARALLEL_LINK_JOBS "" CACHE STRING "The maximum number of concurrent link jobs.")
-+  if (MONERO_PARALLEL_LINK_JOBS)
-+    set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${MONERO_PARALLEL_LINK_JOBS})
-+    set(CMAKE_JOB_POOL_LINK link_job_pool)
-+  endif ()
-+endif()
-+
- enable_language(C ASM)
- function (die msg)
diff --git a/net-p2p/monero/files/monero-0.17.2.0-boost-176.patch b/net-p2p/monero/files/monero-0.17.2.0-boost-176.patch
deleted file mode 100644 (file)
index 07a584a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From c28d2f7c110c0a2161fa02d6c20df94a60a41965 Mon Sep 17 00:00:00 2001
-From: loqs <loqs@users.noreply.github.com>
-Date: Sun, 23 May 2021 20:29:17 +0100
-Subject: [PATCH] Fix boost 1.76.0 compatibility
-
-Add missing header boost/mpl/contains.hpp
-monero-project/monero/issues/7728
----
- contrib/epee/include/storages/portable_storage.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/contrib/epee/include/storages/portable_storage.h b/contrib/epee/include/storages/portable_storage.h
-index 1e68605abf5..801bb2c3465 100644
---- a/contrib/epee/include/storages/portable_storage.h
-+++ b/contrib/epee/include/storages/portable_storage.h
-@@ -40,6 +40,8 @@
- #include "span.h"
- #include "int-util.h"
-+#include <boost/mpl/contains.hpp>
-+
- namespace epee
- {
-   namespace serialization
diff --git a/net-p2p/monero/files/monero-0.18.3.3-miniupnp-api-18.patch b/net-p2p/monero/files/monero-0.18.3.3-miniupnp-api-18.patch
new file mode 100644 (file)
index 0000000..d281f60
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl\r
+index 30e3d31b9..c49783e1c 100644\r
+--- a/src/p2p/net_node.inl\r
++++ b/src/p2p/net_node.inl\r
+@@ -2989,7 +2989,12 @@ namespace nodetool\r
+     UPNPUrls urls;\r
+     IGDdatas igdData;\r
+     char lanAddress[64];\r
++#if MINIUPNPC_API_VERSION > 17\r
++    char wanAddress[64];\r
++    result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof(wanAddress));\r
++#else\r
+     result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);\r
++#endif\r
+     freeUPNPDevlist(deviceList);\r
+     if (result > 0) {\r
+       if (result == 1) {\r
+@@ -3057,7 +3062,12 @@ namespace nodetool\r
+     UPNPUrls urls;\r
+     IGDdatas igdData;\r
+     char lanAddress[64];\r
++#if MINIUPNPC_API_VERSION > 17\r
++    char wanAddress[64];\r
++    result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof(wanAddress));\r
++#else\r
+     result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);\r
++#endif\r
+     freeUPNPDevlist(deviceList);\r
+     if (result > 0) {\r
+       if (result == 1) {\r
similarity index 75%
rename from net-p2p/monero/files/monero-0.17.1.7-unbundle-dependencies.patch
rename to net-p2p/monero/files/monero-0.18.3.3-unbundle-dependencies.patch
index ea7f80499681dba0eaaeccb0b237c8ede89255ee..6cd7e7c3d3bd50087eb48c0d4e3f4f421ef5906e 100644 (file)
@@ -1,8 +1,6 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 41f82e26c..3eb2b2e78 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -312,7 +312,7 @@ endif()
+@@ -458,7 +458,7 @@
  # elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
  #   set(BSDI TRUE)
  
@@ -10,8 +8,8 @@ index 41f82e26c..3eb2b2e78 100644
 +include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external )
  
  if(APPLE)
-   include_directories(SYSTEM /usr/include/malloc)
-@@ -995,7 +995,6 @@ if(SODIUM_LIBRARY)
+   cmake_policy(SET CMP0042 NEW)
+@@ -1201,7 +1201,6 @@
    set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
  endif()
  
@@ -19,17 +17,17 @@ index 41f82e26c..3eb2b2e78 100644
  add_subdirectory(contrib)
  add_subdirectory(src)
  
-diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
-index a8916a7d0..05ab35c82 100644
 --- a/external/CMakeLists.txt
 +++ b/external/CMakeLists.txt
-@@ -37,19 +37,7 @@
+@@ -37,21 +37,7 @@
  
  find_package(Miniupnpc REQUIRED)
  
 -message(STATUS "Using in-tree miniupnpc")
+-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE)
 -add_subdirectory(miniupnp/miniupnpc)
 -set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
+-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON)
 -if(MSVC)
 -  set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
 -elseif(NOT MSVC)
@@ -44,16 +42,14 @@ index a8916a7d0..05ab35c82 100644
  
  find_package(Unbound)
  
-@@ -81,4 +69,3 @@ endif()
+@@ -69,4 +55,3 @@
  add_subdirectory(db_drivers)
  add_subdirectory(easylogging++)
  add_subdirectory(qrcodegen)
 -add_subdirectory(randomx EXCLUDE_FROM_ALL)
-diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt
-index 3b33fe90a..ba354a0e8 100644
 --- a/src/crypto/CMakeLists.txt
 +++ b/src/crypto/CMakeLists.txt
-@@ -55,6 +55,7 @@ list(APPEND crypto_sources CryptonightR_template.S)
+@@ -55,6 +55,7 @@
  endif()
  
  include_directories(${RANDOMX_INCLUDE})
@@ -61,18 +57,16 @@ index 3b33fe90a..ba354a0e8 100644
  
  set(crypto_headers)
  
-@@ -116,6 +117,3 @@ endif()
+@@ -97,6 +98,3 @@
  # cheat because cmake and ccache hate each other
  set_property(SOURCE CryptonightR_template.S PROPERTY LANGUAGE C)
+ set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE sourcecode.asm)
 -
 -# Must be done last, because it references libraries in this directory
 -add_subdirectory(wallet)
-diff --git a/src/crypto/wallet/crypto.h b/src/crypto/wallet/crypto.h
-index a4c5d5a07..5c6b96cd8 100644
 --- a/src/crypto/wallet/crypto.h
 +++ b/src/crypto/wallet/crypto.h
-@@ -29,7 +29,6 @@
+@@ -30,7 +30,6 @@
  #pragma once
  
  #include <cstddef>
@@ -80,21 +74,17 @@ index a4c5d5a07..5c6b96cd8 100644
  
  namespace crypto {
    namespace wallet {
-diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt
-index ff2afba4b..26b0f4523 100644
 --- a/src/device/CMakeLists.txt
 +++ b/src/device/CMakeLists.txt
-@@ -72,7 +72,7 @@ target_link_libraries(device
-     ${HIDAPI_LIBRARIES}
+@@ -73,7 +73,7 @@
      cncrypto
+     cryptonote_format_utils_basic
      ringct_basic
 -    wallet-crypto
 +    monero-crypto
      ${OPENSSL_CRYPTO_LIBRARIES}
      ${Boost_SERIALIZATION_LIBRARY}
    PRIVATE
-diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
-index 65db2615c..3ace310f6 100644
 --- a/src/p2p/net_node.inl
 +++ b/src/p2p/net_node.inl
 @@ -60,9 +60,9 @@
diff --git a/net-p2p/monero/files/monero-0.18.3.4-boost-1.85.patch b/net-p2p/monero/files/monero-0.18.3.4-boost-1.85.patch
new file mode 100644 (file)
index 0000000..1e4793b
--- /dev/null
@@ -0,0 +1,585 @@
+From 65568d3a884857ce08d1170f5801a6891a5c187c Mon Sep 17 00:00:00 2001
+From: jeffro256 <jeffro256@tutanota.com>
+Date: Fri, 23 Aug 2024 12:15:17 -0500
+Subject: [PATCH] build: fix build with Boost 1.85 and remove instances of
+ viewkey logging [RELEASE]
+
+1. Use std::is_standard_layout and std::is_trivially_copyable instead of std::is_pod for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
+2. Removed reimplementation of std::hash for boost::uuids::uuid
+3. Removed << operator overload for crypto::secret_key
+4. Removed instances in code where private view key was dumped to the log in plaintext
+
+Release version of #9450, containing C++14 modified assertions
+---
+ CMakeLists.txt                                |  2 ++
+ .../serialization/keyvalue_serialization.h    | 18 ++++++++-------
+ contrib/epee/include/span.h                   | 23 +++++++++++--------
+ contrib/epee/include/string_tools.h           |  3 +++
+ src/crypto/crypto.h                           | 14 ++++++++---
+ .../cryptonote_format_utils.cpp               |  4 ++--
+ src/cryptonote_core/cryptonote_tx_utils.cpp   |  4 ++--
+ src/cryptonote_protocol/block_queue.cpp       | 13 ++---------
+ src/device/device_default.cpp                 |  8 ++++---
+ src/lmdb/util.h                               |  4 ++--
+ src/simplewallet/simplewallet.cpp             |  6 ++---
+ src/wallet/api/wallet.cpp                     |  8 +++----
+ src/wallet/wallet2.cpp                        | 18 +++++++--------
+ src/wallet/wallet_rpc_server.cpp              |  4 ++--
+ tests/benchmark.cpp                           |  2 +-
+ tests/core_tests/multisig.cpp                 | 10 ++++----
+ tests/functional_tests/make_test_signature.cc |  2 +-
+ tests/unit_tests/crypto.cpp                   |  2 +-
+ tests/unit_tests/multisig.cpp                 |  2 +-
+ tests/unit_tests/serialization.cpp            |  2 +-
+ 20 files changed, 80 insertions(+), 69 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8fb03ba1ff..7b77c37393 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1077,6 +1077,8 @@ if(STATIC)
+ endif()
+ find_package(Boost 1.58 QUIET REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale)
+ add_definitions(-DBOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION)
++add_definitions(-DBOOST_NO_AUTO_PTR)
++add_definitions(-DBOOST_UUID_DISABLE_ALIGNMENT) # This restores UUID's std::has_unique_object_representations property
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_LIB_SUFFIXES})
+ if(NOT Boost_FOUND)
+diff --git a/contrib/epee/include/serialization/keyvalue_serialization.h b/contrib/epee/include/serialization/keyvalue_serialization.h
+index 06d74329f1..fbbddc7d2f 100644
+--- a/contrib/epee/include/serialization/keyvalue_serialization.h
++++ b/contrib/epee/include/serialization/keyvalue_serialization.h
+@@ -98,16 +98,18 @@ public: \
+ #define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name) \
+   epee::serialization::selector<is_store>::serialize_t_val_as_blob(this_ref.varialble, stg, hparent_section, val_name); 
+-#define KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, val_name) \
+-  static_assert(std::is_pod<decltype(this_ref.varialble)>::value, "t_type must be a POD type."); \
+-  KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name)
++#define KV_SERIALIZE_VAL_POD_AS_BLOB_N(variable, val_name) \
++  static_assert(std::is_trivially_copyable<decltype(this_ref.variable)>(), "t_type must be a trivially copyable type."); \
++  static_assert(std::is_standard_layout<decltype(this_ref.variable)>(), "t_type must be a standard layout type."); \
++  KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(variable, val_name)
+-#define KV_SERIALIZE_VAL_POD_AS_BLOB_OPT_N(varialble, val_name, default_value) \
++#define KV_SERIALIZE_VAL_POD_AS_BLOB_OPT_N(variable, val_name, default_value) \
+   do { \
+-    static_assert(std::is_pod<decltype(this_ref.varialble)>::value, "t_type must be a POD type."); \
+-    bool ret = KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, val_name); \
++    static_assert(std::is_trivially_copyable<decltype(this_ref.variable)>(), "t_type must be a trivially copyable type."); \
++    static_assert(std::is_standard_layout<decltype(this_ref.variable)>(), "t_type must be a standard layout type."); \
++    bool ret = KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(variable, val_name) \
+     if (!ret) \
+-      epee::serialize_default(this_ref.varialble, default_value); \
++      epee::serialize_default(this_ref.variable, default_value); \
+   } while(0);
+ #define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, val_name) \
+@@ -118,7 +120,7 @@ public: \
+ #define KV_SERIALIZE(varialble)                           KV_SERIALIZE_N(varialble, #varialble)
+ #define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble)           KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, #varialble)
+ #define KV_SERIALIZE_VAL_POD_AS_BLOB_OPT(varialble, def)  KV_SERIALIZE_VAL_POD_AS_BLOB_OPT_N(varialble, #varialble, def)
+-#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble)     KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, #varialble) //skip is_pod compile time check
++#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble)     KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, #varialble) //skip is_trivially_copyable and is_standard_layout compile time check
+ #define KV_SERIALIZE_CONTAINER_POD_AS_BLOB(varialble)     KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, #varialble)
+ #define KV_SERIALIZE_OPT(variable,default_value)          KV_SERIALIZE_OPT_N(variable, #variable, default_value)
+diff --git a/contrib/epee/include/span.h b/contrib/epee/include/span.h
+index 23bd51f8c2..01dc387d6d 100644
+--- a/contrib/epee/include/span.h
++++ b/contrib/epee/include/span.h
+@@ -133,17 +133,14 @@ namespace epee
+     return {src.data(), src.size()};
+   }
+-  template<typename T>
+-  constexpr bool has_padding() noexcept
+-  {
+-    return !std::is_standard_layout<T>() || alignof(T) != 1;
+-  }
+-
+   //! \return Cast data from `src` as `span<const std::uint8_t>`.
+   template<typename T>
+   span<const std::uint8_t> to_byte_span(const span<const T> src) noexcept
+   {
+-    static_assert(!has_padding<T>(), "source type may have padding");
++    static_assert(!std::is_empty<T>(), "empty value types will not work -> sizeof == 1");
++    static_assert(std::is_standard_layout<T>(), "type must have standard layout");
++    static_assert(std::is_trivially_copyable<T>(), "type must be trivially copyable");
++    static_assert(alignof(T) == 1, "type may have padding");
+     return {reinterpret_cast<const std::uint8_t*>(src.data()), src.size_bytes()}; 
+   }
+@@ -153,7 +150,9 @@ namespace epee
+   {
+     using value_type = typename T::value_type;
+     static_assert(!std::is_empty<value_type>(), "empty value types will not work -> sizeof == 1");
+-    static_assert(!has_padding<value_type>(), "source value type may have padding");
++    static_assert(std::is_standard_layout<value_type>(), "value type must have standard layout");
++    static_assert(std::is_trivially_copyable<value_type>(), "value type must be trivially copyable");
++    static_assert(alignof(value_type) == 1, "value type may have padding");
+     return {reinterpret_cast<std::uint8_t*>(src.data()), src.size() * sizeof(value_type)};
+   }
+@@ -162,7 +161,9 @@ namespace epee
+   span<const std::uint8_t> as_byte_span(const T& src) noexcept
+   {
+     static_assert(!std::is_empty<T>(), "empty types will not work -> sizeof == 1");
+-    static_assert(!has_padding<T>(), "source type may have padding");
++    static_assert(std::is_standard_layout<T>(), "type must have standard layout");
++    static_assert(std::is_trivially_copyable<T>(), "type must be trivially copyable");
++    static_assert(alignof(T) == 1, "type may have padding");
+     return {reinterpret_cast<const std::uint8_t*>(std::addressof(src)), sizeof(T)};
+   }
+@@ -171,7 +172,9 @@ namespace epee
+   span<std::uint8_t> as_mut_byte_span(T& src) noexcept
+   {
+     static_assert(!std::is_empty<T>(), "empty types will not work -> sizeof == 1");
+-    static_assert(!has_padding<T>(), "source type may have padding");
++    static_assert(std::is_standard_layout<T>(), "type must have standard layout");
++    static_assert(std::is_trivially_copyable<T>(), "type must be trivially copyable");
++    static_assert(alignof(T) == 1, "type may have padding");
+     return {reinterpret_cast<std::uint8_t*>(std::addressof(src)), sizeof(T)};
+   }
+diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h
+index 31c55b97ba..7de73cbf5a 100644
+--- a/contrib/epee/include/string_tools.h
++++ b/contrib/epee/include/string_tools.h
+@@ -91,6 +91,7 @@ namespace string_tools
+   std::string pod_to_hex(const t_pod_type& s)
+   {
+     static_assert(std::is_standard_layout<t_pod_type>(), "expected standard layout type");
++    static_assert(alignof(t_pod_type) == 1, "type may have padding");
+     return to_hex::string(as_byte_span(s));
+   }
+   //----------------------------------------------------------------------------
+@@ -98,6 +99,8 @@ namespace string_tools
+   bool hex_to_pod(const boost::string_ref hex_str, t_pod_type& s)
+   {
+     static_assert(std::is_standard_layout<t_pod_type>(), "expected standard layout type");
++    static_assert(alignof(t_pod_type) == 1, "type may have padding");
++    static_assert(std::is_trivially_copyable<t_pod_type>(), "type must be trivially copyable");
+     return from_hex::to_buffer(as_mut_byte_span(s), hex_str);
+   }
+   //----------------------------------------------------------------------------
+diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h
+index d8cd6c6a01..ee1cac04a6 100644
+--- a/src/crypto/crypto.h
++++ b/src/crypto/crypto.h
+@@ -171,7 +171,9 @@ namespace crypto {
+   /* Generate a value filled with random bytes.
+    */
+   template<typename T>
+-  typename std::enable_if<std::is_pod<T>::value, T>::type rand() {
++  T rand() {
++    static_assert(std::is_standard_layout<T>(), "cannot write random bytes into non-standard layout type");
++    static_assert(std::is_trivially_copyable<T>(), "cannot write random bytes into non-trivially copyable type");
+     typename std::remove_cv<T>::type res;
+     generate_random_bytes_thread_safe(sizeof(T), (uint8_t*)&res);
+     return res;
+@@ -314,8 +316,14 @@ namespace crypto {
+   inline std::ostream &operator <<(std::ostream &o, const crypto::public_key &v) {
+     epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
+   }
+-  inline std::ostream &operator <<(std::ostream &o, const crypto::secret_key &v) {
+-    epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
++  /* Do NOT overload the << operator for crypto::secret_key here. Use secret_key_explicit_print_ref
++   * instead to prevent accidental implicit dumping of secret key material to the logs (which has
++   * happened before). For the same reason, do not overload it for crypto::ec_scalar either since
++   * crypto::secret_key is a subclass. I'm not sorry that it's obtuse; that's the point, bozo.
++   */
++  struct secret_key_explicit_print_ref { const crypto::secret_key &sk; };
++  inline std::ostream &operator <<(std::ostream &o, const secret_key_explicit_print_ref v) {
++    epee::to_hex::formatted(o, epee::as_byte_span(unwrap(unwrap(v.sk)))); return o;
+   }
+   inline std::ostream &operator <<(std::ostream &o, const crypto::key_derivation &v) {
+     epee::to_hex::formatted(o, epee::as_byte_span(v)); return o;
+diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
+index 8be23583b5..e6e424c719 100644
+--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
++++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
+@@ -292,7 +292,7 @@ namespace cryptonote
+     bool r = hwdev.generate_key_derivation(tx_public_key, ack.m_view_secret_key, recv_derivation);
+     if (!r)
+     {
+-      MWARNING("key image helper: failed to generate_key_derivation(" << tx_public_key << ", " << ack.m_view_secret_key << ")");
++      MWARNING("key image helper: failed to generate_key_derivation(" << tx_public_key << ", <viewkey>)");
+       memcpy(&recv_derivation, rct::identity().bytes, sizeof(recv_derivation));
+     }
+@@ -303,7 +303,7 @@ namespace cryptonote
+       r = hwdev.generate_key_derivation(additional_tx_public_keys[i], ack.m_view_secret_key, additional_recv_derivation);
+       if (!r)
+       {
+-        MWARNING("key image helper: failed to generate_key_derivation(" << additional_tx_public_keys[i] << ", " << ack.m_view_secret_key << ")");
++        MWARNING("key image helper: failed to generate_key_derivation(" << additional_tx_public_keys[i] << ", <viewkey>)");
+       }
+       else
+       {
+diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp
+index dc9d6612f6..8f044154b1 100644
+--- a/src/cryptonote_core/cryptonote_tx_utils.cpp
++++ b/src/cryptonote_core/cryptonote_tx_utils.cpp
+@@ -144,7 +144,7 @@ namespace cryptonote
+       crypto::key_derivation derivation = AUTO_VAL_INIT(derivation);
+       crypto::public_key out_eph_public_key = AUTO_VAL_INIT(out_eph_public_key);
+       bool r = crypto::generate_key_derivation(miner_address.m_view_public_key, txkey.sec, derivation);
+-      CHECK_AND_ASSERT_MES(r, false, "while creating outs: failed to generate_key_derivation(" << miner_address.m_view_public_key << ", " << txkey.sec << ")");
++      CHECK_AND_ASSERT_MES(r, false, "while creating outs: failed to generate_key_derivation(" << miner_address.m_view_public_key << ", " << crypto::secret_key_explicit_print_ref{txkey.sec} << ")");
+       r = crypto::derive_public_key(derivation, no, miner_address.m_spend_public_key, out_eph_public_key);
+       CHECK_AND_ASSERT_MES(r, false, "while creating outs: failed to derive_public_key(" << derivation << ", " << no << ", "<< miner_address.m_spend_public_key << ")");
+@@ -484,7 +484,7 @@ namespace cryptonote
+           crypto::generate_ring_signature(tx_prefix_hash, boost::get<txin_to_key>(tx.vin[i]).k_image, keys_ptrs, in_contexts[i].in_ephemeral.sec, src_entr.real_output, sigs.data());
+         ss_ring_s << "signatures:" << ENDL;
+         std::for_each(sigs.begin(), sigs.end(), [&](const crypto::signature& s){ss_ring_s << s << ENDL;});
+-        ss_ring_s << "prefix_hash:" << tx_prefix_hash << ENDL << "in_ephemeral_key: " << in_contexts[i].in_ephemeral.sec << ENDL << "real_output: " << src_entr.real_output << ENDL;
++        ss_ring_s << "prefix_hash:" << tx_prefix_hash << ENDL << "in_ephemeral_key: " << crypto::secret_key_explicit_print_ref{in_contexts[i].in_ephemeral.sec} << ENDL << "real_output: " << src_entr.real_output << ENDL;
+         i++;
+       }
+diff --git a/src/cryptonote_protocol/block_queue.cpp b/src/cryptonote_protocol/block_queue.cpp
+index 4e65eafa4f..e5a4c0c99a 100644
+--- a/src/cryptonote_protocol/block_queue.cpp
++++ b/src/cryptonote_protocol/block_queue.cpp
+@@ -40,15 +40,6 @@
+ #undef MONERO_DEFAULT_LOG_CATEGORY
+ #define MONERO_DEFAULT_LOG_CATEGORY "cn.block_queue"
+-namespace std {
+-  static_assert(sizeof(size_t) <= sizeof(boost::uuids::uuid), "boost::uuids::uuid too small");
+-  template<> struct hash<boost::uuids::uuid> {
+-    std::size_t operator()(const boost::uuids::uuid &_v) const {
+-      return reinterpret_cast<const std::size_t &>(_v);
+-    }
+-  };
+-}
+-
+ namespace cryptonote
+ {
+@@ -472,7 +463,7 @@ bool block_queue::has_spans(const boost::uuids::uuid &connection_id) const
+ float block_queue::get_speed(const boost::uuids::uuid &connection_id) const
+ {
+   boost::unique_lock<boost::recursive_mutex> lock(mutex);
+-  std::unordered_map<boost::uuids::uuid, float> speeds;
++  std::unordered_map<boost::uuids::uuid, float, boost::hash<boost::uuids::uuid>> speeds;
+   for (const auto &span: blocks)
+   {
+     if (span.blocks.empty())
+@@ -480,7 +471,7 @@ float block_queue::get_speed(const boost::uuids::uuid &connection_id) const
+     // note that the average below does not average over the whole set, but over the
+     // previous pseudo average and the latest rate: this gives much more importance
+     // to the latest measurements, which is fine here
+-    std::unordered_map<boost::uuids::uuid, float>::iterator i = speeds.find(span.connection_id);
++    const auto i = speeds.find(span.connection_id);
+     if (i == speeds.end())
+       speeds.insert(std::make_pair(span.connection_id, span.rate));
+     else
+diff --git a/src/device/device_default.cpp b/src/device/device_default.cpp
+index d70ece229c..c770a6e221 100644
+--- a/src/device/device_default.cpp
++++ b/src/device/device_default.cpp
+@@ -317,13 +317,15 @@ namespace hw {
+             {
+             // sending change to yourself; derivation = a*R
+                 r = generate_key_derivation(txkey_pub, sender_account_keys.m_view_secret_key, derivation);
+-                CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to generate_key_derivation(" << txkey_pub << ", " << sender_account_keys.m_view_secret_key << ")");
++                CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to generate_key_derivation(" << txkey_pub << ", <viewkey>)");
+             }
+             else
+             {
+             // sending to the recipient; derivation = r*A (or s*C in the subaddress scheme)
+-                r = generate_key_derivation(dst_entr.addr.m_view_public_key, dst_entr.is_subaddress && need_additional_txkeys ? additional_txkey.sec : tx_key, derivation);
+-                CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to generate_key_derivation(" << dst_entr.addr.m_view_public_key << ", " << (dst_entr.is_subaddress && need_additional_txkeys ? additional_txkey.sec : tx_key) << ")");
++                const crypto::secret_key &tx_privkey{dst_entr.is_subaddress && need_additional_txkeys ? additional_txkey.sec : tx_key};
++                r = generate_key_derivation(dst_entr.addr.m_view_public_key, tx_privkey, derivation);
++                CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to generate_key_derivation("
++                    << dst_entr.addr.m_view_public_key << ", " << crypto::secret_key_explicit_print_ref{tx_privkey} << ")");
+             }
+             if (need_additional_txkeys)
+diff --git a/src/lmdb/util.h b/src/lmdb/util.h
+index c6c75bc004..392ff20390 100644
+--- a/src/lmdb/util.h
++++ b/src/lmdb/util.h
+@@ -127,7 +127,7 @@ namespace lmdb
+     /*!
+         A LMDB comparison function that uses `std::memcmp`.
+-        \toaram T is `!epee::has_padding`
++        \toaram T has standard layout and an alignment of 1
+         \tparam offset to `T` within the value.
+         \return The result of `std::memcmp` over the value.
+@@ -135,7 +135,7 @@ namespace lmdb
+     template<typename T, std::size_t offset = 0>
+     inline int compare(MDB_val const* left, MDB_val const* right) noexcept
+     {
+-        static_assert(!epee::has_padding<T>(), "memcmp will not work");
++        static_assert(std::is_standard_layout<T>() && alignof(T) == 1, "memcmp will not work");
+         if (!left || !right || left->mv_size < sizeof(T) + offset || right->mv_size < sizeof(T) + offset)
+         {
+             assert("invalid use of custom comparison" == 0);
+diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
+index b9e30f9d94..011b1c7613 100644
+--- a/src/simplewallet/simplewallet.cpp
++++ b/src/simplewallet/simplewallet.cpp
+@@ -1979,7 +1979,7 @@ bool simple_wallet::rpc_payment_info(const std::vector<std::string> &args)
+     crypto::public_key pkey;
+     crypto::secret_key_to_public_key(m_wallet->get_rpc_client_secret_key(), pkey);
+     message_writer() << tr("RPC client ID: ") << pkey;
+-    message_writer() << tr("RPC client secret key: ") << m_wallet->get_rpc_client_secret_key();
++    message_writer() << tr("RPC client secret key: ") << crypto::secret_key_explicit_print_ref{m_wallet->get_rpc_client_secret_key()};
+     if (!m_wallet->get_rpc_payment_info(false, payment_required, credits, diff, credits_per_hash_found, hashing_blob, height, seed_height, seed_hash, next_seed_hash, cookie))
+     {
+       fail_msg_writer() << tr("Failed to query daemon");
+@@ -8026,9 +8026,9 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args_)
+ std::string get_tx_key_stream(crypto::secret_key tx_key, std::vector<crypto::secret_key> additional_tx_keys)
+ {
+   ostringstream oss;
+-  oss << epee::string_tools::pod_to_hex(tx_key);
++  oss << epee::string_tools::pod_to_hex(unwrap(unwrap(tx_key)));
+   for (size_t i = 0; i < additional_tx_keys.size(); ++i)
+-    oss << epee::string_tools::pod_to_hex(additional_tx_keys[i]);
++    oss << epee::string_tools::pod_to_hex(unwrap(unwrap(additional_tx_keys[i])));
+   return oss.str();
+ }
+diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
+index fc4f891281..2ed14bfbd5 100644
+--- a/src/wallet/api/wallet.cpp
++++ b/src/wallet/api/wallet.cpp
+@@ -881,7 +881,7 @@ std::string WalletImpl::integratedAddress(const std::string &payment_id) const
+ std::string WalletImpl::secretViewKey() const
+ {
+-    return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key);
++    return epee::string_tools::pod_to_hex(unwrap(unwrap(m_wallet->get_account().get_keys().m_view_secret_key)));
+ }
+ std::string WalletImpl::publicViewKey() const
+@@ -891,7 +891,7 @@ std::string WalletImpl::publicViewKey() const
+ std::string WalletImpl::secretSpendKey() const
+ {
+-    return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_spend_secret_key);
++    return epee::string_tools::pod_to_hex(unwrap(unwrap(m_wallet->get_account().get_keys().m_spend_secret_key)));
+ }
+ std::string WalletImpl::publicSpendKey() const
+@@ -1878,9 +1878,9 @@ std::string WalletImpl::getTxKey(const std::string &txid_str) const
+         {
+             clearStatus();
+             std::ostringstream oss;
+-            oss << epee::string_tools::pod_to_hex(tx_key);
++            oss << epee::string_tools::pod_to_hex(unwrap(unwrap(tx_key)));
+             for (size_t i = 0; i < additional_tx_keys.size(); ++i)
+-                oss << epee::string_tools::pod_to_hex(additional_tx_keys[i]);
++                oss << epee::string_tools::pod_to_hex(unwrap(unwrap(additional_tx_keys[i])));
+             return oss.str();
+         }
+         else
+diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
+index ad8c361909..90b5731695 100644
+--- a/src/wallet/wallet2.cpp
++++ b/src/wallet/wallet2.cpp
+@@ -4613,7 +4613,7 @@ boost::optional<wallet2::keys_file_data> wallet2::get_keys_file_data(const epee:
+     original_address = get_account_address_as_str(m_nettype, false, m_original_address);
+     value.SetString(original_address.c_str(), original_address.length());
+     json.AddMember("original_address", value, json.GetAllocator());
+-    original_view_secret_key = epee::string_tools::pod_to_hex(m_original_view_secret_key);
++    original_view_secret_key = epee::string_tools::pod_to_hex(unwrap(unwrap(m_original_view_secret_key)));
+     value.SetString(original_view_secret_key.c_str(), original_view_secret_key.length());
+     json.AddMember("original_view_secret_key", value, json.GetAllocator());
+   }
+@@ -7077,7 +7077,7 @@ void wallet2::commit_tx(pending_tx& ptx)
+     cryptonote::COMMAND_RPC_SUBMIT_RAW_TX::request oreq;
+     cryptonote::COMMAND_RPC_SUBMIT_RAW_TX::response ores;
+     oreq.address = get_account().get_public_address_str(m_nettype);
+-    oreq.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++    oreq.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+     oreq.tx = epee::string_tools::buff_to_hex_nodelimer(tx_to_blob(ptx.tx));
+     {
+       const boost::lock_guard<boost::recursive_mutex> lock{m_daemon_rpc_mutex};
+@@ -10075,7 +10075,7 @@ bool wallet2::light_wallet_login(bool &new_address)
+   tools::COMMAND_RPC_LOGIN::request request;
+   tools::COMMAND_RPC_LOGIN::response response;
+   request.address = get_account().get_public_address_str(m_nettype);
+-  request.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++  request.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+   // Always create account if it doesn't exist.
+   request.create_account = true;
+   m_daemon_rpc_mutex.lock();
+@@ -10102,7 +10102,7 @@ bool wallet2::light_wallet_import_wallet_request(tools::COMMAND_RPC_IMPORT_WALLE
+   MDEBUG("Light wallet import wallet request");
+   tools::COMMAND_RPC_IMPORT_WALLET_REQUEST::request oreq;
+   oreq.address = get_account().get_public_address_str(m_nettype);
+-  oreq.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++  oreq.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+   m_daemon_rpc_mutex.lock();
+   bool r = invoke_http_json("/import_wallet_request", oreq, response, rpc_timeout, "POST");
+   m_daemon_rpc_mutex.unlock();
+@@ -10121,7 +10121,7 @@ void wallet2::light_wallet_get_unspent_outs()
+   
+   oreq.amount = "0";
+   oreq.address = get_account().get_public_address_str(m_nettype);
+-  oreq.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++  oreq.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+   // openMonero specific
+   oreq.dust_threshold = boost::lexical_cast<std::string>(::config::DEFAULT_DUST_THRESHOLD);
+   // below are required by openMonero api - but are not used.
+@@ -10273,7 +10273,7 @@ bool wallet2::light_wallet_get_address_info(tools::COMMAND_RPC_GET_ADDRESS_INFO:
+   tools::COMMAND_RPC_GET_ADDRESS_INFO::request request;
+   
+   request.address = get_account().get_public_address_str(m_nettype);
+-  request.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++  request.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+   m_daemon_rpc_mutex.lock();
+   bool r = invoke_http_json("/get_address_info", request, response, rpc_timeout, "POST");
+   m_daemon_rpc_mutex.unlock();
+@@ -10290,7 +10290,7 @@ void wallet2::light_wallet_get_address_txs()
+   tools::COMMAND_RPC_GET_ADDRESS_TXS::response ires;
+   
+   ireq.address = get_account().get_public_address_str(m_nettype);
+-  ireq.view_key = string_tools::pod_to_hex(get_account().get_keys().m_view_secret_key);
++  ireq.view_key = string_tools::pod_to_hex(unwrap(unwrap(get_account().get_keys().m_view_secret_key)));
+   m_daemon_rpc_mutex.lock();
+   bool r = invoke_http_json("/get_address_txs", ireq, ires, rpc_timeout, "POST");
+   m_daemon_rpc_mutex.unlock();
+@@ -10520,7 +10520,7 @@ bool wallet2::light_wallet_key_image_is_ours(const crypto::key_image& key_image,
+   const account_keys& ack = get_account().get_keys();
+   crypto::key_derivation derivation;
+   bool r = crypto::generate_key_derivation(tx_public_key, ack.m_view_secret_key, derivation);
+-  CHECK_AND_ASSERT_MES(r, false, "failed to generate_key_derivation(" << tx_public_key << ", " << ack.m_view_secret_key << ")");
++  CHECK_AND_ASSERT_MES(r, false, "failed to generate_key_derivation(" << tx_public_key << ", " << crypto::secret_key_explicit_print_ref{ack.m_view_secret_key} << ")");
+   r = crypto::derive_public_key(derivation, out_index, ack.m_account_address.m_spend_public_key, in_ephemeral.pub);
+   CHECK_AND_ASSERT_MES(r, false, "failed to derive_public_key (" << derivation << ", " << out_index << ", " << ack.m_account_address.m_spend_public_key << ")");
+@@ -10528,7 +10528,7 @@ bool wallet2::light_wallet_key_image_is_ours(const crypto::key_image& key_image,
+   crypto::derive_secret_key(derivation, out_index, ack.m_spend_secret_key, in_ephemeral.sec);
+   crypto::public_key out_pkey_test;
+   r = crypto::secret_key_to_public_key(in_ephemeral.sec, out_pkey_test);
+-  CHECK_AND_ASSERT_MES(r, false, "failed to secret_key_to_public_key(" << in_ephemeral.sec << ")");
++  CHECK_AND_ASSERT_MES(r, false, "failed to secret_key_to_public_key(" << crypto::secret_key_explicit_print_ref{in_ephemeral.sec} << ")");
+   CHECK_AND_ASSERT_MES(in_ephemeral.pub == out_pkey_test, false, "derived secret key doesn't match derived public key");
+   crypto::generate_key_image(in_ephemeral.pub, in_ephemeral.sec, calculated_key_image);
+diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
+index b1419949f8..3c548de135 100644
+--- a/src/wallet/wallet_rpc_server.cpp
++++ b/src/wallet/wallet_rpc_server.cpp
+@@ -1247,9 +1247,9 @@ namespace tools
+       res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx)));
+       if (req.get_tx_keys)
+       {
+-        res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key));
++        res.tx_key_list.push_back(epee::string_tools::pod_to_hex(unwrap(unwrap(ptx.tx_key))));
+         for (const crypto::secret_key& additional_tx_key : ptx.additional_tx_keys)
+-          res.tx_key_list.back() += epee::string_tools::pod_to_hex(additional_tx_key);
++          res.tx_key_list.back() += epee::string_tools::pod_to_hex(unwrap(unwrap(additional_tx_key)));
+       }
+     }
+diff --git a/tests/benchmark.cpp b/tests/benchmark.cpp
+index 6a845d61a4..660783dd91 100644
+--- a/tests/benchmark.cpp
++++ b/tests/benchmark.cpp
+@@ -109,7 +109,7 @@ namespace
+     template<typename T>
+     bool compare(const T& lhs, const T& rhs) noexcept
+     {
+-        static_assert(!epee::has_padding<T>(), "type might have padding");
++        static_assert(std::is_standard_layout<T>() && alignof(T) == 1, "type might have padding");
+         return std::memcmp(std::addressof(lhs), std::addressof(rhs), sizeof(T)) == 0;
+     }
+diff --git a/tests/core_tests/multisig.cpp b/tests/core_tests/multisig.cpp
+index 966c761163..1d3a6a3a10 100644
+--- a/tests/core_tests/multisig.cpp
++++ b/tests/core_tests/multisig.cpp
+@@ -227,13 +227,13 @@ bool gen_multisig_tx_validation_base::generate_with(std::vector<test_event_entry
+         CHECK_AND_ASSERT_MES(r, false, "Failed to generate multisig export key image");
+       }
+       MDEBUG("Party " << msidx << ":");
+-      MDEBUG("spend: sec " << miner_account[msidx].get_keys().m_spend_secret_key << ", pub " << miner_account[msidx].get_keys().m_account_address.m_spend_public_key);
+-      MDEBUG("view: sec " << miner_account[msidx].get_keys().m_view_secret_key << ", pub " << miner_account[msidx].get_keys().m_account_address.m_view_public_key);
++      MDEBUG("spend: sec " << crypto::secret_key_explicit_print_ref{miner_account[msidx].get_keys().m_spend_secret_key} << ", pub " << miner_account[msidx].get_keys().m_account_address.m_spend_public_key);
++      MDEBUG("view: sec " << crypto::secret_key_explicit_print_ref{miner_account[msidx].get_keys().m_view_secret_key} << ", pub " << miner_account[msidx].get_keys().m_account_address.m_view_public_key);
+       for (const auto &k: miner_account[msidx].get_multisig_keys())
+-        MDEBUG("msk: " << k);
++        MDEBUG("msk: " << crypto::secret_key_explicit_print_ref{k});
+       for (size_t n = 0; n < account_k[msidx][tdidx].size(); ++n)
+       {
+-        MDEBUG("k: " << account_k[msidx][tdidx][n]);
++        MDEBUG("k: " << crypto::secret_key_explicit_print_ref{account_k[msidx][tdidx][n]});
+         MDEBUG("L: " << account_L[msidx][tdidx][n]);
+         MDEBUG("R: " << account_R[msidx][tdidx][n]);
+       }
+@@ -406,7 +406,7 @@ bool gen_multisig_tx_validation_base::generate_with(std::vector<test_event_entry
+       MDEBUG("signing with k " << k.back()[n]);
+     MDEBUG("signing with sk " << skey);
+     for (const auto &sk: used_keys)
+-      MDEBUG("  created with sk " << sk);
++      MDEBUG("  created with sk " << crypto::secret_key_explicit_print_ref{sk});
+     CHECK_AND_ASSERT_MES(signer_tx_builder.next_partial_sign(sig.total_alpha_G, sig.total_alpha_H, k, skey, sig.c_0, sig.s), false, "error: multisig::signing::tx_builder_ringct_t::next_partial_sign");
+     // in round-robin signing, the last signer finalizes the tx
+diff --git a/tests/functional_tests/make_test_signature.cc b/tests/functional_tests/make_test_signature.cc
+index e9dab8bd46..09a3f51c1a 100644
+--- a/tests/functional_tests/make_test_signature.cc
++++ b/tests/functional_tests/make_test_signature.cc
+@@ -48,7 +48,7 @@ int main(int argc, const char **argv)
+     crypto::public_key pkey;
+     crypto::random32_unbiased((unsigned char*)skey.data);
+     crypto::secret_key_to_public_key(skey, pkey);
+-    printf("%s %s\n", epee::string_tools::pod_to_hex(skey).c_str(), epee::string_tools::pod_to_hex(pkey).c_str());
++    printf("%s %s\n", epee::string_tools::pod_to_hex(unwrap(unwrap(skey))).c_str(), epee::string_tools::pod_to_hex(pkey).c_str());
+     return 0;
+   }
+diff --git a/tests/unit_tests/crypto.cpp b/tests/unit_tests/crypto.cpp
+index 7f926534a3..329992463c 100644
+--- a/tests/unit_tests/crypto.cpp
++++ b/tests/unit_tests/crypto.cpp
+@@ -72,10 +72,10 @@ TEST(Crypto, Ostream)
+   EXPECT_TRUE(is_formatted<crypto::hash8>());
+   EXPECT_TRUE(is_formatted<crypto::hash>());
+   EXPECT_TRUE(is_formatted<crypto::public_key>());
+-  EXPECT_TRUE(is_formatted<crypto::secret_key>());
+   EXPECT_TRUE(is_formatted<crypto::signature>());
+   EXPECT_TRUE(is_formatted<crypto::key_derivation>());
+   EXPECT_TRUE(is_formatted<crypto::key_image>());
++  EXPECT_TRUE(is_formatted<rct::key>());
+ }
+ TEST(Crypto, null_keys)
+diff --git a/tests/unit_tests/multisig.cpp b/tests/unit_tests/multisig.cpp
+index 3b3c4197c0..71416aaf33 100644
+--- a/tests/unit_tests/multisig.cpp
++++ b/tests/unit_tests/multisig.cpp
+@@ -80,7 +80,7 @@ static void make_wallet(unsigned int idx, tools::wallet2 &wallet)
+     wallet.generate("", "", spendkey, true, false);
+     ASSERT_TRUE(test_addresses[idx].address == wallet.get_account().get_public_address_str(cryptonote::TESTNET));
+     wallet.decrypt_keys("");
+-    ASSERT_TRUE(test_addresses[idx].spendkey == epee::string_tools::pod_to_hex(wallet.get_account().get_keys().m_spend_secret_key));
++    ASSERT_TRUE(test_addresses[idx].spendkey == epee::string_tools::pod_to_hex(unwrap(unwrap(wallet.get_account().get_keys().m_spend_secret_key))));
+     wallet.encrypt_keys("");
+   }
+   catch (const std::exception &e)
+diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp
+index 0fdd832856..fdf6032722 100644
+--- a/tests/unit_tests/serialization.cpp
++++ b/tests/unit_tests/serialization.cpp
+@@ -1103,7 +1103,7 @@ TEST(Serialization, portability_signed_tx)
+   ASSERT_TRUE(ptx.selected_transfers.front() == 2);
+   // ptx.{key_images, tx_key}
+   ASSERT_TRUE(ptx.key_images == "<6c3cd6af97c4070a7aef9b1344e7463e29c7cd245076fdb65da447a34da3ca76> ");
+-  ASSERT_TRUE(epee::string_tools::pod_to_hex(ptx.tx_key) == "0100000000000000000000000000000000000000000000000000000000000000");
++  ASSERT_TRUE(epee::string_tools::pod_to_hex(unwrap(unwrap(ptx.tx_key))) == "0100000000000000000000000000000000000000000000000000000000000000");
+   // ptx.dests
+   ASSERT_TRUE(ptx.dests.size() == 1);
+   ASSERT_TRUE(ptx.dests[0].amount == 1400000000000);
index d019576c60b26c71001395f4b9071cd94e8bf80d..a431e3af5a9bc81e133848dfb387dced89812674 100644 (file)
@@ -4,5 +4,161 @@
 # See 'monerod --help' for all available options.
 
 data-dir=/var/lib/monero
-log-file=/var/log/monero/monero.log
-log-level=0
+#prune-blockchain=1
+
+## for p2pool
+zmq-pub=tcp://<private ip>:18083
+zmq-rpc-bind-ip=<private ip>
+
+## p2p settings
+p2p-bind-ip=0.0.0.0                             # Interface for p2p network protocol (IPv4)
+p2p-bind-port=18080                             # Port for p2p network protocol (IPv4)
+p2p-external-port=18080                         # External port for p2p network protocol (if port forwarding used with NAT)
+p2p-bind-ipv6-address=::                        # Interface for p2p network protocol (IPv6)
+p2p-bind-port-ipv6=18080                        # Port for p2p network protocol (IPv6)
+p2p-use-ipv6=1                                  # Enable IPv6 for p2p
+public-node=1                                   # Advertises the RPC-restricted port over p2p peer lists
+
+## rpc settings
+rpc-bind-ip=<private ip>                                          # Specify IP to bind RPC server
+rpc-bind-port=18081                                             # Port for RPC server               
+rpc-restricted-bind-ip=0.0.0.0                                  # Specify IP to bind restricted RPC server
+rpc-restricted-bind-port=18089                                  # Port for restricted RPC server
+rpc-bind-ipv6-address=<private/firewalled ipv6 addr>                   # Specify IPv6 address to bind RPC server
+rpc-restricted-bind-ipv6-address=::                             # Specify IPv6 address to bind restricted RPC server
+rpc-use-ipv6=1                                                  # Allow IPv6 for RPC
+confirm-external-bind=1                                         # Confirm rpc-bind-ip value when NOT a loopback IP
+
+## logging
+log-file=/dev/null                                                             # See /etc/conf.d/monerod for details
+#log-level=0,stacktrace:FATAL                    # Specify log level (& only log fatal stacktraces)
+max-log-file-size=104857600                     # Specify maximum log file size [B] (100M)
+max-log-files=5                                 # Specify maximum log file count
+
+## misc
+max-concurrency=2                               # Specify nproc threads for a parallel jobs
+prep-blocks-threads=2                           # Max number of threads to use preparing block hashes
+fast-block-sync=1                               # Sync up most of the way by using embedded, known block hashes.
+no-igd=1                                        # Disable UPnP port mapping
+
+## from the p2pool page
+add-priority-node=nodes.hashvault.pro:18080
+add-priority-node=p2pmd.xmrvsbeast.com:18080
+disable-dns-checkpoints=1
+enable-dns-blocklist=1
+out-peers=32
+in-peers=64
+
+limit-rate-up=4096                               # set limit-rate-up [kB/s]
+limit-rate-down=12288                            # set limit-rate-down [kB/s]
+
+
+
+#All Settings:
+#  --log-file arg                                               Specify log file
+#  --log-level arg                                              
+#  --max-log-file-size arg (=104850000)  Specify maximum log file size [B]
+#  --max-log-files arg (=50)             Specify maximum number of rotated log files to be saved (no limit by setting to 0)
+#  --max-concurrency arg (=0)            Max number of threads to use for a parallel job 
+#  --public-node                         Allow other users to use the node as a remote (restricted RPC mode, view-only commands) and advertise it over P2P
+#  --zmq-rpc-bind-ip arg (=127.0.0.1)    IP for ZMQ RPC server to listen on
+#  --zmq-rpc-bind-port arg                              Port for ZMQ RPC server to listen on
+#  --zmq-pub arg                         Address for ZMQ pub - tcp://ip:port or ipc://path
+#  --no-zmq                              Disable ZMQ RPC server
+#  --data-dir arg                                               Specify data directory
+#  --test-drop-download                  For net tests: in download, discard ALL blocks instead checking/saving them (very fast)
+#  --test-drop-download-height arg (=0)  Like test-drop-download but discards only after around certain height  
+#  --testnet                             Run on testnet. The wallet must be launched with --testnet flag.  
+#  --stagenet                            Run on stagenet. The wallet must be launched with --stagenet flag.
+#  --regtest                             Run in a regression testing mode.
+#  --keep-fakechain                      Don't delete any existing database when in fakechain mode.
+#  --fixed-difficulty arg (=0)           Fixed difficulty used for testing.
+#  --enforce-dns-checkpointing           checkpoints from DNS server will be enforced
+#  --prep-blocks-threads arg (=4)        Max number of threads to use when preparing block hashes in groups.
+#  --fast-block-sync arg (=1)            Sync up most of the way by using embedded, known block hashes.
+#  --show-time-stats arg (=0)            Show time-stats when processing blocks/txs and disk synchronization.   
+#  --block-sync-size arg (=0)            How many blocks to sync at once during chain synchronization (0 = adaptive).
+#  --check-updates arg (=notify)         Check for new versions of monero: [disabled|notify|download|update]
+#  --fluffy-blocks                       Relay blocks as fluffy blocks (obsolete, now default)
+#  --no-fluffy-blocks                    Relay blocks as normal blocks
+#  --test-dbg-lock-sleep arg (=0)        Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests.
+#  --offline                             Do not listen for peers, nor connect to any
+#  --disable-dns-checkpoints             Do not retrieve checkpoints from DNS 
+#  --block-download-max-size arg (=0)    Set maximum size of block download queue in bytes (0 for default)
+#  --sync-pruned-blocks                  Allow syncing from nodes with only pruned blocks
+#  --max-txpool-weight arg (=648000000)  Set maximum txpool weight in bytes.
+#  --block-notify arg                    Run a program for each new block, '%s' will be replaced by the block hash
+#  --prune-blockchain                    Prune blockchain
+#  --reorg-notify arg                    Run a program for each reorg, '%s' will be replaced by the split height, '%h' will be replaced by the new blockchain height, 
+#                                        '%n' will be replaced by the number of new blocks in the new chain, and '%d' will be replaced by the number of blocks discarded from the old chain
+#  --block-rate-notify arg               Run a program when the block rate undergoes large fluctuations. This might be a sign of large amounts of hash rate going on and off the Monero 
+#                                        network, and thus be of potential interest in predicting attacks. %t will be replaced by the number of minutes for the observation window, %b by the 
+#                                        number of blocks observed within that window, and %e by the number of blocks that was expected in that window. It is suggested that this notification is 
+#                                        used to automatically increase the number of confirmations required before a payment is acted upon.
+#  --keep-alt-blocks                     Keep alternative blocks on restart
+#  --extra-messages-file arg             Specify file for extra messages to include into coinbase transactions
+#  --start-mining arg                    Specify wallet address to mining for
+#  --mining-threads arg                  Specify mining threads count
+#  --bg-mining-enable                    enable background mining
+#  --bg-mining-ignore-battery            if true, assumes plugged in when unable to query system power status
+#  --bg-mining-min-idle-interval arg     Specify min lookback interval in seconds for determining idle state
+#  --bg-mining-idle-threshold arg        Specify minimum avg idle percentage over lookback interval
+#  --bg-mining-miner-target arg          Specify maximum percentage cpu use by miner(s)
+#  --db-sync-mode arg                                   Specify sync option, using format [safe|fast|fastest]:[sync|async]:[<nblocks_per_sync>[blocks]|<nbytes_per_sync>[bytes]].
+#  --db-salvage                          Try to salvage a blockchain database if it seems corrupted
+#  --p2p-bind-ip arg (=0.0.0.0)          Interface for p2p network protocol (IPv4)
+#  --p2p-bind-ipv6-address arg (=::)     Interface for p2p network protocol (IPv6)
+#  --p2p-bind-port arg                          Port for p2p network protocol (IPv4)
+#  --p2p-bind-port-ipv6 arg                     Port for p2p network protocol (IPv6)
+#  --p2p-use-ipv6                        Enable IPv6 for p2p
+#  --p2p-ignore-ipv4                     Ignore unsuccessful IPv4 bind for p2p
+#  --p2p-external-port arg (=0)          External port for p2p network protocol (if port forwarding used with NAT)
+#  --allow-local-ip                      Allow local ip add to peer list, mostly in debug purposes
+#  --add-peer arg                        Manually add peer to local peerlist
+#  --add-priority-node arg               Specify list of peers to connect to and attempt to keep the connection open
+#  --add-exclusive-node arg              Specify list of peers to connect to only. If this option is given the options add-priority-node and seed-node are ignored
+#  --seed-node arg                       Connect to a node to retrieve peer addresses, and disconnect
+#  --tx-proxy arg                        Send local txes through proxy: <network-type>,<socks-ip:port>[,max_connections][,disable_noise] i.e. "tor,127.0.0.1:9050,100,disable_noise"
+#  --anonymous-inbound arg               <hidden-service-address>,<[bind-ip:]port>[,max_connections] i.e. "x.onion,127.0.0.1:18083,100"
+#  --ban-list arg                        Specify ban list file, one IP address per line
+#  --hide-my-port                        Do not announce yourself as peerlist candidate
+#  --no-sync                             Don't synchronize the blockchain with other peers
+#  --enable-dns-blocklist                Apply realtime blocklist from DNS
+#  --no-igd                              Disable UPnP port mapping
+#  --igd arg (=delayed)                  UPnP port mapping (disabled, enabled, delayed)
+#  --out-peers arg (=-1)                 set max number of out peers
+#  --in-peers arg (=-1)                  set max number of in peers
+#  --tos-flag arg (=-1)                  set TOS flag
+#  --limit-rate-up arg (=2048)           set limit-rate-up [kB/s]
+#  --limit-rate-down arg (=8192)         set limit-rate-down [kB/s]
+#  --limit-rate arg (=-1)                set limit-rate [kB/s]
+#  --pad-transactions                    Pad relayed transactions to help defend against traffic volume analysis
+#  --rpc-bind-port arg                                          Port for RPC server
+#  --rpc-restricted-bind-port arg        Port for restricted RPC server
+#  --restricted-rpc                      Restrict RPC to view only commands and do not return privacy sensitive data in RPC calls
+#  --bootstrap-daemon-address arg        URL of a 'bootstrap' remote daemon that the connected wallets can use while this daemon is still not fully synced.
+#                                        Use 'auto' to enable automatic public nodes discovering and bootstrap daemon switching
+#  --bootstrap-daemon-login arg          Specify username:password for the bootstrap daemon login
+#  --rpc-bind-ip arg (=127.0.0.1)        Specify IP to bind RPC server
+#  --rpc-bind-ipv6-address arg (=::1)    Specify IPv6 address to bind RPC server
+#  --rpc-restricted-bind-ip arg                 Specify IP to bind restricted RPC server
+#  --rpc-restricted-bind-ipv6-address    Specify IPv6 address to bind restricted RPC server
+#  --rpc-use-ipv6                        Allow IPv6 for RPC
+#  --rpc-ignore-ipv4                     Ignore unsuccessful IPv4 bind for RPC
+#  --rpc-login arg                       Specify username[:password] required for RPC server
+#  --confirm-external-bind               Confirm rpc-bind-ip value is NOT a loopback (local) IP
+#  --rpc-access-control-origins arg      Specify a comma separated list of origins to allow cross origin resource sharing
+#  --rpc-ssl arg (=autodetect)           Enable SSL on RPC connections: enabled|disabled|autodetect
+#  --rpc-ssl-private-key arg             Path to a PEM format private key
+#  --rpc-ssl-certificate arg             Path to a PEM format certificate
+#  --rpc-ssl-ca-certificates arg         Path to file containing concatenated PEM format certificate(s) to replace system CA(s).
+#  --rpc-ssl-allowed-fingerprints arg    List of certificate fingerprints to allow
+#  --rpc-ssl-allow-chained               Allow user (via --rpc-ssl-certificates) chain certificates
+#  --disable-rpc-ban                     Do not ban hosts on RPC errors
+#  --rpc-ssl-allow-any-cert              Allow any peer certificate
+#  --rpc-payment-address arg             Restrict RPC to clients sending micropayment to this address
+#  --rpc-payment-difficulty arg (=1000)  Restrict RPC to clients sending micropayment at this difficulty
+#  --rpc-payment-credits arg (=100)      Restrict RPC to clients sending micropayment, yields that many credits per payment
+#  --rpc-payment-allow-free-loopback     Allow free access from the loopback address (ie, the local host)
+
+
index 94515dcc254ef3ab6a262e866aedb035d838570d..ba747c76f7b780672e9116f6856f4d3300ac8d32 100644 (file)
@@ -1,6 +1,12 @@
 # Copyright 2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-monerod_args="--config-file /etc/monero/monerod.conf --non-interactive"
+
+MONEROD_CONFIG="/etc/monero/monerod.conf"
+monerod_args="--config-file ${MONEROD_CONFIG} --non-interactive"
 monerod_user=monero
 monerod_group=monero
+
+## We can use the coloured output from monerod to populate monerod.log and monerod_err.log instead of the default logfile as specified in /etc/monero/monerod.conf
+output_log="/var/log/monero/monerod.log"
+error_log="/var/log/monero/monerod_err.log"
index c94e6ff46fcf5748df480f26d7be9f3f7e8b4d1e..ce7796d48a7d42926090ab0eabaa591ff90647b2 100644 (file)
@@ -5,7 +5,10 @@
 pidfile=/var/run/monerod.pid
 command=/usr/bin/monerod
 command_args="${monerod_args}"
-start_stop_daemon_args="-u ${monerod_user} -b -m -p ${pidfile}"
+supervisor=supervise-daemon
+command_user="${monerod_user}:${monerod_group}"
+respawn_max="3"
+respawn_period="40"
 
 name="Monero P2P Daemon"
 description="Connects to the Monero P2P network"
@@ -16,6 +19,22 @@ depend() {
 }
 
 start_pre() {
-    checkpath --directory --owner ${monerod_user}:${monerod_group} --mode 0755 \
-             /var/lib/monero /var/log/monero
+       #set the defaults
+    data_dir="/var/lib/monero"
+    log_file="/var/log/monero/monero.log"
+       #attempt to update defaults from $MONEROD_CONFIG
+    grep -q "^data-dir=" "${MONEROD_CONFIG}" && data_dir=$(awk '/^data-dir=/{print$1}' "${MONEROD_CONFIG}"|sed 's/data-dir=//')
+    grep -q "^log-file=" "${MONEROD_CONFIG}" && log_file=$(awk '/^log-file=/{print$1}' "${MONEROD_CONFIG}"|sed 's/log-file=//')
+    checkpath -o ${monerod_user}:${monerod_group} -d ${data_dir}
+
+       if [ -c "${log_file}" ] ;then
+               checkpath -d $(dirname "${output_log}")
+               checkpath -d $(dirname "${error_log}")
+               checkpath -o ${monerod_user}:${monerod_group} -f "${output_log}"
+               checkpath -o ${monerod_user}:${monerod_group} -f "${error_log}"
+       else
+               checkpath -d $(dirname "${log_file}")
+       checkpath -o ${monerod_user}:${monerod_group} -f "${log_file}"
+       fi
+
 }
index 45b9047d227eeb1891a1da7948d4ddf00bc64257..29d5abe636084c6770b82bdbe86875b9cc2d2afc 100644 (file)
@@ -1,13 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
   <maintainer type="person">
-    <email>telans@posteo.de</email>
-    <name>James Beddek</name>
-  </maintainer>
-  <maintainer type="person">
-    <email>cantcuckthis@danwin1210.de</email>
-    <name>Dex Conner</name>
+    <email>efe.izbudak@metu.edu.tr</email>
+    <name>Efe Ä°zbudak</name>
   </maintainer>
   <longdescription lang="en">
     Monero is a private, secure, untraceable, decentralised digital
@@ -18,6 +14,9 @@
     <flag name="daemon">
       Build the Monero daemon used to connect to the P2P network.
     </flag>
+    <flag name="hw-wallet">
+      Enable Trezor hardware wallet support.
+    </flag>
     <flag name="tools">
       Build tools used to manipulate the blockchain as it is stored on
       disk.
diff --git a/net-p2p/monero/monero-0.17.2.0.ebuild b/net-p2p/monero/monero-0.17.2.0.ebuild
deleted file mode 100644 (file)
index 2dc4118..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake systemd
-
-DESCRIPTION="The secure, private, untraceable cryptocurrency"
-HOMEPAGE="https://github.com/monero-project/monero"
-
-if [[ ${PV} == 9999 ]]; then
-       inherit git-r3
-       EGIT_REPO_URI="https://github.com/monero-project/monero.git"
-       EGIT_SUBMODULES=()
-else
-       SRC_URI="https://github.com/monero-project/monero/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~x86"
-fi
-
-LICENSE="BSD MIT"
-SLOT="0"
-IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
-REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
-RESTRICT="test"
-
-DEPEND="
-       acct-group/monero
-       acct-user/monero
-       dev-libs/boost:=[nls]
-       dev-libs/libsodium:=
-       dev-libs/openssl:=
-       dev-libs/randomx
-       dev-libs/rapidjson
-       dev-libs/supercop
-       net-dns/unbound:=[threads]
-       net-libs/czmq:=
-       net-libs/miniupnpc
-       readline? ( sys-libs/readline:0= )
-"
-RDEPEND="${DEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-       "${FILESDIR}/${PN}-0.17.1.7-unbundle-dependencies.patch"
-       "${FILESDIR}/${PN}-0.17.2.0-boost-176.patch"
-)
-
-src_configure() {
-       local mycmakeargs=(
-               # TODO: Update CMake to install built libraries (help wanted)
-               -DBUILD_SHARED_LIBS=OFF
-               -DMANUAL_SUBMODULES=ON
-               -DMONERO_PARALLEL_LINK_JOBS=1
-               -DUSE_DEVICE_TREZOR=OFF
-       )
-
-       cmake_src_configure
-}
-
-src_compile() {
-       local targets=()
-       use daemon && targets+=(daemon)
-       use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
-       use wallet-cli && targets+=(simplewallet)
-       use wallet-rpc && targets+=(wallet_rpc_server)
-       cmake_build ${targets[@]}
-}
-
-src_install() {
-       einstalldocs
-
-       # Install all binaries.
-       find "${BUILD_DIR}/bin/" -type f -executable -print0 |
-               while IFS= read -r -d '' line; do
-                       dobin "$line"
-               done
-
-       if use daemon; then
-               dodoc utils/conf/monerod.conf
-
-               # data-dir
-               keepdir /var/lib/monero
-               fowners monero:monero /var/lib/monero
-               fperms 0755 /var/lib/monero
-
-               # log-file dir
-               keepdir /var/log/monero
-               fowners monero:monero /var/log/monero
-               fperms 0755 /var/log/monero
-
-               # /etc/monero/monerod.conf
-               insinto /etc/monero
-               doins "${FILESDIR}/monerod.conf"
-
-               # OpenRC
-               newconfd "${FILESDIR}/monerod.confd" monerod
-               newinitd "${FILESDIR}/monerod.initd" monerod
-
-               # systemd
-               systemd_dounit "${FILESDIR}/monerod.service"
-       fi
-}
-
-pkg_postinst() {
-       if use daemon; then
-               elog "Start the Monero P2P daemon as a system service with"
-               elog "'rc-service monerod start'. Enable it at startup with"
-               elog "'rc-update add monerod default'."
-               elog
-               elog "Run monerod status as any user to get sync status and other stats."
-               elog
-               elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
-               elog "in /var/lib/monero by default. You may want to enable pruning by adding"
-               elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
-               elog "or move the data directory to another disk."
-       fi
-}
diff --git a/net-p2p/monero/monero-0.17.2.3.ebuild b/net-p2p/monero/monero-0.17.2.3.ebuild
deleted file mode 100644 (file)
index 2dc4118..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake systemd
-
-DESCRIPTION="The secure, private, untraceable cryptocurrency"
-HOMEPAGE="https://github.com/monero-project/monero"
-
-if [[ ${PV} == 9999 ]]; then
-       inherit git-r3
-       EGIT_REPO_URI="https://github.com/monero-project/monero.git"
-       EGIT_SUBMODULES=()
-else
-       SRC_URI="https://github.com/monero-project/monero/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~x86"
-fi
-
-LICENSE="BSD MIT"
-SLOT="0"
-IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
-REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
-RESTRICT="test"
-
-DEPEND="
-       acct-group/monero
-       acct-user/monero
-       dev-libs/boost:=[nls]
-       dev-libs/libsodium:=
-       dev-libs/openssl:=
-       dev-libs/randomx
-       dev-libs/rapidjson
-       dev-libs/supercop
-       net-dns/unbound:=[threads]
-       net-libs/czmq:=
-       net-libs/miniupnpc
-       readline? ( sys-libs/readline:0= )
-"
-RDEPEND="${DEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-       "${FILESDIR}/${PN}-0.17.1.7-unbundle-dependencies.patch"
-       "${FILESDIR}/${PN}-0.17.2.0-boost-176.patch"
-)
-
-src_configure() {
-       local mycmakeargs=(
-               # TODO: Update CMake to install built libraries (help wanted)
-               -DBUILD_SHARED_LIBS=OFF
-               -DMANUAL_SUBMODULES=ON
-               -DMONERO_PARALLEL_LINK_JOBS=1
-               -DUSE_DEVICE_TREZOR=OFF
-       )
-
-       cmake_src_configure
-}
-
-src_compile() {
-       local targets=()
-       use daemon && targets+=(daemon)
-       use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
-       use wallet-cli && targets+=(simplewallet)
-       use wallet-rpc && targets+=(wallet_rpc_server)
-       cmake_build ${targets[@]}
-}
-
-src_install() {
-       einstalldocs
-
-       # Install all binaries.
-       find "${BUILD_DIR}/bin/" -type f -executable -print0 |
-               while IFS= read -r -d '' line; do
-                       dobin "$line"
-               done
-
-       if use daemon; then
-               dodoc utils/conf/monerod.conf
-
-               # data-dir
-               keepdir /var/lib/monero
-               fowners monero:monero /var/lib/monero
-               fperms 0755 /var/lib/monero
-
-               # log-file dir
-               keepdir /var/log/monero
-               fowners monero:monero /var/log/monero
-               fperms 0755 /var/log/monero
-
-               # /etc/monero/monerod.conf
-               insinto /etc/monero
-               doins "${FILESDIR}/monerod.conf"
-
-               # OpenRC
-               newconfd "${FILESDIR}/monerod.confd" monerod
-               newinitd "${FILESDIR}/monerod.initd" monerod
-
-               # systemd
-               systemd_dounit "${FILESDIR}/monerod.service"
-       fi
-}
-
-pkg_postinst() {
-       if use daemon; then
-               elog "Start the Monero P2P daemon as a system service with"
-               elog "'rc-service monerod start'. Enable it at startup with"
-               elog "'rc-update add monerod default'."
-               elog
-               elog "Run monerod status as any user to get sync status and other stats."
-               elog
-               elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
-               elog "in /var/lib/monero by default. You may want to enable pruning by adding"
-               elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
-               elog "or move the data directory to another disk."
-       fi
-}
diff --git a/net-p2p/monero/monero-0.17.3.0.ebuild b/net-p2p/monero/monero-0.17.3.0.ebuild
deleted file mode 100644 (file)
index 656c93e..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake systemd
-
-DESCRIPTION="The secure, private, untraceable cryptocurrency"
-HOMEPAGE="https://github.com/monero-project/monero"
-
-if [[ ${PV} == 9999 ]]; then
-       inherit git-r3
-       EGIT_REPO_URI="https://github.com/monero-project/monero.git"
-       EGIT_SUBMODULES=()
-else
-       SRC_URI="https://github.com/monero-project/monero/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~x86"
-fi
-
-LICENSE="BSD MIT"
-SLOT="0"
-IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
-REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
-RESTRICT="test"
-
-DEPEND="
-       acct-group/monero
-       acct-user/monero
-       dev-libs/boost:=[nls]
-       dev-libs/libsodium:=
-       dev-libs/openssl:=
-       dev-libs/randomx
-       dev-libs/rapidjson
-       dev-libs/supercop
-       net-dns/unbound:=[threads]
-       net-libs/czmq:=
-       net-libs/miniupnpc
-       readline? ( sys-libs/readline:0= )
-"
-RDEPEND="${DEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-       "${FILESDIR}/${PN}-0.17.3.0-unbundle-dependencies.patch"
-)
-
-src_configure() {
-       local mycmakeargs=(
-               # TODO: Update CMake to install built libraries (help wanted)
-               -DBUILD_SHARED_LIBS=OFF
-               -DMANUAL_SUBMODULES=ON
-               -DUSE_DEVICE_TREZOR=OFF
-       )
-
-       cmake_src_configure
-}
-
-src_compile() {
-       local targets=()
-       use daemon && targets+=(daemon)
-       use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
-       use wallet-cli && targets+=(simplewallet)
-       use wallet-rpc && targets+=(wallet_rpc_server)
-       cmake_build ${targets[@]}
-}
-
-src_install() {
-       einstalldocs
-
-       # Install all binaries.
-       find "${BUILD_DIR}/bin/" -type f -executable -print0 |
-               while IFS= read -r -d '' line; do
-                       dobin "$line"
-               done
-
-       if use daemon; then
-               dodoc utils/conf/monerod.conf
-
-               # data-dir
-               keepdir /var/lib/monero
-               fowners monero:monero /var/lib/monero
-               fperms 0755 /var/lib/monero
-
-               # log-file dir
-               keepdir /var/log/monero
-               fowners monero:monero /var/log/monero
-               fperms 0755 /var/log/monero
-
-               # /etc/monero/monerod.conf
-               insinto /etc/monero
-               doins "${FILESDIR}/monerod.conf"
-
-               # OpenRC
-               newconfd "${FILESDIR}/monerod.confd" monerod
-               newinitd "${FILESDIR}/monerod.initd" monerod
-
-               # systemd
-               systemd_dounit "${FILESDIR}/monerod.service"
-       fi
-}
-
-pkg_postinst() {
-       if use daemon; then
-               elog "Start the Monero P2P daemon as a system service with"
-               elog "'rc-service monerod start'. Enable it at startup with"
-               elog "'rc-update add monerod default'."
-               elog
-               elog "Run monerod status as any user to get sync status and other stats."
-               elog
-               elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
-               elog "in /var/lib/monero by default. You may want to enable pruning by adding"
-               elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
-               elog "or move the data directory to another disk."
-       fi
-}
similarity index 83%
rename from net-p2p/monero/monero-0.17.3.2.ebuild
rename to net-p2p/monero/monero-0.18.3.4-r1.ebuild
index a3816f142d884d43b3c17a8b68f84043a1310941..239eec451daa85e908e6e6f658bf01badeb2534d 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit cmake systemd
 
@@ -19,14 +19,14 @@ fi
 
 LICENSE="BSD MIT"
 SLOT="0"
-IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
+IUSE="+daemon hw-wallet readline +tools +wallet-cli +wallet-rpc"
 REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
 RESTRICT="test"
 
 DEPEND="
        acct-group/monero
        acct-user/monero
-       dev-libs/boost:=[nls]
+       <dev-libs/boost-1.87:=[nls]
        dev-libs/libsodium:=
        dev-libs/openssl:=
        dev-libs/randomx
@@ -34,14 +34,21 @@ DEPEND="
        dev-libs/supercop
        net-dns/unbound:=[threads]
        net-libs/czmq:=
-       net-libs/miniupnpc
+       net-libs/miniupnpc:=
        readline? ( sys-libs/readline:0= )
+       hw-wallet? (
+               dev-libs/hidapi
+               dev-libs/protobuf:=
+               virtual/libusb:1
+       )
 "
 RDEPEND="${DEPEND}"
 BDEPEND="virtual/pkgconfig"
 
 PATCHES=(
-       "${FILESDIR}/${PN}-0.17.3.0-unbundle-dependencies.patch"
+       "${FILESDIR}/${PN}-0.18.3.3-unbundle-dependencies.patch"
+       "${FILESDIR}/${PN}-0.18.3.3-miniupnp-api-18.patch"
+       "${FILESDIR}/${PN}-0.18.3.4-boost-1.85.patch"
 )
 
 src_configure() {
@@ -49,7 +56,7 @@ src_configure() {
                # TODO: Update CMake to install built libraries (help wanted)
                -DBUILD_SHARED_LIBS=OFF
                -DMANUAL_SUBMODULES=ON
-               -DUSE_DEVICE_TREZOR=OFF
+               -DUSE_DEVICE_TREZOR=$(usex hw-wallet ON OFF)
        )
 
        use elibc_musl && mycmakeargs+=( -DSTACK_TRACE=OFF )
@@ -109,7 +116,7 @@ pkg_postinst() {
                elog
                elog "Run monerod status as any user to get sync status and other stats."
                elog
-               elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
+               elog "The Monero blockchain can take up a lot of space (200 GiB) and is stored"
                elog "in /var/lib/monero by default. You may want to enable pruning by adding"
                elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
                elog "or move the data directory to another disk."
diff --git a/net-p2p/monero/monero-9999.ebuild b/net-p2p/monero/monero-9999.ebuild
deleted file mode 100644 (file)
index b178a49..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake systemd
-
-DESCRIPTION="The secure, private, untraceable cryptocurrency"
-HOMEPAGE="https://github.com/monero-project/monero"
-
-if [[ ${PV} == 9999 ]]; then
-       inherit git-r3
-       EGIT_REPO_URI="https://github.com/monero-project/monero.git"
-       EGIT_SUBMODULES=()
-else
-       SRC_URI="https://github.com/monero-project/monero/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~x86"
-fi
-
-LICENSE="BSD MIT"
-SLOT="0"
-IUSE="+daemon readline +tools +wallet-cli +wallet-rpc"
-REQUIRED_USE="|| ( daemon tools wallet-cli wallet-rpc )"
-RESTRICT="test"
-
-DEPEND="
-       acct-group/monero
-       acct-user/monero
-       dev-libs/boost:=[nls]
-       dev-libs/libsodium:=
-       dev-libs/openssl:=
-       dev-libs/randomx
-       dev-libs/rapidjson
-       dev-libs/supercop
-       net-dns/unbound:=[threads]
-       net-libs/czmq:=
-       net-libs/miniupnpc
-       readline? ( sys-libs/readline:0= )
-"
-RDEPEND="${DEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=( "${FILESDIR}/${PN}-0.17.1.7-unbundle-dependencies.patch" )
-
-src_configure() {
-       local mycmakeargs=(
-               # TODO: Update CMake to install built libraries (help wanted)
-               -DBUILD_SHARED_LIBS=OFF
-               -DMANUAL_SUBMODULES=ON
-               -DMONERO_PARALLEL_LINK_JOBS=1
-               -DUSE_DEVICE_TREZOR=OFF
-       )
-
-       cmake_src_configure
-}
-
-src_compile() {
-       local targets=()
-       use daemon && targets+=(daemon)
-       use tools && targets+=(blockchain_{ancestry,blackball,db,depth,export,import,prune,prune_known_spent_data,stats,usage})
-       use wallet-cli && targets+=(simplewallet)
-       use wallet-rpc && targets+=(wallet_rpc_server)
-       cmake_build ${targets[@]}
-}
-
-src_install() {
-       einstalldocs
-
-       # Install all binaries.
-       find "${BUILD_DIR}/bin/" -type f -executable -print0 |
-               while IFS= read -r -d '' line; do
-                       dobin "$line"
-               done
-
-       if use daemon; then
-               dodoc utils/conf/monerod.conf
-
-               # data-dir
-               keepdir /var/lib/monero
-               fowners monero:monero /var/lib/monero
-               fperms 0755 /var/lib/monero
-
-               # log-file dir
-               keepdir /var/log/monero
-               fowners monero:monero /var/log/monero
-               fperms 0755 /var/log/monero
-
-               # /etc/monero/monerod.conf
-               insinto /etc/monero
-               doins "${FILESDIR}/monerod.conf"
-
-               # OpenRC
-               newconfd "${FILESDIR}/monerod.confd" monerod
-               newinitd "${FILESDIR}/monerod.initd" monerod
-
-               # systemd
-               systemd_dounit "${FILESDIR}/monerod.service"
-       fi
-}
-
-pkg_postinst() {
-       if use daemon; then
-               elog "Start the Monero P2P daemon as a system service with"
-               elog "'rc-service monerod start'. Enable it at startup with"
-               elog "'rc-update add monerod default'."
-               elog
-               elog "Run monerod status as any user to get sync status and other stats."
-               elog
-               elog "The Monero blockchain can take up a lot of space (80 GiB) and is stored"
-               elog "in /var/lib/monero by default. You may want to enable pruning by adding"
-               elog "'prune-blockchain=1' to /etc/monero/monerod.conf to prune the blockchain"
-               elog "or move the data directory to another disk."
-       fi
-}
diff --git a/net-p2p/p2pool/Manifest b/net-p2p/p2pool/Manifest
new file mode 100644 (file)
index 0000000..2a6ef1c
--- /dev/null
@@ -0,0 +1,4 @@
+DIST p2pool-4.1.1.tar.xz 129219228 BLAKE2B b6ceebcb497b928dd61f9c85086295b674216afa24b6c74a4a60695a2fb72201c5544fe4d1904d3c3fd2f9e2d49a54db836946afc6dfeae8a457450c1ac177eb SHA512 d9e87336ed5b7aee7dc6dd4761dd1ea4a7afc5901985404976ebd442155a16fe3b09e6b6133c8f617c0dce073fd6d7dff98d535032338633a4a452d99410e0c9
+DIST p2pool-4.1.1_shasums.asc 2021 BLAKE2B 6bf7bf3c4c1681944ee4296ca079111e2536a35ded2d39c741f6b2a15f36fe5b9de12e846fb4ce07f7d4fc17ef6c216c6d36ea1a6bb08828c45ccff9f0834467 SHA512 8a0740614f70725161f15bd179a10cc3597225f3b68b4bc5c2f31dadadd9f9b054062af635bd2a2fa550428fc2147f9729283490cb9d4fbe82d6c0c1202f1992
+DIST p2pool-4.3.tar.xz 121435168 BLAKE2B fe09dbf3239b3a3785dcdcddb768f2ae2cdd8e4c7c4e07c4521c9f03b2eb6755b83ddb4ecc46fc9a2d524e6689be83bebea8dc43667b4f187db61d9aa9671084 SHA512 d3a1d4bd1b757fbdc3f7fd91aaeb457e19ed4f72dc9b6adf2ffb2e2e70916036d08ed19ec5e4b0aa534ebabfe43fba8f6956cd6c408c04b609ad761b985d35e5
+DIST p2pool-4.3_shasums.asc 2007 BLAKE2B f772d5ed9f93ce54d90f1fc168af8e92f18872d1d274bdfadcf3444cc9a0d5e6a97ced411ec4150f819243cd7fbd373a6f9219b746f661e099f61ac21c6f566a SHA512 6e8ebc1cdcd3ad81ccabf29532d788662d89fab089166d038c53d5d5685b864c45bfe92c81cb39a69cea1bdd8f9bf94f69578d64e29cc093af4ccf4108865ea9
diff --git a/net-p2p/p2pool/files/SChernykh.asc b/net-p2p/p2pool/files/SChernykh.asc
new file mode 100644 (file)
index 0000000..e6e61ce
--- /dev/null
@@ -0,0 +1,52 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+
+mQINBGBwYcABEADd2hZKkoLqx3S+HifsDrnETw/9UccXsIo5WYyYLGEdIexc5JQ1
+8NkLyuZb+ilZoZo4TiXBqJBHjqwjbdhDFiQa1SK9XvWZDrY/NW8ZOmM5w5yxDedM
+pgmKZm6vbVP1FtKyRckAkTrci5+ndFu85QfHrOI67fx5YE/byMFO4mSJ6FwigmAu
+9bZiG1GAkIoCOyptHa+SlV2qjbtzaGpXz8HUC+BTrP5BYSUSOrot7EcL0H7LD9qk
+YttlEMAPcT8G/gzOUAcRer1uXYaj8hUSDZI92sT35olId930fM/lTayORs+hh2U+
+gFPnoDnt0HfcHTUT+fHJdf1Q4g69V9UbfsG2V1gp56rbVTjYhwsWlck2TH3OcAXu
+YRaAUtbFv+RKPngumz5ibg11i50Q4xxe7RCGmQO9E4Ufk8WSiEwQcJP2VIj2AvIF
+lMiez+6H2KhepCvI1Khoba60uBxajvuEfvxfP582imclLYK/DGcDr6ZjWpOc1vzb
+IGzDDjrYOUdlJVYUfdfSgx3LspERJ+74QruyZdFoYsZQsXkkC0cgAohFsgwGVjfD
+DCm+spmOZTpB4WGOXO70VLvMtiOXJ8FIyokIdFajAez48aoQdbk3+3vfeRv7JVMI
+neQgx1ko3IIOTXrPXqz1PUdcZGLfQc61IVFXrU726r5caa2xQMMLnifMBQARAQAB
+tCdTQ2hlcm55a2ggPHNlcmdleS52LmNoZXJueWtoQGdtYWlsLmNvbT6JAk4EEwEK
+ADgWIQQfyqtNPcMxDRbL1QjEf4K1Tah63wUCYHBhwAIbAwULCQgHAgYVCgkICwIE
+FgIDAQIeAQIXgAAKCRDEf4K1Tah6301vEADJsuk+Avwn6QQjMYjyYlo99ds4RrON
+lYYts+k8XqqFDj85hYFs1IgV1bn7ooLuIeyE7fEZM8uep6cU7aIZ2V9rL1m0Z3xA
++KMbmhmh9zQJOI9LDG/Ftnx7m5RSweCzccxmAAav4aZCRo1M8Kra2PDI9fe8Y9Ai
+1K34RD5i+BsWJecNAFWtWCKiyv21S86oZYIagLF4DB1XRjpK1btuX/U65MjqaEUX
+/eXuPxWe9QcguMeUySg5ixxkuO/JcmK+p4EvUY5F5b24NvoQexJstHp8iMowI6sz
+lhHdWkrzM0fEUUVWlM+zC7Yqp+96ZVCrv9jsq7u0joVAqVOhxRPAqXOYCWGrLTJk
+N616UbIGSWnRfvqJF20FPRMw1DLZoRW4IgHLUj3v2Ct6vECQzzhksTmddzIx+ZCM
+JWs64DlrriQoKIdE8KqzqIdhLOoEy07qlMc/WpZTc7ysd2i/au1p/mYAGJgw0/hY
+28IslI+c6W0dle3i9vAjU7wgrsTQeo1JZbAioLtQjk4SrWk+4LWBhwemEDV0j+HA
+iN54cqyLRqEwmpRVYcl18zrAQiPvWIb6BEEoeL290eT0TfiF5jZuVmZDTBa0HgCA
+k9QQtft7HT7rdOOlFqMKeqoQVDC+6eyCU8r3SOgzL6UYPiVXRM+lnX053aWEV9Rx
+h+Ib3iznP9/nALkCDQRgcGHAARAA0SiWBr3SjMrvQnbJipnRKQwpoWG8vtyJbvlU
+QEAMJbpy9T3/2u1hAs/cMh2VK1Y7Bn+ZQ51c1nmxVraj5PD0/BSD27MC3aZ6kp6j
+JFbsb63MKk4Y66RQbgDw5JWd9IgDQtc4M3XgC5xcCO7y3rvKgDQxYBpjAwjeOvS3
+03ZVPyivWV2O/43PI9QZ4DHObEfR8M06EeTqwkrsJnAuCtQlW0aCBRII5o/D1w6w
+1IZGfAwdUcVoefLRZC2bRaswA+IoOLvlH/vgirve8VYhJK9Wt+JWaNSb2vWUQXws
+fFmpo89IZcRiHh5WP5A//Jh9RR8f+7FLkGXoJwl7dCEfDZKkI9uZvy21J4tLM9M6
+2ygthkYPuJE/VnCZcM24sWbSMkN/fh4QHNsEXq9PZpimOTtQv0xpu9p4lkes91pg
+vQm8fPoxoMQEMBY/SHFh3X6r8zVL7RUPfOrRxfiYibbSIyRsmY/Mz+M0OilAw7L7
+zKMpX7SWS2M0/mEtUW+Xb4vGxj3YcQ65e3CJx/l9qeGjbi1GJ1D8jshI/k2AqP3C
+2hKSGeLjqtUUJOhOMySkELDdDNkSRUA9qZEW3dLsQOFD424l9RTjPpBSrYTsYxpe
+BRfRCejQ/PZL9VULRQsQZCbtBDrSeKQ0J2Dp5zJl6A+17lUUSv1FBLEeDt6MotAA
+2Mqm96kAEQEAAYkCNgQYAQoAIBYhBB/Kq009wzENFsvVCMR/grVNqHrfBQJgcGHA
+AhsMAAoJEMR/grVNqHrfQF0P/1udspDo+omDz9uWeWod/7shFpuX8CweI7j/4Efk
+cFTc2bQ0zAjqBLiVo67Zncrrikn4gBhQGmcj1kKXdUdFTaKwjfSk0MSA/VIo7vwh
+2iYTrEuYUvTmVoQ5SYg0ekKzwA/9BSow4NZvIL3NC06RNxbyeJ9gBhsWZfUPJ8BS
+wxTCcHQfbI9ZDkgVxI2CZf/DbBdsmqVB+VlDcq8uQj4jpRjTX+xWMRcy5WrfvH1r
+W5JpG7ULyEv5B5ocD3+Gbos0kxQzWoKqCZsu44W+0nPpwDe1CXkjrMmtoRtuNtJc
+mX1+zfjE4Xn4foOiunbpMVNFHahD1n9rk0/4sMQ79GpD1iwOBsMh6wq3gYqh+ycf
+vEOEHH7ERa9ryNWXVDeci6KLRuFI7vDxZez++4uospQ4LZW2n9hiLaj2rJHcYYEM
+x229L5SeRye0YFXX805mwtqcYxmrMitoaSreSKpnOKvF2i0gN/N0JXeHb5P3QQcY
+bocA9ZZvYIEovlpnsPVLtDIwjysI3668mEGDqNEikVqi/9btpYygS6CjTbiB6b3O
+m4sV4vlQtg8u6M863LyLuqaaj9b+vWVZy3K5esiLKaIsIARVqLnBeQDOIqtAFlcG
+AHSiuPpC49NkwV6YJNJw9XP2QknIXpE0fRdoSQune0rKRZgnbj7VOZX6nCkT34EA
+fo0a
+=YlLc
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/net-p2p/p2pool/files/flags.cmake b/net-p2p/p2pool/files/flags.cmake
new file mode 100644 (file)
index 0000000..367863e
--- /dev/null
@@ -0,0 +1,37 @@
+set(GENERAL_FLAGS "-pthread")
+if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
+       
+       if (ARMv8)
+               set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769 -mfix-cortex-a53-843419")
+       endif()
+       
+       set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror")
+       if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.5.0)
+               set(WARNING_FLAGS "${WARNING_FLAGS} -Wstrict-overflow=2")
+       endif()
+       
+       if (STATIC_BINARY)
+               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+       else()
+               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
+       endif()
+       
+elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
+       
+       if (ARMv8)
+               set(GENERAL_FLAGS "${GENERAL_FLAGS} -mfix-cortex-a53-835769")
+       endif()
+       
+       set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal -Wunreachable-code-aggressive -Wmissing-prototypes -Wmissing-variable-declarations -Werror")
+       
+endif()
+
+if (DISABLE_WARNINGS)
+       set(WARNING_FLAGS "-w")
+endif()
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GENERAL_FLAGS} ${WARNING_FLAGS}")
diff --git a/net-p2p/p2pool/files/p2pool.confd b/net-p2p/p2pool/files/p2pool.confd
new file mode 100644 (file)
index 0000000..3763a07
--- /dev/null
@@ -0,0 +1,66 @@
+P2POOL_USR="monero"
+P2POOL_GRP="monero"
+P2POOL_DIR="/var/lib/p2pool" #see --data-dir below
+#Put your detinination wallet below.
+XMR_WALLET=""
+
+# Set output and error log for coloured logfiles
+output_log="/var/log/monero/p2pool.log"
+error_log="/var/log/monero/p2pool_err.log"
+
+# p2pool always logs to $P2POOL_DIR/p2pool.log
+# If P2POOL_LOGFILE is set, the init script will "checkpath" $P2POOL_LOGFILE then forcibly create a symlink at $P2POOL_DIR/p2pool.log pointing to $P2POOL_LOGFILE
+P2POOL_LOGFILE="/dev/null"
+
+# Connect to host/port
+ARGS="--host 10.0.0.254"
+ARGS="${ARGS} --zmq-port 18083"
+
+# Listen on ip:port
+# Enable only one of the below lines
+ARGS="${ARGS} --p2p 0.0.0.0:37889"
+#ARGS="${ARGS} --mini --p2p 0.0.0.0:37888"
+
+# Other config
+ARGS="${ARGS} --wallet ${XMR_WALLET}"
+ARGS="${ARGS} --data-dir ${P2POOL_DIR}"
+
+#CL args for p2pool daemon
+#Usage:
+
+#--wallet             Wallet address to mine to. Subaddresses and integrated addresses are not supported!
+#--host               IP address of your Monero node, default is 127.0.0.1
+#--rpc-port           monerod RPC API port number, default is 18081
+#--zmq-port           monerod ZMQ pub port number, default is 18083 (same port as in monerod's "--zmq-pub" command line parameter)
+#--stratum            Comma-separated list of IP:port for stratum server to listen on
+#--p2p                Comma-separated list of IP:port for p2p server to listen on
+#--addpeers           Comma-separated list of IP:port of other p2pool nodes to connect to
+#--light-mode         Don't allocate RandomX dataset, saves 2GB of RAM
+#--loglevel           Verbosity of the log, integer number between 0 and 6
+#--data-dir           Path to store general p2pool files (log, cache, peer data, etc.), default is current directory
+#--config             Deprecated, will be removed in the next version. Use --sidechain-config instead
+#--sidechain-config   Name of the p2pool sidechain parameters file (only use it if you run your own sidechain)
+#--data-api           Path to the p2pool JSON data (use it in tandem with an external web-server). Not affected by --data-dir setting!
+#--local-api          Enable /local/ path in api path for Stratum Server and built-in miner statistics
+#--stratum-api        An alias for --local-api
+#--no-cache           Disable p2pool.cache
+#--no-color           Disable colors in console output
+#--no-randomx         Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes
+#--out-peers N        Maximum number of outgoing connections for p2p server (any value between 10 and 450)
+#--in-peers N         Maximum number of incoming connections for p2p server (any value between 10 and 450)
+#--start-mining N     Start built-in miner using N threads (any value between 1 and 64)
+#--mini               Connect to p2pool-mini sidechain. Note that it will also change default p2p port from 37889 to 37888
+#--no-autodiff        Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)
+#--rpc-login          Specify username[:password] required for Monero RPC server
+#--socks5             Specify IP:port of a SOCKS5 proxy to use for outgoing connections
+#--no-dns             Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)
+#--p2p-external-port  Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections
+#--no-upnp            Disable UPnP port forwarding
+#--no-igd             An alias for --no-upnp
+#--upnp-stratum       Port forward Stratum port (it's not forwarded by default)
+#--merge-mine         IP:port and wallet address for another blockchain to merge mine with
+#--version            Print p2pool's version and build details
+#--tls-cert file      Load TLS certificate chain from "file" in the PEM format
+#--tls-cert-key file  Load TLS certificate private key from "file" in the PEM format
+#--no-stratum-http    Disable HTTP on Stratum ports
+#--help               Show this help message
diff --git a/net-p2p/p2pool/files/p2pool.initd b/net-p2p/p2pool/files/p2pool.initd
new file mode 100755 (executable)
index 0000000..a77a249
--- /dev/null
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+
+name="P2Pool Daemon"
+description="Connects crypto mining apps to a Monero daemon"
+pidfile="/var/run/p2pool.pid"
+command=/usr/bin/p2pool
+command_args="${ARGS}"
+supervisor=supervise-daemon
+command_user="${P2POOL_USR}:${P2POOL_GRP}"
+directory="${P2POOL_DIR}"
+respawn_max="3"
+respawn_period="40"
+
+depend() {
+    need localmount
+    need net
+    after monerod
+}
+
+start_pre() {
+    checkpath -o ${P2POOL_USR}:${P2POOL_GRP} -d "${directory}"
+    if [ -n "${output_log}" ];then
+               checkpath -d $(dirname "${output_log}")
+       checkpath -o ${P2POOL_USR}:${P2POOL_GRP} -f "${output_log}"
+       fi
+       if [ -n "${error_log}" ];then
+               checkpath -d $(dirname "${error_log}")
+        checkpath -o ${P2POOL_USR}:${P2POOL_GRP} -f "${error_log}"
+       fi
+       if [ -n "${P2POOL_LOGFILE}" ];then
+               checkpath -d $(dirname "${P2POOL_LOGFILE}")
+               if ! ls -l "${directory}/p2pool.log" 2>/dev/null|awk '{print $11}'|grep -q "${P2POOL_LOGFILE}";then
+                       rm "${directory}/p2pool.log" 2>/dev/null
+                       ln -s "${P2POOL_LOGFILE}" "${directory}/p2pool.log"
+               fi
+               [ -c "${P2POOL_LOGFILE}" ] || checkpath -o ${P2POOL_USR}:${P2POOL_GRP} -f "${P2POOL_LOGFILE}"
+       fi
+}
diff --git a/net-p2p/p2pool/metadata.xml b/net-p2p/p2pool/metadata.xml
new file mode 100644 (file)
index 0000000..7fe8cbc
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>adam.pimentel46@gmail.com</email>
+               <name>Adam Pimentel</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">SChernykh/p2pool</remote-id>
+       </upstream>
+</pkgmetadata>
diff --git a/net-p2p/p2pool/p2pool-4.3.ebuild b/net-p2p/p2pool/p2pool-4.3.ebuild
new file mode 100644 (file)
index 0000000..def6ca5
--- /dev/null
@@ -0,0 +1,80 @@
+# Copyright 2022-2024 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"
+
+DEPEND="
+       dev-libs/openssl
+       net-libs/czmq
+       dev-libs/libuv
+       net-misc/curl
+"
+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} "${WORKDIR}"/${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"
+}
+
+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."
+}