Circuit Breaker — Self-Hosted, Open-Source

It allows nodes to protect themselves from being flooded with HTLCs. With circuitbreaker a maximum to the number of in-flight HTLCs can be set on a per-peer basis. Known and trusted peers for example can be assigned a higher maximum, while a new channel from a previously unseen node may be limited to only a few pending HTLCs. Furthermore it is possible to apply rate limits to the number of forwarded HTLCs. This offers protection against DoS/spam attacks that rely on large numbers of fast-resolving HTLCs. Rate limiting is implemented with a Token bucket. Via the UI the minimum interval between HTLCs can be specified. Large numbers of HTLCs are also required for probing channel balances. Reducing the information leakage through probing could be another reason to put in place a rate limit for untrusted peers. Operating modes There are multiple modes in which circuitbreaker can operate. A default mode and per-peer overrides can be configured via the web ui: - fail: Fail back HTLCs when limits are exceeded. This minimizes the lock-up of liquidity on the incoming side, but does affect your reputation as a routing node. - queue: Queue HTLCs when limits are exceeded. Items are popped from the queue when the number of pending HTLCs is below the maximum and the rate limit allows another forward. This mode penalizes upstream nodes for the bad traffic that the deliver by locking up liquidity along the route. This may push upstream nodes to install a firewall too and constrain the mishaving node. Even in case of circuit breaker malfunction, queue mode should never cause channel force closes because of lnd's built-in protection that auto-fails HTLCs that aren't resolved. WARNING: Auto-fail is not yet released and scheduled for lnd 0.16. With earlier lnd versions, you risk force-closes! - queue_peer_initiated: This mode is also queuing HTLCs, but only those that come in through channels for which we aren't the channel open initiator. Not being the initiator means that...

License: MIT. Built with: Go, TypeScript, HTML, JavaScript, Dockerfile, Makefile, Shell, CSS. Website: https://github.com/joostjager. Source: https://github.com/lightningequipment/circuitbreaker.

How to install Circuit Breaker

Most self-hosted apps including Circuit Breaker install through Docker or Docker Compose. The typical workflow is: install Docker on your host, pull the official image (or clone the repository), supply a configuration file with database credentials and storage paths, then start the container. Many homelabbers run Circuit Breaker alongside other self-hosted services behind a reverse proxy like Caddy, Traefik, or nginx-proxy-manager for HTTPS and routing. Check the official repository for the most current instructions.

Why self-host Circuit Breaker

Self-hosting gives you three things SaaS can’t: data ownership (the files live on disks you control), cost predictability (a one-time setup vs. recurring per-seat fees that grow with your household or team), and longevity (open-source means the app keeps working even if the maintainers move on, since you can pin a working version). The trade-off is that you take on the operational work of running a server, applying updates, and handling backups.

What hardware do you need

Most self-hosted apps run comfortably on modest hardware — a Raspberry Pi 4, a mini PC, a NAS with Docker support, or a small VPS is usually enough for personal or family use. CPU and RAM requirements scale with how many simultaneous users or how much data you push through Circuit Breaker. Storage requirements depend on the kind of data you keep; check the README for guidance on data retention.

Where to go from here