Skip to content

Instantly share code, notes, and snippets.

@henrytriplette
Last active March 31, 2022 06:29
Show Gist options
  • Save henrytriplette/0ddea865d0d46060c7c9227034a73127 to your computer and use it in GitHub Desktop.
Save henrytriplette/0ddea865d0d46060c7c9227034a73127 to your computer and use it in GitHub Desktop.
Raspberry Pi Monero Miner

Install Dependencies

sudo apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev -y 
sudo apt-get update -y
sudo apt-get install git -y
sudo apt-get install -y --force-yes autoconf automake libtool
sudo apt-get install screen -y
sudo apt-get install build-essential -y

Installing the miner

git clone https://github.com/tpruvot/cpuminer-multi
cd cpuminer-multi

Building the miner

./autogen.sh
./build.sh

Mining

screen ./cpuminer -a cryptonight -o stratum+tcp://teracycle.net:3333 -p x -u (wallet)  --api-bind 0

Raspbian uses dphys-swapfile, which is a swap-file based solution instead of the "standard" swap-partition based solution. It is much easier to change the size of the swap.

The configuration file is:

/etc/dphys-swapfile 

The content is very simple. By default my Raspbian has 100MB of swap:

CONF_SWAPSIZE=100

If you want to change the size, you need to modify the number and restart dphys-swapfile:

/etc/init.d/dphys-swapfile stop
/etc/init.d/dphys-swapfile start

Edit: On Raspbian the default location is /var/swap, which is (of course) located on the SD card. I think it is a bad idea, so I would like to point out, that the /etc/dphys-swapfile can have the following option too: CONF_SWAPFILE=/media/btsync/swapfile

I only problem with it, the usb storage is automounted, so a potential race here (automount vs. swapon)

Autorun

sudo nano /etc/rc.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment