News from the cheapnode project

A lot has happened in the past half year or so since the last post. Most of it has been reported on twitter before, but here’s a summary in case you want to follow along:

  • After my first “high endurance” 128GB card died, I have been using one by SanDisk successfully for months. It should have about 3 TB written on it and is still going strong.
  • LND’s channel backup mechanism wasn’t as robust as I believed. When that first card died, of course it took with it all the channel state. Unfortunately, I still have three channels in limbo states that might never be salvageable, because it turns out that the SCB protocol really doesn’t work if the other side doesn’t support it/have your data. This should work better now, but alas, too late for my funds. So much for cheap node.
  • I have managed to add native packages for both bitcoin and LND to Termux. So now you can just do “pkg install lnd”, and magically all will be installed. No more proot. It’s actually very easy. The process of compiling this hasn’t been easy at all for me. I’ve learned a lot about build systems, Termux, and bitcoin in the process (Thank you to the Termux, bitcoin core, and ABCore devs!), and even had my first little bitcoin pull request merged. And it’s been humbling to see how thoroughly this seemingly trivial change has been reviewed!
  • I have even managed to add runit scripts to both packages (and I also have similar scripts for EPS and RTL, but I haven’t published these so far), so if you do “pkg install termux-services” and restart Termux once, you can then just do “sv-enable bitcoind”, “sv-enable lnd”, and you’ll have nice services running that even restart themselves when they get killed.
  • With these scripts, the node has been running fairly smoothly during the past months. There have been about two times that the entire setup has been shut down anyway which I cannot account for, but aside from that, it’s chugging along. Other people who have tried to replicate my experience haven’t been so happy. It seems different devices/Android mods behave differently.
  • I have been able to measure that my Sony Z node uses less than 2W on average. So if we don’t count my reckless Lightning funds loss, I’m pretty sure this is still the cheapest (and most environmentally friendly) node both in hardware and power usage.
  • Another thing I’ve learned is that you can do “termux-wake-lock” inside Termux itself to acquire a wake-lock. One click less necessary.
  • What I’ve so far only been able to do within Android itself, but is really useful, is chosing a fixed IP address manually. Before that, I would sometimes get assigned random new addresses. Bitcoin and LND don’t really care (they run over TOR anyway), but it’s annoying if you can’t reach your node via ssh anymore.
  • So now we’re at a state where a setup script should be relatively simple. I have to admit I haven’t written that yet. That’s another goal for the new year I guess. I definitely plan to open a git repo for this, but if you have written any scripts yourself, you can already send them to me for putting them there.
  • If we’re going to do this, we really need a nice name for it. Freenode is kind of taken. I was thinking cheapnode, but if you have any alternative ideas, let me know!
  • I have learned that Termux is going to abandon their android-5 branch. That makes things easier on one hand, because I’ve actually hit a bug in bitcoind that means I’ve been needing to do different build strategies for android-5 and master. On the other hand, it means that with the beginning of the new year, my device (and anything pre-Android-7) will be unsupported. Which will probably mean flashing https://lineageos.org/, for getting Android 8.1. Which would be the perfect opportunity for testing a newly written setup script then.
  • I should also mention that other projects have achieved quite impressive full node setups on Android devices. Notably, ABCore keeps getting better (though I still haven’t been able to move my blockchain to an SD card with this one), and Nayuta might now be the easiest way of running a full-node-backed Lightning node on an Android device. Or, you could even just buy a ready-made full-node phone from HTC. Plus, contrary to my predictions, Udi Wertheimer’s talk at the Lightning Conference gave some good arguments why a full node on an Android device that you actually carry around in your pocket might not be such a bad idea, if you are using it specifically for backing a Lightning node. So I’m really glad that the full-node-on-Android space is thriving; it makes me hopeful that the next million full nodes are coming! I still think that our little project is carving out a useful niche for parsimonious people like me who also appreciate the command line.

That’s all I have for now. Here’s to building the cheapest full node on earth into the new decade! 🥂

Leave a Reply

Your email address will not be published. Required fields are marked *