bitcoind: add cli option

This commit is contained in:
Erik Arvstedt 2019-11-12 19:40:30 +01:00
parent 8807b9f6b2
commit 55e73f32e3
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 9 additions and 1 deletions

View File

@ -209,6 +209,14 @@ in {
example = "tcp://127.0.0.1:28333"; example = "tcp://127.0.0.1:28333";
description = "ZMQ address for zmqpubrawtx notifications"; description = "ZMQ address for zmqpubrawtx notifications";
}; };
cli = mkOption {
type = types.package;
readOnly = true;
default = pkgs.writeScriptBin "bitcoin-cli" ''
exec ${cfg.package}/bin/bitcoin-cli -datadir='${cfg.dataDir}' "$@"
'';
description = "Binary to connect with the bitcoind instance.";
};
enforceTor = nix-bitcoin-services.enforceTor; enforceTor = nix-bitcoin-services.enforceTor;
}; };
}; };

View File

@ -119,7 +119,6 @@ in {
services.onion-chef.access.operator = [ "bitcoind" "clightning" "nginx" "liquidd" "spark-wallet" "electrs" "sshd" ]; services.onion-chef.access.operator = [ "bitcoind" "clightning" "nginx" "liquidd" "spark-wallet" "electrs" "sshd" ];
environment.interactiveShellInit = '' environment.interactiveShellInit = ''
alias bitcoin-cli='bitcoin-cli -datadir=${config.services.bitcoind.dataDir}'
${optionalString (config.services.clightning.enable) '' ${optionalString (config.services.clightning.enable) ''
alias lightning-cli='sudo -u clightning lightning-cli --lightning-dir=${config.services.clightning.dataDir}' alias lightning-cli='sudo -u clightning lightning-cli --lightning-dir=${config.services.clightning.dataDir}'
''} ''}
@ -188,6 +187,7 @@ in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
tor tor
blockchains.bitcoind blockchains.bitcoind
(hiPrio config.services.bitcoind.cli)
nodeinfo nodeinfo
banlist banlist
jq jq