From 1408403decedd3e5b8772dedc2f35af79c817c7a Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 26 Aug 2020 21:15:35 +0200 Subject: [PATCH] bitcoind: clarify how bitcoin-cli RPC access is enabled It's not immediately clear why rpcuser/rpcpassword are needed in addition to the rpcauth config entries. --- modules/bitcoind.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index d62ca35..c7bcd14 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -38,8 +38,6 @@ let } ${lib.concatMapStrings (rpcbind: "rpcbind=${rpcbind}\n") cfg.rpcbind} ${lib.concatMapStrings (rpcallowip: "rpcallowip=${rpcallowip}\n") cfg.rpcallowip} - # Credentials for bitcoin-cli - rpcuser=${cfg.rpc.users.privileged.name} # Wallet options ${optionalString (cfg.addresstype != null) "addresstype=${cfg.addresstype}"} @@ -325,7 +323,8 @@ in { cfg=$( cat ${configFile}; ${extraRpcauth} - printf "rpcpassword="; cat "${secretsDir}/bitcoin-rpcpassword-privileged"; + ${/* Enable bitcoin-cli for group 'bitcoin' */ ""} + printf "rpcuser=${cfg.rpc.users.privileged.name}\nrpcpassword="; cat "${secretsDir}/bitcoin-rpcpassword-privileged"; ) confFile='${cfg.dataDir}/bitcoin.conf' if [[ ! -e $confFile || $cfg != $(cat $confFile) ]]; then