Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: j16sdiz on January 11, 2011, 11:31:04 AM



Title: GAE Miner
Post by: j16sdiz on January 11, 2011, 11:31:04 AM
Hi all,

Here is the GoogleAppEngine/Java Miner as promised.

   Project URL: https://github.com/j16sdiz/gaeminer

Background Infomation
Google App Engine is Google's computing platform, it provide 6.5 free "cpu hour" (which is, only 3 real hours) per application. Each user can create up to 10 applications for. That is .... around 50G hashes per day per mobile phone number. I have checked the TOS twice, and do not think this violate the TOS. If you have any concern, please don't use it and ask.

Installation Steps
Due to how Google App Engine works, you need the SDK to install it. Here are the steps:

  • Install Oracle Java SDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
  • Download and install Eclipse (http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr1). The gae recommand the web version, but the Java version just fine and is smaller.
  • Install Google App Engine Plugin (http://code.google.com/appengine/docs/java/tools/eclipse.html)
  • Edit src/net.sdiz.bitcoin.jdo/Config.java and give your account details
  • Apply your GAE account at http://appspot.com/  You need a mobile phone that recieve SMS to pass this step
  • Create 10 applications in your GAE account, pick the default options is fine
  • Go back to eclipse, press the upload button http://code.google.com/appengine/docs/java/tools/eclipse/ae_deploy_button.png.
  • Click the "App Engine project setting..." link and enter your application-id. Click OK
  • Enter your Google Account Details and click Depoly
  • Repeat the last three steps for the 9 other application-ids

Alternative Installation Step
If you really hate eclipse, there is an ant build.xml provided. But you are on your own.


--
If you love this application, consider donating to: 1JQ4o2onaJnCpKYZnJzHUok9E1GZewon27


Title: Re: GAE Miner
Post by: davout on January 11, 2011, 11:38:24 AM
Thank you!

But that's like 83.3 seconds worth of mining on a HD5970


Title: Re: GAE Miner
Post by: j16sdiz on January 11, 2011, 11:41:51 AM
Thank you!

But that's like 83.3 seconds worth of mining on a HD5970

I am just a poor CPU Miner :(


Title: Re: GAE Miner
Post by: Cdecker on January 11, 2011, 01:16:49 PM
Still cool though :D I love this kind of crazy things :D


Title: Re: GAE Miner
Post by: slush on January 11, 2011, 01:47:37 PM
Hey, crunching whole nonce space is useless. With your hash/s, you are crunching old blocks for 10% of time.

Edit: Sorry, I see your config has final nonce only 0xffff. Still, I see in logs you are working on one job more than 50 seconds, so you waste ~10% of time for crunching old jobs.


Title: Re: GAE Miner
Post by: gigitrix on January 11, 2011, 05:16:30 PM
I'm only a newbie, but wouldn't task queues be a better (and more parralel) implementation than cron jobs?


Title: Re: GAE Miner
Post by: j16sdiz on January 12, 2011, 12:12:26 AM
Hey, crunching whole nonce space is useless. With your hash/s, you are crunching old blocks for 10% of time.

Edit: Sorry, I see your config has final nonce only 0xffff. Still, I see in logs you are working on one job more than 50 seconds, so you waste ~10% of time for crunching old jobs.

No, it should not work on the same hash for more then 6 seconds.
It would adjust the final nonce.  

See Line 87
https://github.com/j16sdiz/gaeminer/blob/master/src/net/sdiz/bitcoin/MiningServlet.java#L87

And Line 39
https://github.com/j16sdiz/gaeminer/blob/master/src/net/sdiz/bitcoin/jdo/Config.java#L39


Title: Re: GAE Miner
Post by: j16sdiz on January 12, 2011, 12:20:24 AM
I'm only a newbie, but wouldn't task queues be a better (and more parralel) implementation than cron jobs?

I have considered using queue, but it have some disadvantages:

- Old (outdated) hashes -- If we put the hash into the queue, we may work on a old, outdated hash. There is no way to check the queue size in java (afaik), so we would be always working on outdated hashes.

- Too parallel -- Heavy load on Google's server.  We have only ~3 hours per day, parallelism don't have any advantages. It's better to distribute it over the whole day.


Title: Re: GAE Miner
Post by: Anonymous on January 12, 2011, 12:41:04 AM
Is this the gae agenda nanaimo gold was talking about?

 ;D


Title: Re: GAE Miner
Post by: Gavin Andresen on January 12, 2011, 01:22:14 AM
Should we start a betting pool to see how long it takes Google to decide bitcoin mining should be against its terms of service?

I think.... three months.


Title: Re: GAE Miner
Post by: gigitrix on January 12, 2011, 01:56:55 AM
I'm only a newbie, but wouldn't task queues be a better (and more parralel) implementation than cron jobs?

I have considered using queue, but it have some disadvantages:

- Old (outdated) hashes -- If we put the hash into the queue, we may work on a old, outdated hash. There is no way to check the queue size in java (afaik), so we would be always working on outdated hashes.

- Too parallel -- Heavy load on Google's server.  We have only ~3 hours per day, parallelism don't have any advantages. It's better to distribute it over the whole day.

Thanks for explaining this. I have zero experience with GAE but I got this thing running. Hope google don't pull a switcheroo on the TOS any time soon, and my readthrough confirms that this is legal (if sketchy) according to their rules.


Title: Re: GAE Miner
Post by: j16sdiz on January 12, 2011, 03:10:54 AM
Should we start a betting pool to see how long it takes Google to decide bitcoin mining should be against its terms of service?

I think.... three months.


I can see nothing in the TOS against this. Except, perhaps, in the "Program Policies":

Quote
In addition to (and/or as some examples of) the violations described in the Terms, you may not and may not allow any third party, including your end users, to:
   j. Interfere with other users' enjoyment of the Service;

But I have tried to minimize the effect of this. (for example, using cron job instead of queue, distributing the task over whole day, don't retry on server error, etc)


Title: Re: GAE Miner
Post by: Local on January 12, 2011, 07:03:18 AM
Should we start a betting pool to see how long it takes Google to decide bitcoin mining should be against its terms of service?

I think.... three months.


I doubt it. Either it won't be a problem because it won't be profitable or it will be profitable and they'll do it themselves until it isn't and/or raise their rates.


Title: Re: GAE Miner
Post by: Mike Hearn on January 12, 2011, 02:14:37 PM
I should note at this point that I work for Google in one of the anti-abuse departments and I'm watching this thread carefully ;)

I can't give you an authoritative answer on what violates the AppEngine ToS as that isn't my job. But consider the following passage from the terms:

Quote
4.4. You may not develop multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees.

We take a dim view of people who create attempt to work around the limits we put in place via multiple accounts or otherwise. The phone verification is specifically intended to make that hard. But you probably won't be able to earn interesting quantities of BitCoin unless you do attempt to repeatedly create the same app over and over again.

So I don't think BitCoin mining on App Engine has a future. Nice idea though and I'd love to see people write AppEngine apps for other BitCoin related purposes (Gavin has done a great job with some of his apps). For mining your best bet is ATI rather than Google, sorry.

/mike


Title: Re: GAE Miner
Post by: j16sdiz on January 12, 2011, 03:24:36 PM
(...removed something I won't Comment on...)

But you probably won't be able to earn interesting quantities of BitCoin unless you do attempt to repeatedly create the same app over and over again.

So I don't think BitCoin mining on App Engine has a future. Nice idea though and I'd love to see people write AppEngine apps for other BitCoin related purposes (Gavin has done a great job with some of his apps). For mining your best bet is ATI rather than Google, sorry.

/mike

As davout have mentioned, all 10 application x 6.5 free "CPU" hour is just ~80 second on ATI.
Even when compared to CPU miner, each CPU gives only ~133khash/CPU-Second (around 450khash/wall-second). It is on the lower-end of the spectrum.

So, this application is more like a PoC than anything else.


Title: Re: GAE Miner
Post by: Anonymous on January 12, 2011, 11:51:50 PM
I should note at this point that I work for Google in one of the anti-abuse departments and I'm watching this thread carefully ;)

I can't give you an authoritative answer on what violates the AppEngine ToS as that isn't my job. But consider the following passage from the terms:

Quote
4.4. You may not develop multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees.

We take a dim view of people who create attempt to work around the limits we put in place via multiple accounts or otherwise. The phone verification is specifically intended to make that hard. But you probably won't be able to earn interesting quantities of BitCoin unless you do attempt to repeatedly create the same app over and over again.

So I don't think BitCoin mining on App Engine has a future. Nice idea though and I'd love to see people write AppEngine apps for other BitCoin related purposes (Gavin has done a great job with some of his apps). For mining your best bet is ATI rather than Google, sorry.

/mike

Google should support open source projects then imho  :)





Title: Re: GAE Miner
Post by: Cdecker on January 13, 2011, 01:31:21 AM
I think it's a quiet innocent hack, and an interesting one if it comes to that. I'd have never thought using a cloud designed to deliver web content to do real calculations :D
But I'd neve risk my Google account over it ^^


Title: Re: GAE Miner
Post by: LZ on January 14, 2011, 03:09:55 PM
Just checked pool status. I got some shares today. So GAE Miner works.