How to mine ArQmA on a Pi4

Raspberry Pi’s have been around since 2012. Over the years the device has evolved into an IoT dream allowing users to build anything from a PiHole for blocking unwanted spam coming into your home network, to little mini desktop PC’s. Arqma currently supports 32bit and 64bit operating systems for its CLI wallets and daemons that can be run on most Raspberry Pi’s available on the market today. Thanks to XMrig for supporting CPU mining and RandomX, their team has provided the crypto community with code that can build a CPU miner for a Raspberry Pi. Due to the requirements of RandomX of 2gb ram, it is recommended to use only Pi4 4gb or better models for mining Arqma. Today we are going to run through how to pull source code and build your own native XMrig application.


If you want to skip the manual building of XMrig for pi, we have pre-compiled binaries with config file HERE. It is recommended to use Ubuntu 20.04.3LTS for best results (CLI only no desktop, you will need to ssh to the pi running headless without a monitor).

Prerequisites

  • Raspberry Pi 4 4gb or better board and power supply
  • min 8gb microSD card (recommend 64b for better speed and use case)
  • Case with fan
  • Recommend adding an additional 4gb swap file to /mnt folder
  • Recommend heat sinks for the CPU and ram
  • Recommend Ubuntu 20.04.3 LTS loaded to sd card
  • Beverages while you wait for things to build

How to build XMrig on a Pi

Ok, let’s get started building. These instructions are for building on ARMv8 Raspberry Pi’s. It may work on other AMRv8 aarch64 setups but it has not been tested on any others. You can check your processor with this command:

				
					lscpu
				
			
It will print a bunch of info letting you know about your processor. We want to make sure it says aarch64 and 64-bit. A cool list of ARM processors and information can be found HERE:
				
					Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
Vendor ID:                       ARM
Model:                           3
Model name:                      Cortex-A72
Stepping:                        r0p3
CPU max MHz:                     1800.0000
CPU min MHz:                     600.0000
BogoMIPS:                        108.00
				
			

Make sure to first update your system before installing the required libraries for compiling XMrig:

				
					sudo apt update && sudo apt upgrade
				
			

Now install the required dependencies to build XMrig on your pi:

				
					sudo apt install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
				
			

Now download the latest XMrig source code:

				
					wget https://github.com/xmrig/xmrig/archive/refs/tags/v6.8.1.zip
				
			

Now unzip the folder contents:

				
					unzip v6.8.1.zip
				
			

Now move to the folder and modify the CMakeLists.txt to build only RandomX and what is supported on the Pi:

				
					option(WITH_HWLOC           "Enable hwloc support" ON)
option(WITH_CN_LITE         "Enable CryptoNight-Lite algorithms family" OFF)
option(WITH_CN_HEAVY        "Enable CryptoNight-Heavy algorithms family" OFF)
option(WITH_CN_PICO         "Enable CryptoNight-Pico algorithm" OFF)
option(WITH_RANDOMX         "Enable RandomX algorithms family" ON)
option(WITH_ARGON2          "Enable Argon2 algorithms family" OFF)
option(WITH_ASTROBWT        "Enable AstroBWT algorithms family" OFF)
option(WITH_KAWPOW          "Enable KawPow algorithms family" OFF)
option(WITH_HTTP            "Enable HTTP protocol support (client/server)" ON)
option(WITH_DEBUG_LOG       "Enable debug log output" OFF)
option(WITH_TLS             "Enable OpenSSL support" ON)
option(WITH_ASM             "Enable ASM PoW implementations" ON)
option(WITH_MSR             "Enable MSR mod & 1st-gen Ryzen fix" ON)
option(WITH_ENV_VARS        "Enable environment variables support in config file" ON)
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
option(WITH_OPENCL          "Enable OpenCL backend" OFF)
option(WITH_CUDA            "Enable CUDA backend" OFF)
option(WITH_NVML            "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" OFF)
option(WITH_ADL             "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" OFF)
option(WITH_STRICT_CACHE    "Enable strict checks for OpenCL cache" OFF)
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
option(WITH_PROFILING       "Enable profiling for developers" OFF)
option(WITH_SSE4_1          "Enable SSE 4.1 for Blake2" ON)
option(WITH_BENCHMARK       "Enable builtin RandomX benchmark and stress test" ON)
option(WITH_SECURE_JIT      "Enable secure access to JIT memory" ON)
option(WITH_DMI             "Enable DMI/SMBIOS reader" ON)
				
			

Now we need to make a build folder and move there:

				
					mkdir build && cd build
				
			

Now we need to build the make file that will build XMrig for our system:

				
					cmake .. -DARM_TARGET=8
				
			

Now that the Cmake file is set up we need to run the make file to build us the XMrig executable so we can start running a small desk heater mining ARQ:

				
					make
				
			

Depending on your pi, it should take about 10–20 minutes to compile the application. If you run into errors during the build process “undefined reference to `__atomic…” open up the CMakeLists.txt file and under the line

				
					set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
				
			

add in the following line:

				
					set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")
				
			

After this, save the file and then run the “make” command again.

Running XMrig to mine ArQmA

Once XMrig is built, you need to modify the config.json to add in your desired pool, your wallet address, worker name, and of course the coin you will be mining: ARQ. Below are the lines you will need to modify plus the worker name (your wallet address goes there) before you start mining:

				
					"rx/wow": [0, 1, 2],"rx/arq": "rx/wow"
"algo": "rx/arq",
"coin": "arqma",
"url": "pool.arqma.com:3333",
				
			

Save and close the json file and copy the XMrig executable and config.json file to a location of your choice and move to that folder in terminal. It is recommended to run the miner with Tmux so it runs as a background process. If you do not already have that installed then just run “sudo apt install tmux” and once it is installed then run the command “tmux” to open a background window. To start mining all you need to do it enter the following:

				
					./xmrig
				
			
Ubuntu Budgie 20.10: 611hs on 3w power draw with 3 cores!

For this instance of mining, ubuntu budgie aarch64 20.10 was being used. If a more lightweight OS such as ubuntu ARM 20.04.3 LTS is used, the hash rates are higher as more system ram and resources are available to the miner application that are not used to run the heavy OS UI.

Ubuntu 20.04.3 running 727hs RXARQ

To exit the tmux window without closing it so you can come back later use:

				
					Control+B release and press D
				
			

To re-enter that tmux instance to see how your miner is doing enter:

				
					tmux attach -t 0 
				
			

NOTE: replace the 0 with whatever instance you are running.

Final thoughts…

Mining Arqma on a Raspberry Pi is possible and today we have shown how to build XMrig binaries on a RaspberryPi 4 4gb with a 64bit operating system to utilize the ARMv8 processor to its full potential. Of course these little boards were not really designed for this task but they are cheap and easily accessible to add a small amount of hash power to the network in a discreet way. If you have a Pi laying around doing nothing and have some free time you too can have a little ArqPi miner in under 2 hours!

Helpful Arqma Links

Tips are always appreciated and not expected:

				
					aRS3ZP49AenNVa6hWJKf1y1Z8cwQJ3pbcYK8XmmYVpCdBWjEPyYW96Ye7cZwzoXP5Uawr7Y96DaEATDYQARJxS5K1M4zGQtQnM
				
			
ArqmaCommunity

ArqmaCommunity

author of this post

Share on twitter
Twitter
Share on facebook
Facebook
Share on reddit
Reddit
Share on telegram
Telegram