-
-
Notifications
You must be signed in to change notification settings - Fork 29
D04. Mining with SBC
The following guide will show you how to compile a CPU miner (xmrig) for SBCs like the Raspberry Pi.
What are the benefits of compiling xmrig from scratch?
- You'll have the most up-to-date version of xmrig
- You can optimize xmrig for specific SBCs (improves hash rate)
- You can compile xmrig with different releases of GCC (may improve hash rate)
- It's possible to disable certain features of xmrig (more info)
First we want to make sure your SBC's software is up to date:
sudo apt-get update && sudo apt-get upgrade
After that's done, we're going to install some tools that are important for the process:
sudo apt-get install git build-essential cmake make libuv1-dev libmicrohttpd-dev gcc g++ automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev
At this step we'll obtain the latest binaries of xmrig and create a directory called build:
cd ~
git clone https://github.com/xmrig/xmrig.git
cd xmrig && mkdir build && cd build
Now we specify the build flags to optimize xmrig for your SBC in particular. You'll have to only choose one of these:
- for any SBC:
cmake ..
- for the Raspberry Pi 2:
cmake .. -DCMAKE_C_FLAGS="-mcpu=cortex-a7 -mtune=cortex-a7" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a7 -mtune=cortex-a7"
- for the Raspberry Pi 3:
cmake .. -DCMAKE_C_FLAGS="-mcpu=cortex-a53 -mtune=cortex-a53" -DCMAKE_CXX_FLAGS="-mcpu=cortex-a53 -mtune=cortex-a53"
- for the Asus Tinker Board:
cmake .. -DCMAKE_C_FLAGS="-march=armv7-a" -DCMAKE_CXX_FLAGS="-march=armv7-a"
You may find the right flags for your board here. I was only able to test these on a Raspberry Pi 2 and the Asus Tinker Board. Also, this guide is not perfect, so feel free to add/edit flags or devices!
To finish the compilation type:
make
To speed up the compilation you can add -j [amount_of_CPU_cores]
. On a Raspberry Pi 2/3 this would be make -j 4
for example.
First we need to copy config.json
to the same directory the xmrig executable is located:
cp ~/xmrig/src/config.json config.json
Now we have to edit the configuration file properly. In this guide we'll be using nano, but any other text editor should also work fine:
nano config.json
Your terminal should display the contents of config.json
.
-
In order to mine Qwertycoin, we tell xmrig what algorithm you want to mine. Look out for the
"algo":
setting and change it to"algo": "cryptonight",
-
In place of "url": "pool.qwertycoin.org:3333", you'll need to choose a pool to mine towards. Make sure to choose the right port. You can check the full list of pools here.
-
Instead of "user": "YOUR_WALLET_ADDRESS", simply paste your Qwertycoin wallet address. If you don't have one yet, you can find out how to create a wallet here.
When you're done with that, press:
CTRL + O
to save, confirm with Enter
. And after that, hit CTRL + X
to close the file.
Then start the miner:
./xmrig
After entering this command, the miner will start scanning your hardware and begin to mine.
Congratulations! You did it! :)
- A01. | Contributing
- A02. | Getting Started
- A03. | Qwertycoin Community
- A04. | Qwertycoin Voting
- A05. | Qwertycoin API
- B01. | Generating a Wallet
- B02. | Making a Paper Wallet
- B03. | Wallet Backup
- B04. | Wallet Recovery
- B05. | Wallet Update
- B06. | Using CLI Wallet
- B07. | Using RPC Wallet
- B08. | Using GUI Wallet
- B09. | Using Zero Wallet
- B10. | Using Web Wallet
- B11. | Using Mobile Wallet
- B12. | RPC Wallet API
- B13. | Sign and verify messages
- C01. | Start Masternode
- C02. | Fix Sync Issues
- C03. | Load Checkpoints
- C04. | JSON RPC API
- C05. | HTTP RPC API
- D01. | XMR Stak Guide
- D02. | XMR Stak Linux Guide
- D03. | XMRIG Guide
- D04. | Mining with SBC
- D05. | Cloud Mining
- D06. | Mobile Mining
- D07. | Using a Mining Pool
- D08. | Creating a Mining Pool
- E01. | How to trade QWC on Crex24
- E02. | How to trade QWC on Bitexlive
- E03. | How to trade QWC on Bisq
- G01. | Hosting Block Explorer
- G02. | Hosting Faucet
- G03. | Hosting Web Wallet
- G04. | How to use the QWC Faucet