clightning-plugins: add trustedcoin

This commit is contained in:
neverupdate 2022-08-27 01:15:22 -03:00 committed by Greg Shuflin
parent 0c4ec63231
commit 925492fc70
3 changed files with 19 additions and 2 deletions

View File

@ -17,6 +17,7 @@ in {
./feeadjuster.nix
./prometheus.nix
./summary.nix
./trustedcoin.nix
./zmq.nix
];

View File

@ -9,7 +9,11 @@ let cfg = config.services.clightning.plugins.trustedcoin; in
type = types.package;
default = config.nix-bitcoin.pkgs.trustedcoin;
defaultText = "config.nix-bitcoin.pkgs.trustedcoin";
description = "The package providing trustedcoin binaries.";
description = ''
The package providing trustedcoin binaries. Trustedcoin will try to
use a bitcoind as a trusted source for getting block data. If this
fails, it will use a trustedcoin providers instead.
'';
};
};

View File

@ -30,6 +30,15 @@ let
This also disables all DNS lookups, to avoid leaking address information.
'';
};
useBcli = mkOption {
type = types.bool;
default = true;
description = ''
If clightning should use the bitcoind as a main source for getting
on-chain block data. Disable this to use a trustedcoin provider (the
trustedcoin plugin will be automatically enabled).
'';
};
dataDir = mkOption {
type = types.path;
default = "/var/lib/clightning";
@ -107,13 +116,16 @@ let
network = bitcoind.makeNetworkName "bitcoin" "regtest";
configFile = pkgs.writeText "config" ''
network=${network}
bitcoin-datadir=${bitcoind.dataDir}
${optionalString (!cfg.useBcli) "disable-plugin=bcli"}
${optionalString (cfg.useBcli) "bitcoin-datadir=${bitcoind.dataDir}"}
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
always-use-proxy=${boolToString cfg.always-use-proxy}
bind-addr=${cfg.address}:${toString cfg.port}
bitcoin-rpcconnect=${nbLib.address bitcoind.rpc.address}
bitcoin-rpcport=${toString bitcoind.rpc.port}
bitcoin-rpcuser=${bitcoind.rpc.users.public.name}
rpc-file-mode=0660
log-timestamps=false
${optionalString (cfg.wallet != null) "wallet=${cfg.wallet}"}