Thursday, 21 December 2017

Blog post #100!

So this week I mined my first cryptocurrency on my unRAID setup and the bug has well and truly bitten!

I thought I'd missed the bitcoin boat as I never got into mining and now bitcoin requires specialised hardware for mining. However, browsing AVForums I came across a thread from a member inviting participation in an OCUK forums mining project.

Looking into it a bit more, it turns out there's a whole altcoin market out there and there are still coins that can be mined on lowly PC hardware. Who knew! Given that I have an unRAID server sitting running 24/7, I figured I'd give it a go to see how it worked.

It's a bit of a learning curve but I got up to speed in a few evenings.

Essentially, I'm participating in a 'mining pool' that's mining elecroneum (ETN) coins. A pool is a group of 'miners' who share computing resources in order to mine 'blocks' more quickly than they could hope to by themselves. Once a block is mined, the pool members share the coins based on how much computing resources they contributed to the effort.

Right now, each 'block' generates about 7500 coins to share. It's taking on average about 9 hours to mine a block, thopugh this varies quite a bit. 1 ETN is currently worth about 7p (sterling). This pool selected this coin as it's relatively easy to mine using current GPU hardware and there's the hope that it will appreciate greatly in value over the coming months.

Mining is achieved by running a mining application on your computer. There are many options available but I ended up using one called xmr-stak that is compiled specially for this pool. It seems to be a good general purpose miner in that it can use any combination of CPU and/or Nvidia/AMD GPU for calculations.

And it's all about the hardware.

As a user you contribute computing power that's measured in hashes per second - H/s. (There are KH/s and MH/s as well). The more H/s you contribute to mining a block, the more coins you receive on completion.

The mining software can use your CPU to generate H/s, though how many you get is very dependant on the CPU and whether or not it supports the AES instruction set. For example, testing on an i3 with no AES, I can get 30 H/s. On an i5 with AES, that bumps up to ~210 H/s. At current rates, 30 H/s would generate the equivalent of about 10p (stg) per day so wouldn't even come close to the electricity cost of running a CPU at full tilt for a day. (the i5 has potential for about 80p p/d). So CPUs are not all that efficient for mining.

However, it's graphics cards where all the action is. Modern GPUs can churn out ~700 H/s (£2.60 p/d) or more. The more GPUs you can dedicate to your mining setup, the more hashes you can contribute and the more coins you can generate.

Of course, you need to take into account electricity costs and the depreciation on the hardware but the general consensus seems to be that it's possible to break even on a considered hardware investment in 3-6 months, all going well.

So to get started, I wasn't interested in any capital outlay and wanted to see what I could achieve from equipment to hand.

My unRAID server runs 24/7 with a 4 core / 8 thread AMD CPU, It's doing fileserving and running  a few dockers for LMS, Emby and TVHeadend (it's the whole-houe media server). I also have a Win 10 workstation VM set up on it which I use as my main PC and there's a couple of other windows VMs as well which may or may not be running depending on need. I typically leave the workstation VM always on. It's got an AMD R9 200 GPU assigned running 2x displays.

First up, I set up the mining software on the VM. Running plain vanilla, it found the 4x CPU threads I'd assigned and the GPU and started hashing. Over the past few evenings, I've been looking into optimisations etc. and through tweaking settings, updating drivers  and adding a couple more CPUs to the VM, I managed to improve the hash rate somewhat.

I had a spare R7 200 card lying around so I added this into the system and passed it through to the VM. The mining software identified it and started using it straight away.

My unRaid server is now chugging away generating ~850 H/s with zero capital outlay. At current rates and predictions, this will potentially generate ETNs equivalent to £3.20 per day or £1,170 per year. I'm pretty pleased with that for zero-cost on older hardware.

Of course, actual returns won't be that high as I've got to pay for the extra electricity this will inevitably use. Over the coming weeks, I'll monitor the extra power draw and compare against the payouts to see what actual profit is. Additionally, there are all kinds of fees and such in actually converting ETNs to hard cash so it remains to be seen if any additional money can be generated from this endeavour. And I have to think about not converting to cash and hoping that ETN appreciates significantly over time. Of course, it could go the other way and all would be for nought.

And the temptation is always there to invest in a few additional GPUs to up the hash rate. That could be a slippery slope! There are a couple of spare PCIe slots in my unRAID server....

However, I'm pleased that unRAID allows me to do this. I don't think there's much, if any, penalty in doing this via a VM as the H/s I'm getting seem comparable with those I've read about for equivalent hardware running bare metal. Even if it is maxing out the CPU;

1 comment:

splnut said...

I've been mining XMR for awhile on Unraid using the Minergate and STH docker images. Electricity is cheap for me, so dual e5-2670's running full blast doesn't bother me too much. I get around 900 H/s without any gpu's.