From 3f506d843e8eb121c893bd125696052a87e6c189 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Mon, 29 Jun 2020 01:30:44 -0700 Subject: [PATCH] adding dir for mining --- mining/Dockerfile | 16 ++++++++++++++++ mining/README.md | 16 ++++++++++++++++ mining/start_mining | 29 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 mining/Dockerfile create mode 100644 mining/README.md create mode 100644 mining/start_mining diff --git a/mining/Dockerfile b/mining/Dockerfile new file mode 100644 index 0000000..8068a77 --- /dev/null +++ b/mining/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:19.10 + +RUN \ + apt-get update \ + && apt-get install -y git build-essential cmake libuv1-dev libssl-dev libhwloc-dev \ + && git clone https://github.com/xmrig/xmrig.git /root/xmrig \ + && mkdir /root/xmrig/build \ + && cd /root/xmrig/build \ + && cmake .. \ + && make + +COPY start_mining . + +RUN chmod +x start_mining + +ENTRYPOINT ["./start_mining"] diff --git a/mining/README.md b/mining/README.md new file mode 100644 index 0000000..82142a7 --- /dev/null +++ b/mining/README.md @@ -0,0 +1,16 @@ +# Miner + +This is a quick and dirty implementation. There's some hardcoded choices in there until I go back and update it or someone makes a PR. + +``` +# build container image of xmrig (mining software) +docker build -t miner . + +# run simple wow miner +docker run --rm -d --name miner miner + +# run big monero miner +docker run --rm -d --name miner miner xmr 8 +``` + +See [start_mining](./start_mining) for details of inputs. diff --git a/mining/start_mining b/mining/start_mining new file mode 100644 index 0000000..39c3b36 --- /dev/null +++ b/mining/start_mining @@ -0,0 +1,29 @@ +#!/bin/bash + +set -xe + +RECV_ADDR=${1} +SYMBOL=${2:-wow} +THREADS=${3:-2} + +if [[ "${SYMBOL}" == "wow" ]]; then + ALGO="rx/wow" + CRYPTO="wownero" + URL=ca.${CRYPTO}.herominers.com:10661 + ADDRESS=${RECV_ADDR} +elif [[ "${SYMBOL}" == "xmr" ]]; then + ALGO="rx/0" + CRYPTO="monero" + URL=pool.supportxmr.com:3333 + ADDRESS=${RECV_ADDR} +fi + +/root/xmrig/build/xmrig \ + --donate-level 1 \ + --url=${URL} \ + --user=${ADDRESS} \ + --pass=$HOSTNAME \ + --algo=${ALGO} \ + --keepalive \ + --print-time=10 \ + --threads=${THREADS}