trustedcoin: update to v0.6.1

This commit is contained in:
Otto Sabart 2023-03-03 21:00:00 +01:00
parent 5b5e76931d
commit 8c00c26fa1
No known key found for this signature in database
GPG Key ID: 823BAE99F8BE1E3C
3 changed files with 7 additions and 19 deletions

View File

@ -9,17 +9,14 @@ let cfg = config.services.clightning.plugins.trustedcoin; in
type = types.package;
default = config.nix-bitcoin.pkgs.trustedcoin;
defaultText = "config.nix-bitcoin.pkgs.trustedcoin";
description = mdDoc ''
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.
'';
description = mdDoc "The package providing trustedcoin binaries.";
};
};
config = mkIf cfg.enable {
services.clightning.extraConfig = ''
plugin=${cfg.package}/bin/trustedcoin
disable-plugin=bcli
'';
};
}

View File

@ -30,15 +30,6 @@ let
This also disables all DNS lookups, to avoid leaking address information.
'';
};
useBcli = mkOption {
type = types.bool;
default = true;
description = mdDoc ''
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";
@ -116,8 +107,7 @@ let
network = bitcoind.makeNetworkName "bitcoin" "regtest";
configFile = pkgs.writeText "config" ''
network=${network}
${optionalString (!cfg.useBcli) "disable-plugin=bcli"}
${optionalString (cfg.useBcli) "bitcoin-datadir=${bitcoind.dataDir}"}
${optionalString (!cfg.plugins.trustedcoin.enable) "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}
@ -173,6 +163,7 @@ in {
{
cat ${configFile}
echo "bitcoin-rpcpassword=$(cat ${config.nix-bitcoin.secretsDir}/bitcoin-rpcpassword-public)"
${optionalString (cfg.getPublicAddressCmd != "") ''
echo "announce-addr=$(${cfg.getPublicAddressCmd}):${toString publicPort}"
''}

View File

@ -2,15 +2,15 @@
buildGoModule rec {
pname = "trustedcoin";
version = "0.5.2";
version = "0.6.1";
src = fetchFromGitHub {
owner = "nbd-wtf";
repo = pname;
rev = "v${version}";
sha256 = "sha256-s8zgY+TDABK96BehY+SVl86wCMd+e8BKdxw0kGV1jAI=";
sha256 = "sha256-UNQjxhAT0mK1In7vUtIoMoMNBV+0wkrwbDmm7m+0R3o=";
};
vendorSha256 = "sha256-wpK5SW9nOMO/e4DoEk8LRxLykxYt06LoBBxjeEujOiU=";
vendorSha256 = "sha256-xvkK9rMQlXTnNyOMd79qxVSvhgPobcBk9cq4/YWbupY=";
subPackages = [ "." ];