bitcoind: simplify pruning

Remove the possible null value for bitcoind.prune and set prune = 0 in
bitcoind as a default. Remove prune = 0 in secure-node.nix and the
mkForce in configuration.nix (bitcoind.prune = lib.mkForce ).
This commit is contained in:
nixbitcoin 2020-06-07 11:40:25 +00:00
parent b9a7a71873
commit 0fd99c4cc0
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA
3 changed files with 4 additions and 10 deletions

View File

@ -27,8 +27,7 @@
# clightning is compatible with pruning. See # clightning is compatible with pruning. See
# https://github.com/ElementsProject/lightning/#pruning for more information. # https://github.com/ElementsProject/lightning/#pruning for more information.
# LND and electrs are not compatible with pruning. # LND and electrs are not compatible with pruning.
# Note: You can override default settings from secure-node.nix as follows # services.bitcoind.prune = 100000;
# services.bitcoind.prune = lib.mkForce 100000;
# #
# You can add options that are not defined in modules/bitcoind.nix as follows # You can add options that are not defined in modules/bitcoind.nix as follows
# services.bitcoind.extraConfig = '' # services.bitcoind.extraConfig = ''

View File

@ -12,7 +12,7 @@ let
${optionalString cfg.testnet "testnet=1"} ${optionalString cfg.testnet "testnet=1"}
${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"} ${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"}
${optionalString (cfg.prune != null) "prune=${toString cfg.prune}"} "prune=${toString cfg.prune}
${optionalString (cfg.sysperms != null) "sysperms=${if cfg.sysperms then "1" else "0"}"} ${optionalString (cfg.sysperms != null) "sysperms=${if cfg.sysperms then "1" else "0"}"}
${optionalString (cfg.disablewallet != null) "disablewallet=${if cfg.disablewallet then "1" else "0"}"} ${optionalString (cfg.disablewallet != null) "disablewallet=${if cfg.disablewallet then "1" else "0"}"}
${optionalString (cfg.assumevalid != null) "assumevalid=${cfg.assumevalid}"} ${optionalString (cfg.assumevalid != null) "assumevalid=${cfg.assumevalid}"}
@ -179,12 +179,8 @@ in {
description = "Override the default database cache size in megabytes."; description = "Override the default database cache size in megabytes.";
}; };
prune = mkOption { prune = mkOption {
type = types.nullOr (types.coercedTo type = types.ints.unsigned;
(types.enum [ "disable" "manual" ]) default = 0;
(x: if x == "disable" then 0 else 1)
types.ints.unsigned
);
default = null;
example = 10000; example = 10000;
description = '' description = ''
Reduce storage requirements by enabling pruning (deleting) of old Reduce storage requirements by enabling pruning (deleting) of old

View File

@ -64,7 +64,6 @@ in {
addnodes = [ "ecoc5q34tmbq54wl.onion" ]; addnodes = [ "ecoc5q34tmbq54wl.onion" ];
discover = false; discover = false;
addresstype = "bech32"; addresstype = "bech32";
prune = 0;
dbCache = 1000; dbCache = 1000;
}; };
services.tor.hiddenServices.bitcoind = mkHiddenService { port = cfg.bitcoind.port; }; services.tor.hiddenServices.bitcoind = mkHiddenService { port = cfg.bitcoind.port; };