menu
search

Blogs & Articles: Run c-lightning on OpenBSD ⚡️ 🔗 3 years ago

grubles on Medium

Running c-lightning on OpenBSD ⚡️🐡

Power your Lightning node with OpenBSD to reduce its attack surface

The Lightning Network has grown tremendously since it reached the Bitcoin mainnet back in early 2018. The network is slowly reaching maturity with all implementations now in beta and new features being added steadily — like multi-path payments, keysend, large Wumbo channels, and new privacy improvements.

Exciting new features like Wumbo channels and Multi-Part Payments (MPP) coming to the Lightning Network also means we have a bigger need to fortify the systems our nodes are running on. Large amounts of BTC in a hot wallet is a sure bet for attracting unwanted attention. So it’s best to be proactive and research ways to reduce the attack surface of the systems that your BTC sits on.

Up and to the right screenshot from https://txstats.com/dashboard/db/lightning-network?orgId=1&from=now-5y&to=now

Since nodes are securing more and more BTC, it may be a good time to consider minimizing the amount of extra running code on your node’s operating system. A famously minimalist operating system is OpenBSD.

OpenBSD is an operating system (like Windows or Linux) focused on minimizing security faults in its code. Commonly used to power firewalls and routers as a first line of defense, it’s also suitable for servers and can even be used as a workstation OS. It runs on all of the popular CPU architectures like x86 and ARM (for those running nodes on Raspberry Pis) as well.

A Lightning node has to be exposed to the internet in order to accept incoming channel requests, so OpenBSD could be a good fit. In this post, I put together a quick guide for compiling c-lighting on OpenBSD. Both Bitcoin Core and c-lightning run on OpenBSD with no modifications, so the process is simple!

Build and install c-lightning

Make sure you’ve installed bitcoind since c-lightning requires it. Bitcoin Core ships instructions for building and installing bitcoind on OpenBSD.

From there, the process for compiling and installing c-lightning is relatively straightforward. Open the terminal, and enter the following commands one-by-one.

pkg_add git python gmake py3-pip libtool gmp
git clone https://github.com/elementsproject/lightning
cd lightning && git checkout v0.9.3
pkg_add automake # pick the highest version e.g. 1.16.2
pkg_add autoconf # pick the highest version e.g. 2.69p2
pip3.7 install --user mako
pip3.7 install --user mrkd
export PATH=$PATH=/home/<your username>/.local/bin
export AUTOCONF_VERSION=2.69
export AUTOMAKE_VERSION=1.16
./configure
PYTHON3_VERSION=3 gmake
gmake install # as root

Once you’ve built and installed c-lightning, it’s just a matter of starting up Bitcoin Core and syncing the Bitcoin blockchain. Then, just as you would on a Linux distro, you can fire up lightningd to start opening Lightning channels!

If you encounter any bugs, please open an issue on Github. To learn more about c-lightning, check out the extensive documentation.

Also, be sure to join us on IRC (#c-lightning on Freenode) and Telegram too!

Run c-lightning on OpenBSD ⚡️🐡 was originally published in Blockstream Engineering Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

More from this author

15th April 2022 03:40

17th March 2022 09:17

3rd February 2022 01:44

21st September 2021 03:04

29th April 2021 07:09

24th February 2021 06:18

9th February 2021 05:05

17th December 2020 12:48

11th August 2020 02:45

30th October 2019 04:05

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