Title: F-yeah! (bitcoind port) Post by: P_Shep on May 20, 2013, 09:19:06 PM After countless failed attempts some months ago, I just had another go at trying to build bitcoind for the mipsel architecture... specifically my router.
I recently bought an ASUS RT-N66U which boasts a mighty 256Mb RAM and 600MHz processor, so thought I'd give it another go. So, after about 3 solid days of finding the right compiler, right GCC/binutils/uclibc combination, tweaking them; finding the right libraries, their right versions and tweaking those, I finally, finally FINALLY managed to build and run it on my router! Currently using up 99% CPU usage and 75Mb RAM downloading all the blocks. It's an un-optimised un-striped debug build that's running under GDB right now, so there's some room for efficiency. Title: Re: F-yeah! (bitcoind port) Post by: jackjack on May 20, 2013, 09:36:33 PM Wow congratulations! Great piece of work
We need this kind of things Title: Re: F-yeah! (bitcoind port) Post by: Mylon on May 20, 2013, 09:45:37 PM I almost feel like grabbing some 20 year old piece of hardware, and forcing BTC to work on that.
Kudos good sir, awesome piece of work, now we can have our routers do something useful besides routing... :P Title: Re: F-yeah! (bitcoind port) Post by: ThomasX on May 20, 2013, 10:28:01 PM I almost feel like grabbing some 20 year old piece of hardware, and forcing BTC to work on that. I'll happily dust off my Commodore 64 when the code is ready. Just for the fun of it. ;D Oh and add some multiplexed sprites and border-interupt flashes that shows the progress in a funky way. And a cool sin/cos text-scroller with greetings, kudos and info of course. I miss all those neat eye-candy stuff from that good old times... Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 20, 2013, 11:54:28 PM Re-compiled a release version and running that now - quite a size difference between unoptimised, unstripped debug version (51Mb) and the release (7.3Mb).
I copied the blockchain over from another computer, otherwise it's probably take a few weeks to sync! Just scanning it on start up took about 15-20 mins. As it is, it's sitting at 135MB RAM and 200MB swap, and peaking up to 70% CPU every few mins. Title: Re: F-yeah! (bitcoind port) Post by: piotr_n on May 21, 2013, 03:21:45 PM Currently using up 99% CPU usage and 75Mb RAM downloading all the blocks. Good job porting it, though let us know when all the blocks are already downloaded & verified.My bet would be on somewhere next year... though probably even never :) Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 12:58:25 PM It's working wonderfully. I think you under estimate the power of routers these days. Some of them are pretty powerful.
Here's the binary, if anyone wants it: https://www.dropbox.com/s/tksm915gzopvtyj/bitcoind-0.8.1-mipsel.tar.bz2 Title: Re: F-yeah! (bitcoind port) Post by: piotr_n on May 22, 2013, 06:03:52 PM It's working wonderfully. I think you under estimate the power of routers these days. Some of them are pretty powerful. Single 600MHz core, with 256 MB of RAM - right?That's why I seriously doubt it. I think you underestimate the power that is needed for a single ECDSA verify calculation, not to mention memory needed to take a real-time care of a database with almost 6 millions of unspent outputs. If you don't believe me, just start it with an empty DB and see by when it catches up. I'm telling you: probably never :) Though the first 100+k blocks should go wonderfully - no doubts about it :) Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 06:56:29 PM I bet you're fun at parties.
I'm aware that it'll probably take a few weeks to sync from scratch, I've already said so, but given it takes 15 mins to verify the last 288 blocks, why do you think never? It really is quite happily working away right now. Title: Re: F-yeah! (bitcoind port) Post by: piotr_n on May 22, 2013, 07:01:57 PM You're welcome to try me at your party ;)
AFAIK, it does not verify the last 288 blocks, per se. It does re-apply transactions from the last blocks at each boot, but without an actual verification their of signatures. Or am I wrong? Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 07:03:34 PM See:
https://en.bitcoin.it/wiki/Running_Bitcoin Quote -checkblocks=<n> How many blocks to check at startup (default: 288, 0 = all) -checklevel=<n> How thorough the block verification is (0-4, default: 3) nb. I've since changed it to 120 @ level 2 for a faster start-up. Title: Re: F-yeah! (bitcoind port) Post by: piotr_n on May 22, 2013, 07:08:05 PM I'm telling you.
I'm not too familiar with the source code, but I know that to verify signatures of the last 288 blocks, using a modern PC, you would need at least a couple of minutes. And since the bitcoin needs less than one minute to boot on my PC, the only explanation is that it does not redo the signatures verification. Just put a debug in CKey::Verify and see it gets printed at startup. Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 07:14:13 PM Title: Re: F-yeah! (bitcoind port) Post by: Abdussamad on May 22, 2013, 07:21:20 PM 256MB is not nearly enough. I ran it on a VPS with 768MB ram and from time to time it would run out of memory and kill bitcoind. You might want to install monit too to restart it automatically should it get killed.
Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 07:31:02 PM There's a 1Gb swap disk.
Title: Re: F-yeah! (bitcoind port) Post by: malevolent on May 22, 2013, 08:33:30 PM From the screenshot I see the CPU load is no longer 99%?
I would be careful if it was to be close to 100% for extended periods of time because routers' CPUs often lack adequate cooling for the heat generated at such loads. Though you may check yours, maybe it has some sensors and maybe you could read them through I2C. Title: Re: F-yeah! (bitcoind port) Post by: P_Shep on May 22, 2013, 09:27:50 PM From the screenshot I see the CPU load is no longer 99%? I would be careful if it was to be close to 100% for extended periods of time because routers' CPUs often lack adequate cooling for the heat generated at such loads. Though you may check yours, maybe it has some sensors and maybe you could read them through I2C. The ASUS RT-N66U there has 2 temp sensors, one on each of the transmitters, which actually don't shift from their usual 50 degC even when the CPU is at 99% load for 20 mins. It only hits 99% occasionally once the initial block scan is done, usually it's 4% or so. The 'Load average' at the top there gives you the 5, 10 and 15 minute averages, where 1.00 is 100% load. Just ran a test of 120 blocks at check level 4, which form this post (https://bitcointalk.org/index.php?topic=141200.msg1504768#msg1504768), means it includes the signature verification. Code: 165952 2013-05-22 19:46:31 Bitcoin version v0.8.1.0-g34d62a8-beta () So 48 min to fully verify 120 blocks. Not the worst... P.S. At check level 2, 120 blocks just takes 3 mins. That's quite tolerable :) Title: Re: F-yeah! (bitcoind port) Post by: piotr_n on May 22, 2013, 09:38:14 PM P.S. At check level 2, 120 blocks just takes 3 mins. That's quite tolerable :) Now were talking - numbers, I like. :)Now imagine that the blocks will be growing in size... not unlikely reaching the max of 1MB around the end of this year... :) This great router, that you are advertising, will not stand a chance with the average 10 min new block mining events, especially if 10 of them appear within 20min period. It will be so laggy, that you will just prefer to not use it, because it will never have the most recent info. Or even if it does, you wont be sure... So my point was that it just won't work. For this kind of hardware better look into solutions that are not actual nodes, but only download transactions that belong to their wallet. This could work. |