Crypto Mining Saga Part 1: Cloud Mining Experiment

in #cryptocurrency7 years ago

So I've recently been really fascinated with cryptocurrencies and have gotten myself back into reading about mining.  I first started looking at mining and cryptocurrencies in college a few years ago and I attempted to mine some Litecoin back then.  However, I never have had a gaming rig with a beefy enough processor to mine anything of value so I usually quit after about a week and only making $0.02. 

Back then it was easy to write that off, I was living in the dorms at college and I didn't have to pay for electricity.  Now that I'm an "Adult" and I have bills and what not, the concept of mining on a big rig becomes a little harder to swallow.  However, I really wanted to play around with it for fun and to give back what little I can to the community by attempting to validate some transactions.

Note: I know that the method of mining I'm going to describe here is not profitable.  I'm not expecting to make money off of this endeavor, I just want to learn as much as I can by doing and hope I don't lose too much in electricity costs in the process.

Mining in the cloud

So a few years ago I signed up for a cloud service called Cloud at Cost (https://www.cloudatcost.com).  Cloud at cost offers a low cost, one-time fee virtualization platform.  I essentially bought virtual CPUs, Memory and SSD space from them and I can allocate that to any number of VMs I choose.  I bought this service because in my day job I do a lot of software testing so I figured this would be a good service to have so I could quickly and easily spin up a publicly facing server to try out new software.

I paid my one time fee for 12 vCPUs, 12 GB of RAM and 120 GB of SSD space.  Back then I think I spent about $120 on it.  So for me, this was a sunk cost, I had paid for it years ago and haven't been using it as much as I should have been.  However, when I started looking into mining I thought this would be a good place to get some "free" CPU power to mine something.

Building my first cloud mining rig

When I first started doing my research I was looking for something easy to get started.  Everything I read said that minergate was the easiest way to get started.  So that's what I did, I went out to my Cloud at Cost portal and started up a 2 vCPU 2GB RAM and 20GB SSD Ubuntu 14.04.  I never thought that I'd get a high hash rate out of these VMs but I wanted to see if I can find the sweet spot and squeeze the best hash rate out of these resources I have.  Now minergate has a wonderful command line version of their mining software (https://minergate.com/downloads/console).  Once I got the VM up and running, getting the miner was as simple as running the following few commands:

wget https://minergate.com/download/deb-cli
chmod 777 deb-cli
dpkg -i deb-cli

With those commands I now had the "minergate-cli" application installed and I could start mining most everything minergate allows.  I decided that the best currency to mine using a CPU is Monero.  Monero uses the CryptoNight algorithm which is supposed to be ASIC resistant.  This means that while my CPU is still slow it isn't so slow that I cant at least make some Monero.

Are there any downsides?

Well, the truth of the matter is that the hash rate is pretty bad.  I've tried several different configurations with Cloud at Cost.  I've tried different configurations of CPU cores and RAM trying to squeeze the best hash rate out of them.  However, unfortunately, using the minergate-cli I'm only getting about 5 H/s per CPU core.  Through all my experiments I haven't been able to get anything greater than that out of the vCPUs.

One thing I have found is that the minergate-cli tends to die every so often.  So I wrote a short script to check to see if it's started and if it's dead to open the application in a screen.

minergate_check.sh:

#/bin/bash
case "$(pidof minergate-cli | wc -l)" in

0) echo "Restarting Minergate: $(date)" >> /root/minergate.log 
   screen -d -m -S minergate /root/minergate_start.sh
   ;;

1) echo "Minergate running: $(date)" >> /root/minergate.log
   ;;

*) echo "More than one minergate running"
   ;;

esac

The script calls a simple bash script minergate_start.sh when it can't find a process ID (PID) of the minergate-cli application.  That script is a simple one-liner that just runs the minergate-cli application with all the switches that I use to start mining Monero.

So I set this up as a cronjob to run every 5 minutes and check to see if the service is running or not.  So far this has worked like a champ for me.  When I review the log it looks like the service has to be restarted about once every hour or so.

Final Thoughts

The way I'm doing it now is never going to make me any money, but in all fairness, this is a sunk cost for me.  I bought this service a few years back for another project and I haven't been using it since.  So in all honesty, I can't complain much.  I'm not going to get rich on this but, at least I am learning something and I feel like I'm giving back to the community by confirming transactions and working on mining a really cool cryptocurrency.

Additionally, I am concerned that I may at some point be in violation of the Cloud at Cost terms of service.  I'm no lawyer, but the terms of service state that if your VMs run at 100% CPU for about 30 minutes they can shut down your VM.  I don't know what that means for my account.  If I"m found in violation of the terms of service will the remove my account?  So far I haven't had any issues, none of my VMs have been shut down for excessive CPU usage.

I like the Cloud at Cost model and you can't beat the price.  When they have their big sales it's a pretty good deal.  You can find more about their Developer Cloud on their website at www.cloudatcost.com.  It's always nice to be able to spin up a cheapo server to do a test, but I'd never use any of these servers for a production application.

So what do you think, does anyone out there use Cloud at Cost or anything like it?

Sort:  

Calling @originalworks :)
img credz: pixabay.com
Nice, you got a 89.0% @abulabubu upgoat, thanks to @kslo
Want a boost? Minnowbooster's got your back!

The @OriginalWorks bot has determined this post by @kslo to be original material and upvoted(2%) it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Congratulations @kslo! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!