diff --git a/modules/faraday.nix b/modules/faraday.nix index dd4140b0a..d82dc638e 100644 --- a/modules/faraday.nix +++ b/modules/faraday.nix @@ -6,6 +6,7 @@ let cfg = config.services.faraday; inherit (config) nix-bitcoin-services; secretsDir = config.nix-bitcoin.secretsDir; + network = config.services.bitcoind.network; in { options.services.faraday = { @@ -56,7 +57,7 @@ in { ${cfg.package}/bin/faraday \ --rpclisten=${cfg.rpclisten} \ --rpcserver=${config.services.lnd.listen}:10009 \ - --macaroondir=${config.services.lnd.dataDir}/chain/bitcoin/mainnet \ + --macaroondir=${config.services.lnd.dataDir}/chain/bitcoin/${network} \ --tlscertpath=${secretsDir}/lnd-cert \ ${cfg.extraArgs} ''; diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 4139900d5..9d7565339 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -249,6 +249,10 @@ in { id = 27; connections = [ "lnd" ]; }; + faraday = { + id = 28; + connections = [ "lnd" ]; + }; }; services.bitcoind = { @@ -293,30 +297,7 @@ in { services.joinmarket.cliExec = mkCliExec "joinmarket"; systemd.services.joinmarket-yieldgenerator.serviceConfig.NetworkNamespacePath = "/var/run/netns/nb-joinmarket"; -<<<<<<< HEAD services.joinmarket-ob-watcher.address = netns.joinmarket-ob-watcher.address; } ]); -======= - # loop: Custom netns configs - services.lightning-loop = mkIf config.services.lightning-loop.enable { - rpclisten = "${netns.lightning-loop.address}:11010"; - restlisten = "${netns.lightning-loop.address}:8081"; - cli = pkgs.writeScriptBin "loop" - # Switch user because lnd makes datadir contents readable by user only - '' - netns-exec nb-lightning-loop sudo -u lnd ${config.services.lightning-loop.package}/bin/loop --rpcserver ${config.services.lightning-loop.rpclisten} "$@" - ''; - }; - # faraday: Custom netns configs - services.faraday = mkIf config.services.faraday.enable { - rpclisten = "${netns.faraday.address}:8465"; - cli = pkgs.writeScriptBin "frcli" - # Switch user because lnd makes datadir contents readable by user only - '' - netns-exec nb-faraday sudo -u lnd ${config.services.faraday.package}/bin/frcli --rpcserver ${config.services.faraday.rpclisten} "$@" - ''; - }; - }; ->>>>>>> c251e46 (loop: add rpclisten and restlisten options) } diff --git a/pkgs/default.nix b/pkgs/default.nix index fcf8bc40c..3ae9a90d5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,6 +11,7 @@ let self = { netns-exec = pkgs.callPackage ./netns-exec { }; lightning-loop = pkgs.callPackage ./lightning-loop { }; lightning-pool = pkgs.callPackage ./lightning-pool { }; + faraday = pkgs.callPackage ./faraday { }; extra-container = pkgs.callPackage ./extra-container { }; clightning-plugins = import ./clightning-plugins pkgs self.nbPython3Packages; clboss = pkgs.callPackage ./clboss { }; @@ -18,7 +19,6 @@ let self = { nbPython3Packages = (pkgs.python3.override { packageOverrides = pySelf: super: import ./python-packages self pySelf; }).pkgs; - faraday = pkgs.callPackage ./faraday { }; pinned = import ./pinned.nix; diff --git a/pkgs/faraday/default.nix b/pkgs/faraday/default.nix index f844a6d12..8928547ea 100644 --- a/pkgs/faraday/default.nix +++ b/pkgs/faraday/default.nix @@ -2,17 +2,17 @@ buildGoModule rec { pname = "faraday"; - version = "0.2.0-alpha"; + version = "0.2.3-alpha"; src = fetchurl { url = "https://github.com/lightninglabs/faraday/archive/v${version}.tar.gz"; # Use ./get-sha256.sh to fetch latest (verified) sha256 - sha256 = "58cdb977909e2188837ee0d00ec47a520baeb3bb09719ea6e1fe23efb9283d06"; + sha256 = "c016e2b16160f24abdfce0f71cdb848da3e3d78cff450fb353017d4104bd616e"; }; subPackages = [ "cmd/faraday" "cmd/frcli" ]; - vendorSha256 = "1vmspdlh018p453rbif5yc2fqjipnz012rlbilwcrkjric24qbsk"; + vendorSha256 = "1hh99nfprlmhkc36arg3w1kxby59i2l7n258cp40niv7bjn37hrq"; meta = with lib; { description = " Faraday: Lightning Channel Management & Optimization Tool"; diff --git a/pkgs/faraday/get-sha256.sh b/pkgs/faraday/get-sha256.sh old mode 100755 new mode 100644 index 67473cf2e..6f5cf2777 --- a/pkgs/faraday/get-sha256.sh +++ b/pkgs/faraday/get-sha256.sh @@ -1,5 +1,6 @@ -# /bin/bash - +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p git gnupg +set -euo pipefail TMPDIR="$(mktemp -d -p /tmp)" trap "rm -rf $TMPDIR" EXIT