Mine Crypto on Linux
Tags: bitcoin, mining, crypto, linux
Published: 2021-05-18 07:38:00

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mc52thf5e1fnekgdeih.gif)

### Hashvault

Go to hashvault's website

https://hashvault.pro/

and create an account and log in

Click on the monero mining pool

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5t2b5atv1w0yfd28otbk.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awwbyg3x3er76tnvqzcm.jpg)

# Starting the miner!!!

We are ready to mine now!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg4df0ulkldrrizm082v.jpg)

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhal506ci6fuk4aobpiu.jpg)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfllkv3z2mfepojuj4r5.png)

You will see something like this

# Hashvault

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc77kji9u2kwj8qmfu18.jpg)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6a9dou5lz30uxh0qptri.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dw98f730o7ztz3k73vdt.png)

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