Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile cpuminer-multi for Raspberry Pi
#!/bin/bash
#
# WARNING: CPU MINING IS UNPROFITABLE! (FOR HOBBY / EXPERIMENT / RESEARCH ONLY)
#
# RASPBERRY PI CPUMINER-MULTI SETUP SCRIPT
#
# RASPBERRY PI, DOGE, DOGECOIN, PROHASHING.COM, LITECOIN, MINING
#
set -x
if [ "$EUID" -ne 0 ]
then echo "Please run as root"; exit 1
fi
STALE_LIMIT=$((24 * 60 * 60))
LAST_UPDATED=$(($(date +'%s') - $(stat -c %Y '/var/cache/apt')))
PACKAGES="autoconf libcurl4-openssl-dev libjansson-dev openssl libssl-dev gcc gawk automake git"
dpkg -l $PACKAGES 2>&1 > /dev/null; NEED_INSTALLED=$?
if test $NEED_INSTALLED -eq 1; then
if test $(( $(test $LAST_UPDATED -gt $STALE_LIMIT; echo $?) * 1)) -eq 0; then
apt update -y
fi
apt install $PACKAGES -y
fi
test -e cpuminer-multi || git clone https://github.com/lucasjones/cpuminer-multi.git
cd cpuminer-multi
test -e Makefile && make distclean
./autogen.sh
./configure CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -Ofast -pipe -mfpu=neon"
make -j2
if test $? -eq 0; then
make install
printf "\n\nTo use type ./minerd with any options you want while in the cpuminer-multi folder\n"
printf "minerd -a scrypt -o stratum+tcp://prohashing.com:3333 -u <your username> -p 'n=DLnSuEpuZ' -t 4"
printf "\n\n Found this tutorial useful? Send me some sweet Dogecoin: 'DLnSuEpuZozzdG7oxKpsi11nCHwzXKyqps'"
else
printf "\n\nThere was an error in compiling\n"
fi
# Found this tutorial useful? Send me some sweet Dogecoin: DLnSuEpuZozzdG7oxKpsi11nCHwzXKyqps
# $ cp ./minerd.service /etc/systemd/system/
# $ systemctl daemon-reload
# $ systemctl enable minerd
# $ systemctl start minerd
[Unit]
Description=cpuminer-multi service
After=network.target
[Service]
User=dogecoin
Group=dogecoin
WorkingDirectory=~
Type=forking
ExecStart=/usr/local/bin/minerd --background --syslog -a scrypt -o stratum+tcp://prohashing.com:3333 -u <your username> -p 'n=DLnSuEpuZ'
Restart=on-failure
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment