From d8791d41b3e07a1fe986da3b2c9be16dcb276bb6 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 2 Mar 2021 21:42:39 +0100 Subject: [PATCH] Update --- README.md | 40 +++++++++++++++++++++++++++++++--------- install.sh | 31 +++++++++++++++++++++++++++++++ scripts/huge_pages.sh | 7 ++----- start-miner.sh | 18 ++++++++++++++++++ xmr-stak-rx/config.txt | 2 +- xmr-stak-rx/pools.txt | 2 +- 6 files changed, 84 insertions(+), 16 deletions(-) create mode 100644 install.sh create mode 100644 start-miner.sh diff --git a/README.md b/README.md index 5a2bfc5..a519ca7 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,8 @@ Dette dokumentet er for å hjelpe meg, men kanskje det kan hjelpe deg også? :) Her finner du statistikk til gruvearbeiderene. - https://xmr.2miners.com/account/8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ - - https://www.f2pool.com/xmr/8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ +* [2Miners](https://xmr.2miners.com/account/8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ) +* [F2Pool](https://www.f2pool.com/xmr/8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ) - Ikke veldig aktiv men noen ganger 'miner' jeg der. # Gruvedrifting @@ -23,16 +22,39 @@ Min konto adresse for innkommende XMR: 8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ -Få bedre ytelse i xmr-stak-rx på Linux: - - https://github.com/fireice-uk/xmr-stak/blob/xmr-stak-rx/doc/tuning.md#huge-page-support - # Installasjon av gruvearbeider Debian Buster/Ubuntu 20.04 +## Automagisk som systemd tjeneste + +Installer curl: + + apt install curl + +Deretter utfør kommando: + + curl -sSL https://git.willy.club/William/monero-miner/raw/branch/master/install.sh | bash + +Sjekk statusen: + + systemctl status monero-miner.service + +## Manuelt uten systemd tjeneste + Installer pakker som trengs: - apt install msr-tools numactl + apt install msr-tools numactl hwloc openssl libmicrohttpd12 git -Jeg legger til mer ting senere \ No newline at end of file +Klon Git repo: + + git clone https://git.willy.club/William/monero-miner monero-miner + cd monero-miner + +Deretter kjør start-miner.sh skriptet: + + bash start-miner.sh + +## Sjekk status + +Gruvearbeideren kjører en webserver på port 42069. Der kan du finne hashrate og mye annet morro. \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..cdf5b57 --- /dev/null +++ b/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +REPOSITORY="https://git.willy.club/William/monero-miner" + +if [[ $EUID -ne 0 ]]; then + echo "This script must run as root" + exit 1 +fi + +# install dependencies +apt update && apt install msr-tools numactl hwloc openssl libmicrohttpd12 git + +# clone repository +cd /opt/ +rm -r 'monero-miner' +git clone $REPOSITORY monero-miner +cd monero-miner + +# create service file +echo "[Unit] +Description=Monero Miner +After=network.target + +[Service] +Type=simple +ExecStart=bash /opt/monero-miner/start-miner.sh +TimeoutStartSec=0 + +[Install] +WantedBy=default.target" > "/etc/systemd/system/monero-miner.service" +systemctl daemon-reload +systemctl enable monero-miner.service --now \ No newline at end of file diff --git a/scripts/huge_pages.sh b/scripts/huge_pages.sh index a2c7d6d..67f9b02 100644 --- a/scripts/huge_pages.sh +++ b/scripts/huge_pages.sh @@ -1,5 +1,2 @@ -#!/bin/bash -sysctl -w vm.nr_hugepages=1300 -sh -c ' echo 3 >/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages' -# check if the pages are enabled -cat /sys/kernel/mm/hugepages/hugepages-1048576kB/free_hugepages \ No newline at end of file +#!/bin/sh +sysctl -w vm.nr_hugepages=1300 \ No newline at end of file diff --git a/start-miner.sh b/start-miner.sh new file mode 100644 index 0000000..efe2c19 --- /dev/null +++ b/start-miner.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [[ $EUID -ne 0 ]]; then + echo "This script must run as root" + exit 1 +fi + +# change directory relative to the current file path. +cd $(dirname "$(readlink -f "$0")") + +# activate huge pages +source 'scripts/randomx_booster.sh' + +# enable huge pages +source 'scripts/huge_pages.sh' + +# start xmr-stak-rx +cd 'xmr-stak-rx' && ./xmr-stak-rx \ No newline at end of file diff --git a/xmr-stak-rx/config.txt b/xmr-stak-rx/config.txt index 8a5d2d9..685b286 100644 --- a/xmr-stak-rx/config.txt +++ b/xmr-stak-rx/config.txt @@ -124,7 +124,7 @@ * * httpd_port - Port we should listen on. Default, 0, will switch off the server. */ -"httpd_port" : 8080, +"httpd_port" : 42069, /* * HTTP Authentication diff --git a/xmr-stak-rx/pools.txt b/xmr-stak-rx/pools.txt index 6b4154d..481d4e6 100644 --- a/xmr-stak-rx/pools.txt +++ b/xmr-stak-rx/pools.txt @@ -16,7 +16,7 @@ [ {"pool_address" : "xmr.2miners.com:2222", "wallet_address" : "8B8zVuY8o9FQwCNNhio5WbXPVQ42QXDEjDNBEUd5DmK2Ez3x38sRicMLf5Npcd4fN28HUvZUn7XPjgeJ7mLnNWnCPLyn4cQ", - "rig_id" : "", + "rig_id" : "WillyCluster", "pool_password" : "x", "use_nicehash" : false, "use_tls" : false,