Blogs & Articles: Lightning Routing Node Starter Pack đ 5 years ago
- Category: Blogs & Articles | Pierre Rochard on Medium
- Author(s): Pierre Rochard
- Published: 23rd February 2019 21:59
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.