DEV Community

Cover image for Mine Crypto on Linux
Akshat Singhania
Akshat Singhania

Posted on

Mine Crypto on Linux

Mining crypto on windows is quite intuitive but not quite in Linux
So today we will be looking at how to set up mining on Linux

Installation

We would be using xmrig to mine XMR, it is a great miner, it also doesn't charge a huge fee, you set the percentage of the fees yourself too

Building packages

Since xmrig doesn't give us the binary themselves so we have to build them ourselves, this doesn't take much bandwidth not much processing power, and time though

Installing build-essential packages

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

Cloning GitHub repo to build xmrig

cloning the open-source code to build Linux executables.
The total download size is 9.69 MB.

git clone https://github.com/xmrig/xmrig.git

Creating the build directory and opening it in terminal

mkdir xmrig/build && cd xmrig/build

Build the Linux executables

cmake will make the executables themselves easily

cmake ..

.. is the directory path

Rechecking the cmake build

make -j$(nproc)

And Voila the installation is as easy as that

Start xmrig miner

Make a config.json to configure xmrig

touch config.json

Open in editor

Open it in vs code or other editors
for vs code

code .

Open the config.json file in

Setting up the pool to start Mining

Finally, we are going to set up the pool and start mining

excited as much me?

Alt Text

Hashvault

Go to hashvault's website

https://hashvault.pro/

and create an account and log in

Click on the monero mining pool

Alt Text

Go to your getting started and enter your monero wallet address.

I personally use MyMonero for my wallet https://mymonero.com/ (please mymonero sponsor meee)

Enter your wallet address

Scroll down and click on the copy button below the JSON config showed and paste the copied config onto the config.json file we created before

Alt Text

Starting the miner!!!

We are ready to mine now!

Alt Text

Scroll down more on the hashvault page and click on the bottom-most copy button

Alt Text

Paste in start.txt file (create in anywhere you like and you can remember the location)

It will look something like this

xmrig --url pool.hashvault.pro:80 --user 4Ahf9dJuMxXBRKkmgQz1kRKtHpa2yRapBciuV4pWKFktBeJ9WsLDcDDZEsZbkjyXkRgkFnRdTSjDVSiYJpWvsbVnVDNAkUd --pass x --donate-level 1 --tls --tls-fingerprint 420c7850e09b7c0bdcf748a7da9eb3647daf8515718f36d9ccfdd6b9ff834b14

Add a ./ at the beginning of the text file like this

./xmrig --url pool.hashvault.pro:80 --user 4Ahf9dJuMxXBRKkmgQz1kRKtHpa2yRapBciuV4pWKFktBeJ9WsLDcDDZEsZbkjyXkRgkFnRdTSjDVSiYJpWvsbVnVDNAkUd --pass x --donate-level 1 --tls --tls-fingerprint 420c7850e09b7c0bdcf748a7da9eb3647daf8515718f36d9ccfdd6b9ff834b14

and paste it in the terminal and omg your miner started mining

Alt Text

You will see something like this

Hashvault

Open the dashboard and click on the Stream tab
you will see connected like this

Alt Text

If you don't see anything don't worry just press ctrl + c in the terminal and run the command to start the miner again

you will see that its connected to your city/country

Earnings

Let it run for a while (1-3 hours), after running it for that time open the hashvault dashboard again and click on the rewards option

You will see your rewards/earnings

Alt Text

Get it into your wallet

The rewards doesn't deposit itself into your wallet address that you gave you have to click on the settings in the dashboard and set the payment threshold (i set mine to the lowest)

Alt Text

if the sum of all the rewards is greater than the payment threshold the payment will be done to your monero wallet address

Congo!!!!!!

Thanks for reading, hearts ❤️ if you liked it and unicorns 🦄 if you loved it, follow if you wanna read more awesome blogs

Top comments (3)

Collapse
 
kammillotos profile image
kammillotos • Edited

Great article. Thanks for sharing! And what about additional equipment for mining? What can you recommend? I read about ASIC miners and there are many positive reviews from people about these devices. I made a research in internet and found AsicClub company, they have 20 years experience in this niche. Their miners looks great, I think I will get consultations and choose something from them. What do you think about my idea?

Collapse
 
lionciolion profile image
lionciolion

Good day
I want to know recommend hardware to setup this tutorial
for example...
cpu specs
gpu
ram
thx and greetings from Argentina

Collapse
 
grantrocks profile image
Grant McNamara

I found a way to do this on a raspberry pi.
cryptoandpi.cf/blog/posts/mining-o...