From 1935c252eca5cda5450ef9ecd3a0cf1f1e83bc20 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 16 Oct 2020 17:43:06 +0200 Subject: [PATCH] lnd: remove redundant option 'bitcoind-host' Also set bitcoind rpc port. --- modules/lnd.nix | 14 ++++---------- modules/netns-isolation.nix | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/lnd.nix b/modules/lnd.nix index 9cf87cd..5f74202 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -8,6 +8,7 @@ let secretsDir = config.nix-bitcoin.secretsDir; bitcoind = config.services.bitcoind; + bitcoindRpcAddress = builtins.elemAt bitcoind.rpcbind 0; onion-chef-service = (if cfg.announce-tor then [ "onion-chef.service" ] else []); mainnetDir = "${cfg.dataDir}/chain/bitcoin/mainnet"; configFile = pkgs.writeText "lnd.conf" '' @@ -27,7 +28,7 @@ let tor.active=true ${optionalString (cfg.tor-socks != null) "tor.socks=${cfg.tor-socks}"} - bitcoind.rpchost=${cfg.bitcoind-host} + bitcoind.rpchost=${bitcoindRpcAddress}:${toString bitcoind.rpc.port} bitcoind.rpcuser=${bitcoind.rpc.users.public.name} bitcoind.zmqpubrawblock=${bitcoind.zmqpubrawblock} bitcoind.zmqpubrawtx=${bitcoind.zmqpubrawtx} @@ -83,13 +84,6 @@ in { default = 8080; description = "Port on which to listen for REST connections."; }; - bitcoind-host = mkOption { - type = types.str; - default = "127.0.0.1"; - description = '' - The host that your local bitcoind daemon is listening on. - ''; - }; tor-socks = mkOption { type = types.nullOr types.str; default = null; @@ -162,8 +156,8 @@ in { ]; services.bitcoind = { - zmqpubrawblock = "tcp://${cfg.bitcoind-host}:28332"; - zmqpubrawtx = "tcp://${cfg.bitcoind-host}:28333"; + zmqpubrawblock = "tcp://${bitcoindRpcAddress}:28332"; + zmqpubrawtx = "tcp://${bitcoindRpcAddress}:28333"; }; services.onion-chef.access.lnd = if cfg.announce-tor then [ "lnd" ] else []; diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 07360be..aa664cd 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -279,7 +279,6 @@ in { "${netns.lnd.address}" "127.0.0.1" ]; - bitcoind-host = netns.bitcoind.address; cliExec = mkCliExec "lnd"; };