Porting Ethereum – geth running on Samsung Gear S2 smartwatch. eth coming soon

Back in early June of this year I made a build of ethereumj-android on my Mac, ran it on my Samsung Galaxy S6 and made a video which was pretty popular on the Ethereum sub-reddit at the time:

That was just my first step on a journey towards a Light Client for the Samsung Gear S2 smartwatch (and various other mobile/wearable Linux devices).

Samsung-Gear-S2-AH-faces-1-1600x1067

That aim has come closer to fruition this week, with a working (full node) geth on device, and getting an eth executable on device.   We’re still working through runtime issues on the eth executable, but it’s very close now.

Nearly all of the credit for geth porting lies with Péter Szilágyi and his majestic xgo CGO cross-compilation solution.   We really didn’t have any work to do on geth itself.   There is still a sporadic crash to chase, but it’s workable.

peter

The block-chain download is slow on the smartwatch, but the main issue is storage space, with only 4Gb of on-device storage.   The Morden test-network fits, but the Frontier main network is already too big.   There is no big surprise here.   The need for a Light Client is the motivator this whole project, but getting the full client working on device is a good step in that direction, because the infrastructure is now ready and waiting for the Light Client protocol to take shape.   Geth is particularly important to get working, because it is the Ethereum client which will get Light Client support first.

While it is great to see a working client on-device, the larger progress which we’ve made which is on the cusp of completion is adding cross-compilation support for eth, the C++ client.   Having C++ cross-compilation is critical for resource-constrained platforms which cannot support compilation on-device.   The performance and universal reach of C++ will also be very important in bringing Ethereum to the very smallest IoT and embedded platforms.

Anthony Cros is sub-contracting for doublethinkco, and has done 90%+ of the work.  The C++ side has been quite the battle!    I’d just like to publicly thank Anthony for all of the blood, sweat and tears he has poured into this work over the last couple of months.   I know he will be very happy and relieved when we get eth running 🙂

anthony-cros

Tizen has been a test-case for us, because it doesn’t support native compilation even on mobile, let alone wearable.   We tried to get that working, but it was a dead-end.   So then we flipped to cross-builds, first on the TM1 developer phone, and then just in the last days on the Gear S2 itself.

samsung-gear-s2-press-169

The cross-compilation support consists of:

So it looks like this porting tangent has gone much as I expected it might when we started on it just under two months ago.   We will continue to work with EthEmbedded and SlockIt to ensure that the C++ cross-builds are working for all platforms of interest, and to get the cross-build support upstreamed.   We’ve not started on Sailfish OS and Ubuntu Phone ports, but they will be very similar to Tizen, and may even “just work”.

After that, I hope that we can make some more direct contributions towards the Light Client implementations, starting with geth as Zsolt described at devcon1 yesterday:

Screen Shot 2015-11-13 at 12.20.58 AM

When those come to fruition we can all go and build some cool DAPPS for smartwatches and the 50 billion smart-devices which allegedly will be making their way into the world by 2020.

For months, I have been trying to push in the direction which SlockIt teased and delighted us all with a devcon1 today – bringing block-chain technology to small Internet-connected devices:

Wearables, IoT, smart-devices, embedded systems.   We are heading into a very connected future.   I want that future to be decentralized and under our control.

Hold on to your hats!   We’ll be there soon 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s