Running Electrum on a Raspberry Pi

Posted on May 29, 2013


Man, it’s been a while. Sorry readers, been pretty busy recently on other projects. Including getting a new Raspberry Pi up and running.

The main aim of the Pi is as a “personal server” (servant?), to run little dev sites and other utils such as tt-rss on it – nothing too demanding. But after getting a brief donation to support the tt-rss install, it made sense to try to get Bitcoin running on it too.

After some quick looking around, I decided to try out Electrum, a lightweight client which acts as a thin-client – which means it doesn’t store its own copy of the blockchain, but connects to one stored elsewhere. It also claims to have a text-only mode, which I thought’d be useful as the Pi is running without a display, and I SSH in.

Installation was a piece of, uh, pie, following the two-step instructions for Linux. I then tried to run electrum in text mode using

    electrum -g text

while SSH’d in. But no luck – the screen blanked, and I lost my cursor. Bah.

So it looks like you have to run Electrum as a GUI client the first time, or something. Which meant doing some X-forwarding into OSX. If you’re running on OSX or Linux then this is pretty straightforward. Windows users have some options, I think.

With XQuartz installed, I ran up an xterm (Applications > Utilities > XQuartz, then “Terminal” from the “Applications” menu) – although a normal terminal probably works too and ran the following to allow X Forwarding:

    xhost +raspberrypi

(“raspberrypi” is my Pi’s domain.)

It was then easy enough to SSH in:

    ssh -X pi@raspberrypi

And run “electrum” from the command line, which prompted me to remember/securely save a wallet seed as back-up, connect to an Electrum server, and brought up the main window in OSX. Pretty, huh?

1 - opening screen

Electrum sets up a handful of addresses to start with. You can right-click any of these to get more info, or to view a QR code of the public key:

2 - qr code

To give it a test, I ran up my Android app, scanned the QR code, and added the donation I was sent earlier:

3 - sending

Within a second or so, Electrum picked up the broadcast transaction:

4 - received

And finally, I quit the program and ran it again but with the text GUI, as I tried originally. Success this time around:

5 - text mode

Awesome – I have a new Bitcoin client running. I haven’t seen any evidence of an API for it yet, but look forward to playing with some of the offline functionality, and maybe some brainwallet stuff to send Bitcoins through the post.

If anyone’s interested in alpha-testing the tt-rss instance in return for small donations, drop me a message. Or if you just found this useful, why not drop me a tip at the address above ( 1CAvDRJAfvtJgfFX7aSHTznSMxGTHxBtR3 )?

Posted in: How-to, Reviews