Friday, April 6th 2018

Confessions of a Crypto Miner: Green(er) Mining

Welcome back to "Confessions of a Crypto Miner," my column about a crypto miner from 2013 trying to get caught up with the latest standards. I'm presently mining and reporting to you from a dual-GTX 1080 based rig mining zCash. Today, I'm going to talk about saving energy and reducing a miner's impact on the environment. How can you do that, you ask? Simple: Consolidation.

Mining inherently consumes a lot of energy, but a lot of things we do as tech geeks are actually not all that efficient. Case in point, my NAS I've had for years. Old Lenovo server-something or another, modded pretty hardcore, but still energy-drinking to the core. It's based around a Core 2 Quad and uses around 400W of power on its own when not doing much of anything more than being an NAS. It features big RAID arrays and big blower fans, none of which I really need in this day and age and all of which consume power. I've been thinking since I got my Ryzen quad core mining rig: What's to stop me from mining and doing my NAS stuff on the same rig, thus saving power? As it so happens, not much. My miner has the same memory size as the old Lenovo DDR2 solution and a far more energy efficient, likely faster CPU. So I can fold that 400 W server into my 550 W of mining, far reducing my footprint in a green sense. Let's get to it.

There are some caveats of course (aren't there always?) I don't have enough CALs to use Windows Server (my license is an old Academic one), so we'll be going Linux. In this case, Gentoo, since it's what I'm familiar with and I like its performance when you get it going.

Gentoo is a source-based distribution, so if you want to follow along, I suggest a strong understanding of Linux-based systems. Most of what you need can be found in the Gentoo Handbook at Gentoo.org. I will glance over a lot of the low-level stuff and just briefly describe my process for posterity.

I started off with a basic system AMD64 install with Ryzen optimizations to the make.conf, and then I proceeded to follow the respective guides for X11, the NVIDIA binary driver, and XFCE. For XFCE, I set it up with very little installed and minimalist to the core. I set up a browser (Firefox), a process manager for killing processes in the GUI (mate-system-manager), and a GUI package manager for Gentoo's portage package management system called "porthole" (clever, eh?). I also installed a binary remote desktop management system (RealVNC), for which I already have a license. Its advantage is that is supports native encrypted connections, but you can find other open source solutions if you dig around; they just require more setup. I also installed Samba for the NAS functions. Samba is the Linux equipvalent of Windows File Sharing and is compatible with the latter. Configuring Samba's smb.conf is beyond the scope of this article, but it's really not hard, especially if you are just doing a "family folder" style setup like me.

Once all that is done, I have a desktop that looks roughly like this:
The next thing to do, is get our miners and wallets functioning again. Storing your coins on the machine that mines them is not exactly the best security practice, but it does save energy vs firing up another machine, and the risk can be mitigated by periodic cash-out or transfer to cold storage (paper for me). Again, in this case I am choosing the energy saving option, and I am powering down a small highly firewalled system that in the past ran wallet software 24/7. Between all this, the miner at 550W is now running virtually for free if you count all the energy reductions, so why don't we CPU mine while we are at it? We will not just load our typical mining setup of EWBF's CUDA-based Zcash miner, but also xmr-stak, a highly capable Monero miner for the CPU. It will use half our CPU, or 2 cores, leaving enough power for the wallets and NAS to function. In an earlier column I talked about Monero not being worth it, but I feel it might be worth giving it another try, to see what comes out of it.

First, let's start with the wallets. We grab our wallet files and install the official Zcash client from source using the guide at the Zcash site. It's a simple CLI client, so I also load a Java-based SwingUI GUI from GitHub to pipe the commands and make management easier (note, the client is marked deprecated, but works fine). All this is compiled relatively easily in Gentoo, which is pretty much a complete development environment having gotten this far. The only thing I needed to emerge (install) to complete this is oracle-jdk-bin, which is the package for the Java 8 SDK needed to compile the SwingUI based GUI.

The GUI, when finished, imports the wallet fine and looks like this (probably time for a weekly cash-out, speaking of which!):
Next, I install Electron Cash, a Bitcoin Cash light client wallet (I seldom hold Zcash, and this is where most of my coin is now for lower fees and higher liquidity at cash-out). It installs relatively easily as well, as it's based on Python and its dependency list is easily installable via porthole, the GUI package manager we already met earlier.

Note that there is an ebuild (Gentoo Package) for Electron Cash. Don't use it. It's woefully out of date and has dangerous security loopholes. Why it isn't blocked on the Gentoo repository is beyond me.

Now, with those set up, we can download the binary EWBF's CUDA miner, which installs easily because it is binary, and then xmr-stak, whose build guide is easy to follow and also installs easily and with few dependencies besides openssl and obvious things. We have them installed now and point them to our pools. They are waiting to fire up, but I have one more thing I want: Wine, which is a Windows emulator for Linux.

Why do I want Wine? Because I have a funky old UPS that carries my miner through short circuits that plague our location. It doesn't run long, but it allows it to shut down properly, and it stops short circuits from resetting everything. It's an Opti-UPS GS1100B, which is a known Windows-only non-HID compliant piece of crap that requires some Windows software to function. The Windows software communicates over a virtual COM port on USB, which surprisingly, the latest Wine supports. We emerge (install) it, and check .wine/dosdevices to make sure the mappings are right. We find our USB UPS COM port present on COM5 as a symbolic link to /dev/ttyUSB0
Feeding that to the software gets us some figures:
It passes a self-test, as evidenced in this screenshot; communication is thus working (note the load meter does not work during a self-test. It is normally at about 80%):

Now, finally, it's time to kick things online. I write some startup scripts, assign them to startup via settings-manager - Session and Startup in Xfce, and reboot. I am greeted by the following:
We're mining happily, and the file server works fine. I'm even hosting a DLNA server on the side. I guess what I want you to take away from this as a miner is, your miner can do more than mining cryptocurrency. Consolidate. Just because we're miners doesn't mean we can't "think green." That's silly. Turn some things off and reduce your power and carbon footprint to compensate for the big one you'll be making while mining. Then, the next time someone calls you "mining scum" and accuses you of polluting the planet more than the average geek, you can happily prove them wrong. And why not? At least for a small-time miner, it isn't hard to do, it's fun, and that's part of why we IT types do everything we do, is it not? This guide isn't the only way, but there certainly are ways to accomplish what I'm saying. Get to it!
Add your own comment

45 Comments on Confessions of a Crypto Miner: Green(er) Mining

#1
ArchStupid
I really dislike all these off topic articles trying to justify mining.
Sounds like you're trying to clear your conscience in the face of the overwhelming dislike for mining activities among the users of this website.
Posted on Reply
#2
drade
Agreed. Especially dislike mining and the propaganda this OP keeps swaying. Mining is cancer - Die.
Posted on Reply
#3
InVasMani
The average person doesn't have a NAS in the first place and consolidating that into your mining rig does nothing to justify the latter.
Posted on Reply
#4
R-T-B
ArchStupid said:
I really dislike all these off topic articles trying to justify mining.
Sounds like you're trying to clear your conscience in the face of the overwhelming dislike for mining activities among the users of this website.
More I'm trying to encourage fellow miners to lower their eco footprint. And ask a question: Why can't one do both?

My consience is clean but I still can do more, so why not?

Also, we are host to a great many miners here. I don't feel that anti-mining sentiment is "overwhelming" but it certainly is disproportionally noisy at times.

InVasMani said:
The average person doesn't have a NAS in the first place
The average miner likely has a lot of "nerd toys" around that consume a lot of energy. It doesn't have to be an NAS.

I also took a plasma screen down this week, but that was more because it toasted my room to a an uncomfortable temp. FWIW, the thing drew an average of 400W.
and consolidating that into your mining rig does nothing to justify the latter.
Why not? I run a payment network without increasing my energy bill. Win win. What is the harm here? If anything, your argument has suddenly become against energy consumption in general.
Agreed. Especially dislike mining and the propaganda this OP keeps swaying. Mining is cancer - Die.
I bet it would shock you to find out I'm actually anti-POW... which is mining. :p I just don't have a better answer yet for what's to replace it. Part of why I am doing this article series is to learn it's pitfalls, and how to mitigate them until we have a better answer.
Posted on Reply
#5
moproblems99
ArchStupid said:
I really dislike all these off topic articles trying to justify mining.
Sounds like you're trying to clear your conscience in the face of the overwhelming dislike for mining activities among the users of this website.
Frankly, most people don't care two farts about what anyone else thinks. The point of these articles is to educate...you know, the more you know type stuff. Thanks for coming though.

@R-T-B I might have another windows server license if you ever need it.
Posted on Reply
#6
R-T-B
moproblems99 said:
@R-T-B I might have another windows server license if you ever need it.
Thanks, but then all my compiling and emerging in gentoo would feel like a waste... maybe later. ;)
Posted on Reply
#7
moproblems99
R-T-B said:
Thanks, but then all my compiling and emerging in gentoo would feel like a waste... maybe later. ;)
Understood. Thanks for the article, I hadn't really considered moving my home server into my miner but not a bad idea. Still wishing I had gone with 1070's or better so I could pull one right now and use it in my gaming rig.
Posted on Reply
#8
ST.o.CH
By chance, is there anyone that catch the idea that the evolution of gaming development and new tech hardware is slowing down because of mining demand,
seriously, I don´t see AMD or Nvidia making new ( not rebranded) stuff for miners or gamers.
Been up to date was never so future proof.
Posted on Reply
#9
Tartaros
R-T-B said:
More I'm trying to encourage fellow miners to lower their eco footprint. And ask a question: Why can't one do both?

My consience is clean but I still can do more, so why not?
When you see cryptomining takes the same energy as an average country maybe the question around this topic is why not stop. Or give that compute power to research.
Posted on Reply
#10
Vayra86
Wow this series of articles went from a good, fun start of someone who saw the light after being pointed to it numerous times, to a very weird, twisted kind of logic that somehow its good to reduce the energy footprint of a 100% wasteful business with only one goal: getting wealthy at the cost of others.

You earn zero points from me and you should just stop already, its starting to look ridiculous. You're just justifying your own idiocy (and failing at it, mind you..)

'Greener mining'... they call that a Contradictio in terminis

Comments like this:
"Then, the next time someone calls you "mining scum" and accuses you of polluting the planet more than the average geek, you can happily prove them wrong. "

Its just painful to read.
Posted on Reply
#11
moproblems99
TPU, I have a great idea. Let's start having article take down requests DMCA style. That way users who don't like mining, Intel, Nvidia, AMD, XBox, Playstation, Microsoft, Linux, etc, etc, cann all just request articles they don't like to be taken down. Then, everyone can be happy and no feelings will be hurt and TPU will have......no content. May as well take red out the logo as it is aggressive and can scare people.
Posted on Reply
#12
Vayra86
moproblems99 said:
TPU, I have a great idea. Let's start having article take down requests DMCA style. That way users who don't like mining, Intel, Nvidia, AMD, XBox, Playstation, Microsoft, Linux, etc, etc, cann all just request articles they don't like to be taken down. Then, everyone can be happy and no feelings will be hurt and TPU will have......no content. May as well take red out the logo as it is aggressive and can scare people.
Feelings hurt? This is what feedback looks like, and its up to the OP to do whatever he wants with it. For all I care he writes a novel about mining, I just won't even read it because any sort of credibility was lost to me.

That is exactly the problem today, people can't take feedback anymore, and have to resort to extremes instead, like censorship. Really odd.
Posted on Reply
#13
ppn
2 or 3 1000MW nuclear power units produce nuclear waste 24/7 to be unsafely stored for millennia just so that this ponzi can operate for few years, constantly requiring new blocks to validate transactions. and getting slower and slower. it is beyond criminal at this point. Ye yeah saving few watts until difficulty bombs.
Posted on Reply
#14
laszlo
i see some people blame mining for high power usage around world... but what about gaming? gaming don't use power? what do we win completing a game? nothing ,but we still use power; so let's stop playing games to be greener...?!
Posted on Reply
#15
R0H1T
Let's be clear here ~ crypto currencies & mining aren't going away anytime soon. As much as I hate the concept & deride it, I'll concede everyone of us is greedy at times, most of the time for something or the other. It may not be money, perhaps entertainment or something else.
The best way to keep this monster in check is to tax mining & the monetary gains, just make it incredibly hard for people to be instant millionaires overnight. I believe the reason this isn't happening is because big money & a large number of investors have enough friends in the establishment to make sure their gains aren't taxed.
Posted on Reply
#16
Tartaros
laszlo said:
i see some people blame mining for high power usage around world... but what about gaming? gaming don't use power? what do we win completing a game? nothing ,but we still use power; so let's stop playing games to be greener...?!
The moment you put entertainment at the same level of a make believe currency you should admit you are wrong. Why don't we go back to caves?
Posted on Reply
#17
R-T-B
Tartaros said:
When you see cryptomining takes the same energy as an average country maybe the question around this topic is why not stop. Or give that compute power to research.
I'm not of the opinion that it HAS to take that much energy, hence ideas like this for smalltime miners (who aren't the problem really, the big farms are).

Yes, I recognize this is useless to big farms who are the main offenders. But it still helps. And I am of the opinion cryptocurrency has good to do for the world yet, we are just in an infancy stage. Wishing it away when it clearly ISN'T going away isn't helping.

Tartaros said:
The moment you put entertainment at the same level of a make believe currency you should admit you are wrong. Why don't we go back to caves?
I enjoy my mining project. He's... not entirely wrong.

Vayra86 said:
twisted kind of logic that somehow its good to reduce the energy footprint of a 100% wasteful business
Out of curiousity, what is wrong with that logic? Serious question. My aim is not to justify mining (I view it as a silly if interesting enterprise), but to reduce it's impact.

What would you like to see more of vs this?

I basically just write "what I did last week" at this point, but I can write about other angles if it's wanted.

And yes, "green(er) mining" is an intentional contradiction. Plus the college I come from (Evergreen) has the somewhat deragatory local term "greeners" for the student base so it's a bit of an easter egg.
Posted on Reply
#18
cdawall
where the hell are my stars
ST.o.CH said:
By chance, is there anyone that catch the idea that the evolution of gaming development and new tech hardware is slowing down because of mining demand,
seriously, I don´t see AMD or Nvidia making new ( not rebranded) stuff for miners or gamers.
Been up to date was never so future proof.
Or could it be amd hasn't released a competing product since the 7950/7970? Much like the fx vs core I series issue we saw with amd and Intel.
Posted on Reply
#19
R-T-B
cdawall said:
Or could it be amd hasn't released a competing product since the 7950/7970? Much like the fx vs core I series issue we saw with amd and Intel.
I'd argue Hawaii was competitive for a little bit, but still, point stands.
Posted on Reply
#20
cdawall
where the hell are my stars
R-T-B said:
I'd argue Hawaii was competitive for a little bit, but still, point stands.
Kind of double the power and huge amounts of noise because of it. Definitely did not make the waves that Tahiti did.
Posted on Reply
#21
Renald
If you mine you consume energy.
If you consume energy, you are contributing to global warming.

Greener mining is stopping mining. Not some story over your NAS.
Posted on Reply
#22
moproblems99
If you game you consume energy.
If you consume energy, you are contributing to global warming.

Greener gaming is stopping gaming.
Posted on Reply
#23
cdawall
where the hell are my stars
What if you mine during the winter instead of using electric heat?
Posted on Reply
#24
R-T-B
Renald said:
If you mine you consume energy.
If you consume energy, you are contributing to global warming.

Greener mining is stopping mining. Not some story over your NAS.

Coward.
moproblems99 said:
If you game you consume energy.
If you consume energy, you are contributing to global warming.

Greener gaming is stopping gaming.
That really is the point, isn't it?

We all consume energy doing things we love. I make an article about how to compensate for that and somehow that's cowardly? I really can't see that. I try to understand all the replies but a lot of this just seems to be irrational hatred at the expense of logic.

Mining IS a flawed practice, but some of us enjoy it and do it as a hobby. A lot of things we as tech geeks do for a hobby consume undue amounts of power, but if every one of us tech guys tried to do a little of the above consolidation in any of our tech activities (mining, crunching, hosting, whatever) it could do some good. That's not cowardly, that's being productive. Cowardly is not giving a shit.

cdawall said:
What if you mine during the winter instead of using electric heat?
We already heat the cold side of the house with the miner. One room only though, because unfortunately, 600W of power doesn't heat too much. It is still pretty cold here in Washington.

For the record, I am not pro mining and I have no plan to mine beyond years end (which was my original contractual term for the agreement with this article). This is more an experiment to see how an average miner can mine at full capacity and still reduce his impact (as well as maximize his profits... they are NOT mutually exclusive). I'm trying to solve a problem rather than whine endlessly at it. The way I see it, I'm doing a good thing. Something that actually can make a difference. You seem to miss that entirely.

This article obviously didn't strike the right chord. BESIDES just turning off my miner and quitting, which can't happen anymore than the world can be expected to stop crypto in general, do you have any suggestions on what the next piece should be? I'd love to hear them. I'm thinking about maybe a piece on how crypto functions and particularly, where it falls flat: The Proof of Work mining method we all have learned to hate, and maybe a brainstorm attempt on what could replace it.

cdawall said:
Kind of double the power and huge amounts of noise because of it. Definitely did not make the waves that Tahiti did.
No, but at least it held it's own.
Posted on Reply
#25
moproblems99
R-T-B said:
This article obviously didn't strike the right chord. BESIDES just turning off my miner and quitting, which can't happen anymore than the world can be expected to stop crypto in general, do you have any suggestions on what the next piece should be? I'd love to hear them.
I think you should do your next article about the technology of blockchain. What is it, what can use it, and how can it be good? You could also include how crypto fits into all this or leave it out so the thin skinned among us may actually learn something.

Edit: I would also like to point out that anyone that is concerned with the environment needs to find another hobby other than computers. We rape Mother Earth daily for the base materials to be able to manufacture these things we love to argue about.
Posted on Reply
Add your own comment