menu
search

Blogs & Articles: Lightning Routing Node Starter Pack 🔗 5 years ago

Pierre Rochard on Medium

This starter pack is for Bitcoiners who want to run a reliable Lightning routing node from home. You could set up your routing node on someone else’s cloud server, but that wouldn’t be very self-sovereign!

This starter pack is not for Bitcoiners who just want to send and receive payments with a non-routing Lightning node.

Routing vs non-routing

A routing node is a node with channels that are publicly advertised, broadcasted, as being available to potentially route payments for others on the network.

A non-routing node is a node with only “private” channels, the existence of a private channel is only known to the two nodes it is connecting. Non-routing node and their channels do not appear on the public Lightning network.

A node that is not reliably online or not rebalancing its channels should be non-routing and should not have public channels. Otherwise, the node is wasting gossip network resources, causing payment routing failures, and if it’s not using Tor then it may be needlessly violating the node operator’s privacy by leaking their IP address.

A routing node should be trying to maximize its uptime and rebalancing channels to ensure sufficient liquidity for payments to flow. This guide will focus on the uptime part of the equation, as I am clueless on rebalancing channels (if you have resources on that, please tweet them at me!).

Hardware Reliability

Computers can be fragile or robust, it really depends on what components are used and how they are configured.

Memory: you’ll want to use ECC RAM

https://www.pugetsystems.com/labs/articles/Advantages-of-ECC-Memory-520/

In systems without ECC, an error can lead either to a crash or to corruption of data; in large-scale production sites, memory errors are one of the most common hardware causes of machine crashes. https://en.wikipedia.org/wiki/ECC_memory

Generally it’s only high-end workstations and servers that have ECC RAM. The good news is that there are lots of used systems available for <$300 on eBay! You don’t need the latest and greatest hardware, as bitcoind and LND are not that resource intensive day to day, you just need reliable hardware!

Seth "not a bot" 586 ⚡🇺🇸 on Twitter

@pierre_rochard Search eBay for "server E3 V3", lots of last gen servers/workstations with Xeon, ECC ram for $200-300 bucks. Add battery backup for orderly shutdowns on power loss. Run a ZFS or btrfs raid on Linux or FreeNAS. Enterprise quality, stability, and affordable!

Hard drives: HGST

HGST drives continue to impress as far as overall AFR rates and this isn’t the first year that’s been true. Overall, these are some of the most reliable drives over time that Backblaze has tested. The complete AFR rate over all five years is 1.68 percent — higher than the 2018 data alone, but still within a very reasonable window. https://www.extremetech.com/extreme/175089-who-makes-the-most-reliable-hard-drives

Partitions: ZFS mirroring

One major feature that distinguishes ZFS from other file systems is that it is designed with a focus on data integrity by protecting the user’s data on disk against silent data corruption caused by data degradation, current spikes, bugs in disk firmware, phantom writes (the previous write did not make it to disk), misdirected reads/writes (the disk accesses the wrong block), DMA parity errors between the array and server memory or from the driver (since the checksum validates data inside the array), driver errors (data winds up in the wrong buffer inside the kernel), accidental overwrites (such as swapping to a live file system), etc.

ZFS is a battle-hardened file system, and setting it up with disk mirroring is simple with this tutorial for Ubuntu: https://tutorials.ubuntu.com/tutorial/setup-zfs-storage-pool#0

You’d have a pretty resilient system with ECC RAM and 2+ HGST hard drives set up for ZFS mirroring! We can make it even more reliable by powering it with an Uninterrupted Power Supply (UPS) battery.

Electricity

Entry level UPS from Amazon, ~$90

There are two separate issues with a power outage or brown out.

First, it’s smart to put both your node hardware and your internet router on the UPS, as you may still have internet access despite a power outage. In this case, you’ll want a UPS with a great battery so you can stay online long enough for power to be re-established (if this takes longer than a few hours, then you’ve got other things to worry about than your routing node!).

Second, if you do lose internet access during a power outage, then you’ll want your node to shut down gracefully as a sudden loss of power can cause data loss. You could either try to remember to shut it down manually, or you can connect the UPS via USB to your node and have the UPS automatically shut it down.

Internet

Most homes only have one ISP, but in a lot of places they are not a monopoly, so you could subscribe to two or more ISPs to have redundancy there.

Another thing I’ve notices is that fiber connections with FIOS or Google are more reliable than cable/ADSL connections, so upgrade your internet!

Laptop vs Rack

NVK on Twitter

@pierre_rochard @matt_odell May I suggest a cheap 1u server of any kind with dual power supply redundancy. Will make your life a lot easier. You will need a UPS or a internal UPS but, in a lot of budget PCs the PSU is a problem.

NVK on Twitter

@pierre_rochard @matt_odell When trying to achieve uptime, rack hardware has most of the stuff you need as its designed for that. Home grade stuff ends up costing more all in. Another nice thing to use is fanless lower speed CPUs.

Joe Rodgers on Twitter

@nvk @pierre_rochard @matt_odell If you don't want a rack in your house, they're kinda big, look into the HP Proliant ML350. They are tower based systems but have all the redundancy you're looking for.

アナキスト - (The Anarchist) on Twitter

@pierre_rochard OR a used Panasonic Toughbook with an industrial grade 512GB SSD. Built in UPS, weatherproof, quiet, built in monitor and keyboard. Get one with an LTE modem and you get automatic network failover as well.

If you have any other ideas or suggestions for node reliability, tweet at me!

Lightning Routing Node Starter Pack was originally published in Lightning Power Users on Medium, where people are continuing the conversation by highlighting and responding to this story.

More from this author

20th June 2022 01:14

21st February 2021 02:36

15th December 2020 02:00

6th April 2019 03:35

3rd April 2019 12:17

28th January 2019 07:28

19th January 2019 08:29

18th January 2019 04:43

Feel free to send a tip using tippin.me

Or alternatively you can send a few sats directly:

btc logo BTC ln logo BTC (Lightning)

btc tip qr

33ELQ1ye29gB6YVQY6zRLFVCNYkJez9jMh

lightning tip qr

lnurl1dp68gurn8ghj7cm0d9hxxmmjdejhytnfduhkcmn4wfkz7urp0yhn2vryv5ukvdm995ckydph956rvv3h94sk2dny95mkgv34xdsnvvrpv4jxz6whyrn