Skip to content

Commit

Permalink
clightning: add TEoS watchtower plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
seberm committed Sep 3, 2022
1 parent 9896fa8 commit e0eae6d
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ NixOS modules ([src](modules/modules.nix))
* [prometheus](https://github.com/lightningd/plugins/tree/master/prometheus): lightning node exporter for the prometheus timeseries server
* [rebalance](https://github.com/lightningd/plugins/tree/master/rebalance): keeps your channels balanced
* [summary](https://github.com/lightningd/plugins/tree/master/summary): print a nice summary of the node status
* [teos-watchtower-plugin](https://github.com/talaia-labs/rust-teos/tree/master/watchtower-plugin): watchtower client plugin to interact with an Eye of Satoshi tower
* [zmq](https://github.com/lightningd/plugins/tree/master/zmq): publishes notifications via ZeroMQ to configured endpoints
* [clightning-rest](https://github.com/Ride-The-Lightning/c-lightning-REST): REST server for clightning
* [lnd](https://github.com/lightningnetwork/lnd) with support for announcing an onion service and [static channel backups](https://github.com/lightningnetwork/lnd/blob/master/docs/recovery.md)
Expand Down
1 change: 1 addition & 0 deletions modules/clightning-plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ in {
./feeadjuster.nix
./prometheus.nix
./summary.nix
./teos-watchtower-plugin.nix
./zmq.nix
];

Expand Down
39 changes: 39 additions & 0 deletions modules/clightning-plugins/teos-watchtower-plugin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ config, lib, ... }:

with lib;
let cfg = config.services.clightning.plugins.teos-watchtower-plugin; in
{
options.services.clightning.plugins.teos-watchtower-plugin = {
enable = mkEnableOption "TEoS - watchtower (clightning plugin)";
package = mkOption {
type = types.package;
default = config.nix-bitcoin.pkgs.teos.teos-watchtower-plugin;
defaultText = "config.nix-bitcoin.pkgs.teos.teos-watchtower-plugin";
description = "The package providing TEoS watchtower plugin binaries.";
};
port = mkOption {
type = types.int;
default = config.services.teos.apiPort;
description = "tower API port.";
};
watchtowerMaxRetryTime = mkOption {
type = types.int;
default = 900;
description = "the maximum time a retry strategy will try to reach a temporary unreachable tower before giving up.";
};
watchtowerProxy = mkOption {
type = types.str;
default = "";
description = "Socks v5 proxy IP address and port for the watchtower client";
};
};

config = mkIf cfg.enable {
services.clightning.extraConfig = ''
plugin=${cfg.package}/bin/watchtower-client
watchtower-port=${toString cfg.port}
watchtower-max-retry-time=${toString cfg.watchtowerMaxRetryTime}
watchtower-proxy="${cfg.watchtowerProxy}"
'';
};
}
1 change: 0 additions & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let self = {
secp256k1 = pkgs.callPackage ./secp256k1 { };
spark-wallet = pkgs.callPackage ./spark-wallet { };
teos = pkgs.callPackage ./teos { };
teos-watchtower-plugin = pkgs.callPackage ./teos { };

nbPython3Packages = (pkgs.python3.override {
packageOverrides = import ./python-packages self;
Expand Down
1 change: 1 addition & 0 deletions test/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ let
sendpay-success = tcpEndpoint;
sendpay-failure = tcpEndpoint;
};
teos-watchtower-plugin.enable = true;
};
})
];
Expand Down

0 comments on commit e0eae6d

Please sign in to comment.