From df784b341e3bc23147a71c7c98aa048510b99b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20D=2E=20Mih=C4=83il=C4=83?= Date: Wed, 7 Aug 2019 13:03:34 +0200 Subject: [PATCH 1/4] Expose electrs high-memory option in configuration.nix --- configuration.nix | 2 ++ modules/nix-bitcoin.nix | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index dfb3f9d..5bbed3b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -41,6 +41,8 @@ # Electrum Server in Rust. Only enable this if hardware wallets are # disabled. # services.electrs.enable = true; + # If you have ≥8GB memory, enable this option so electrs will sync faster. + # services.electrs.high-memory = true; ### LIQUIDD # Enable this module to use Liquid, a sidechain for an inter-exchange diff --git a/modules/nix-bitcoin.nix b/modules/nix-bitcoin.nix index b3def0b..530a347 100644 --- a/modules/nix-bitcoin.nix +++ b/modules/nix-bitcoin.nix @@ -161,7 +161,6 @@ in { services.electrs.enforceTor = true; services.electrs.onionport = 50002; services.electrs.nginxport = 50003; - services.electrs.high-memory = false; services.tor.hiddenServices.electrs = { map = [{ port = config.services.electrs.onionport; toPort = config.services.electrs.nginxport; From cd722cac1ac974c7327e0b0b22f706868c89ddb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20D=2E=20Mih=C4=83il=C4=83?= Date: Wed, 7 Aug 2019 14:52:34 +0200 Subject: [PATCH 2/4] Fix identation --- modules/nix-bitcoin-services.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nix-bitcoin-services.nix b/modules/nix-bitcoin-services.nix index 9ca97b9..12132f3 100644 --- a/modules/nix-bitcoin-services.nix +++ b/modules/nix-bitcoin-services.nix @@ -32,14 +32,14 @@ in # Allow any traffic allowAnyIP = { IPAddressAllow = "any"; }; - enforceTor = mkOption { - type = types.bool; - default = false; - description = '' - "Whether to force Tor on a service by only allowing connections from and - to 127.0.0.1;"; - ''; - }; + enforceTor = mkOption { + type = types.bool; + default = false; + description = '' + "Whether to force Tor on a service by only allowing connections from and + to 127.0.0.1;"; + ''; + }; } From 4e6e05a4a8e8bef1a40ac0590b2781ee2ec8962c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20D=2E=20Mih=C4=83il=C4=83?= Date: Wed, 7 Aug 2019 15:05:41 +0200 Subject: [PATCH 3/4] Improve electrs ports descriptions --- modules/electrs.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/electrs.nix b/modules/electrs.nix index c5fc634..0de6a53 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -41,17 +41,17 @@ in { port = mkOption { type = types.ints.u16; default = 50001; - description = "Override the default port on which to listen for connections."; + description = "RPC port."; }; onionport = mkOption { type = types.ints.u16; default = 50002; - description = "Override the default port on which to listen for connections."; + description = "Port on which to listen for tor client connections."; }; nginxport = mkOption { type = types.ints.u16; default = 50003; - description = "Override the default port on which to listen for connections."; + description = "Port on which to listen for TLS client connections."; }; enforceTor = nix-bitcoin-services.enforceTor; }; From 161ee02550833e12d61fb0784d66130bf518bf51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20D=2E=20Mih=C4=83il=C4=83?= Date: Wed, 7 Aug 2019 15:06:14 +0200 Subject: [PATCH 4/4] style: remove extra space --- modules/electrs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/electrs.nix b/modules/electrs.nix index 0de6a53..810d815 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -53,7 +53,7 @@ in { default = 50003; description = "Port on which to listen for TLS client connections."; }; - enforceTor = nix-bitcoin-services.enforceTor; + enforceTor = nix-bitcoin-services.enforceTor; }; config = mkIf cfg.enable {