diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index c1bc1e7..9e4b306 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -27,6 +27,7 @@ let ${lib.concatMapStrings (node: "addnode=${node}\n") cfg.addnodes} # RPC server options + ${optionalString (cfg.rpcthreads != null) "rpcthreads=${toString cfg.rpcthreads}"} rpcport=${toString cfg.rpc.port} rpcwhitelistdefault=0 ${concatMapStringsSep "\n" @@ -66,7 +67,6 @@ in { default = ""; example = '' par=16 - rpcthreads=16 logips=1 ''; description = "Additional configurations to be appended to bitcoin.conf."; @@ -140,6 +140,11 @@ in { ''; }; }; + rpcthreads = mkOption { + type = types.nullOr types.ints.u16; + default = null; + description = "Set the number of threads to service RPC calls"; + }; rpcbind = mkOption { type = types.listOf types.str; default = [ "127.0.0.1" ]; diff --git a/modules/presets/secure-node.nix b/modules/presets/secure-node.nix index 9320e08..065bbb6 100644 --- a/modules/presets/secure-node.nix +++ b/modules/presets/secure-node.nix @@ -73,6 +73,9 @@ in { discover = false; addresstype = "bech32"; dbCache = 1000; + # higher rpcthread count due to reports that lightning implementations fail + # under high bitcoind rpc load + rpcthreads = 16; rpc.users.privileged = { name = "bitcoinrpc"; # Placeholder to be sed'd out by bitcoind preStart