Mine Coin MAGI (XMG) on a Raspberry Pi 2/3

Simon Egersand 🎈
2 min readJan 4, 2018

Ever wanted to mine cryptocurrency and have a Raspberry Pi lying around? You’ve come to the right place. Mining crypto using a Raspberry Pi won’t make you rich by any means, but it’s a fun experience and it doesn’t take too long to set up. I’m currently mining on both an RPI2 and RPI3 with good results.

This guide assumes you have basic knowledge of using Linux via the terminal. Raspbian Stretch Lite is used in this guide as the operating system.

As always before doing anything on your Linux OS you should check for updates.

$ sudo apt-get update
$ sudo apt-get upgrade

To be able to compile our miner we need some dependencies.

$ sudo apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++ git libgmp-dev screen

The miner we will be using is called m-cpuminer-v2 and is available on GitHub. Despite the latest commit being pushed in 2015, it is still working. Let’s clone the repo.

$ git clone https://github.com/magi-project/m-cpuminer-v2.git

Now that we have the source code on our machine we can compile it. By reading the README of the repo I know what command to run to compile it.

$ cd m-cpuminer-v2
$ ./autogen.sh && ./configure CFLAGS="-O3" CXXFLAGS="-O3" && make

This will take a few minutes. When it’s done you will have a binary called m-minerd in the…

--

--

Simon Egersand 🎈

Sr. Software Engineer @ Spotify | Tech Blogger 💻 | Professional Nerd 🤓 | Musician 🎸