Crypto mining using Raspberry pi
What is Cryptocurrency mining?
Crypto mining is the digital version of mining for gold, combining performing complicated calculations and pure luck (being the first to complete the calculation) with your computer. Mining is essential to cryptocurrencies in order to maintain their distributed ledger, aka Blockchain.
While Bitcoin is the most well-known form of cryptocurrency, it’s hardly the only game in town. All forms of cryptocurrency use blockchains to maintain the validity of each transaction and prevent someone from fraudulently spending their coins more than once.
Disclaimer: This article is presented as an educational opportunity to spark interest in learning more about blockchain and cryptocurrency, and not necessarily to generate cryptocurrency. The methods described in this article are hacks and not officially supported. The easier and faster method is to download and install the free software associated with the mining pool of your choice on your PC.
What You’ll Need for this Project
Raspberry Pi 4 or Raspberry Pi 3
8 GB (or larger) microSD card (see best Raspberry Pi microSD cards) with a fresh install of Raspberry Pi Lite OS or Raspberry Pi OS with Desktop.
Power supply/Keyboard/Mouse/Monitor/HDMI Cable (for your Raspberry Pi)
Optional (Recommended): Heatsinks and fan for your Raspberry Pi
Optional: Solar Panel Power Bank with USB-C
Optional: Raspberry Pi Cluster Case with Heatsinks and Fans
This tutorial is based on terminal commands. If you are not familiar with terminal commands on your Raspberry Pi, we highly recommend reviewing 25+ Linux Commands Raspberry Pi Users Need to Know first
How to Mine for Cryptocurrency on Raspberry Pi
We will start by creating our account with Minergate, a cryptocurrency mining pool with 3.5 million users worldwide for Bitcoin Gold, Zcash, Ethereum, Ethereum Classic, and Monero. This tutorial is specific to mining Monero as it was the only cryptocurrency I had any level of success with.
Raspberry Pi Bitcoin Mining
2. Boot your Raspberry Pi. If you don’t already have a microSD card see our article on how to set up a Raspberry Pi for the first time or how to do a headless Raspberry Pi install.
3. If you are using Raspberry Pi OS with Desktop, open a Terminal, or press Ctrl-T. If you are using Raspberry Pi Lite, login as you would normally.
4. Once in your terminal, run the following updates and install the necessary dependencies:
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install git automake autoconf libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev
cd cpuminer-multi
5. Now, let’s compile the mining code with the following three commands. This step will take a couple of minutes on a Raspberry Pi 4.
sudo ./autogen.sh
sudo ./configure
sudo ./build.sh
6. After building and configuring our mining software on our Raspberry Pi, let’s start mining for Monero! Enter the following terminal command to start the miner, replacing YOUR_EMAIL with the email address you used to signup for your Minergate account.
./cpuminer -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45700 -u YOUR_EMAIL
You should see the mining software start and hopefully see a few shares ‘accepted’ with ‘yes!’
7. Let’s check your Minergate Dashboard by logging into https://minergate.com/internal. You can do this on a Chromium browser if using Raspberry Pi Desktop, or on your PC. Scroll down your dashboard until you see Monero. If everything is working, your Monero Status will indicate ONLINE. Congratulations! You’re now mining for Monero!
Comments
Post a Comment