Convert nix-bitcoin extraConfig options to regular options

This commit is contained in:
Jonas Nick 2020-02-23 19:22:07 +00:00
parent f78ccbac34
commit 9d3588e1de
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
2 changed files with 37 additions and 7 deletions

View File

@ -12,11 +12,16 @@ let
${optionalString (cfg.prune != null) "prune=${toString cfg.prune}"}
${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.assumevalid != null) "assumevalid=${cfg.assumevalid}"}
# Connection options
${optionalString (cfg.port != null) "port=${toString cfg.port}"}
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
listen=${if cfg.listen then "1" else "0"}
${optionalString (cfg.discover != null) "discover=${if cfg.discover then "1" else "0"}"}
${optionalString (cfg.addnode != null) "addnode=${cfg.addnode}"}
# RPC server options
rpcport=${toString cfg.rpc.port}
@ -27,6 +32,9 @@ let
${optionalString (cfg.rpcuser != null) "rpcuser=${cfg.rpcuser}"}
${optionalString (cfg.rpcpassword != null) "rpcpassword=${cfg.rpcpassword}"}
# Wallet options
${optionalString (cfg.addresstype != null) "addresstype=${cfg.addresstype}"}
# ZMQ options
${optionalString (cfg.zmqpubrawblock != null) "zmqpubrawblock=${cfg.zmqpubrawblock}"}
${optionalString (cfg.zmqpubrawtx != null) "zmqpubrawtx=${cfg.zmqpubrawtx}"}
@ -209,6 +217,31 @@ in {
example = "tcp://127.0.0.1:28333";
description = "ZMQ address for zmqpubrawtx notifications";
};
assumevalid = mkOption {
type = types.nullOr types.str;
default = null;
example = "00000000000000000000e5abc3a74fe27dc0ead9c70ea1deb456f11c15fd7bc6";
description = "If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification";
};
addnode = mkOption {
type = types.nullOr types.str;
default = null;
example = "ecoc5q34tmbq54wl.onion";
description = "Add a node to connect to and attempt to keep the connection open";
};
discover = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Discover own IP addresses
'';
};
addresstype = mkOption {
type = types.nullOr types.str;
default = null;
example = "bech32";
description = "What type of addresses to use";
};
cli = mkOption {
type = types.package;
readOnly = true;

View File

@ -57,13 +57,10 @@ in {
services.bitcoind.rpcuser = "bitcoinrpc";
services.bitcoind.zmqpubrawblock = "tcp://127.0.0.1:28332";
services.bitcoind.zmqpubrawtx = "tcp://127.0.0.1:28333";
services.bitcoind.extraConfig = ''
assumevalid=00000000000000000000e5abc3a74fe27dc0ead9c70ea1deb456f11c15fd7bc6
addnode=ecoc5q34tmbq54wl.onion
discover=0
addresstype=bech32
changetype=bech32
'';
services.bitcoind.assumevalid = "00000000000000000000e5abc3a74fe27dc0ead9c70ea1deb456f11c15fd7bc6";
services.bitcoind.addnode = "ecoc5q34tmbq54wl.onion";
services.bitcoind.discover = false;
services.bitcoind.addresstype = "bech32";
services.bitcoind.prune = 0;
services.bitcoind.dbCache = 1000;
services.tor.hiddenServices.bitcoind = {