From 480d0d3959aac60a3d6e3dae61a8cc6ad8bc3597 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 28 Sep 2020 13:09:05 +0200 Subject: [PATCH] liquid: fix bitcoin rpc settings - Remove redundant option mainchainrpchost. This option is already provided by bitcoind. - Set a working default for rpcport and rpcuser. Enables use without secure-node. --- modules/liquid.nix | 13 +++---------- modules/netns-isolation.nix | 1 - modules/presets/secure-node.nix | 4 ---- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/modules/liquid.nix b/modules/liquid.nix index e3b4de3..e9ddee9 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -30,7 +30,9 @@ let ${lib.concatMapStrings (rpcallowip: "rpcallowip=${rpcallowip}\n") cfg.rpcallowip} ${optionalString (cfg.rpcuser != null) "rpcuser=${cfg.rpcuser}"} ${optionalString (cfg.rpcpassword != null) "rpcpassword=${cfg.rpcpassword}"} - ${optionalString (cfg.mainchainrpchost != null) "mainchainrpchost=${cfg.mainchainrpchost}"} + mainchainrpchost=${builtins.elemAt config.services.bitcoind.rpcbind 0} + mainchainrpcport=${toString config.services.bitcoind.rpc.port} + mainchainrpcuser=${config.services.bitcoind.rpc.users.public.name} # Extra config options (from liquidd nixos service) ${cfg.extraConfig} @@ -146,15 +148,6 @@ in { default = null; description = "Password for JSON-RPC connections"; }; - mainchainrpchost = mkOption { - type = types.nullOr types.str; - default = null; - description = '' - The address which the daemon will try to connect to the trusted - mainchain daemon to validate peg-ins. - ''; - }; - testnet = mkOption { type = types.bool; default = false; diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index d81b780..a85d3db 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -295,7 +295,6 @@ in { rpcallowip = [ "127.0.0.1" ] ++ map (n: "${netns.${n}.address}") netns.liquidd.availableNetns; - mainchainrpchost = netns.bitcoind.address; cliExec = mkCliExec "liquidd"; }; diff --git a/modules/presets/secure-node.nix b/modules/presets/secure-node.nix index fbbcb05..f7320e6 100644 --- a/modules/presets/secure-node.nix +++ b/modules/presets/secure-node.nix @@ -102,10 +102,6 @@ in { services.liquidd = { rpcuser = "liquidrpc"; prune = 1000; - extraConfig = '' - mainchainrpcuser=${config.services.bitcoind.rpc.users.public.name} - mainchainrpcport=8332 - ''; validatepegin = true; listen = true; proxy = cfg.tor.client.socksListenAddress;