From 62a2602e7832e01b668090d5f3df1d9b2c231d11 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 26 Nov 2021 15:13:36 +0100 Subject: [PATCH] electrs: use dataDir for storing extra config This is simpler and more memory-efficient. We've also changed other services to use this appraoch. Also remove unneded `wait_for_unit` in the electrs regtest test. --- modules/electrs.nix | 4 +--- test/tests.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/electrs.nix b/modules/electrs.nix index 76c6f09..d01d95f 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -74,10 +74,8 @@ in { > electrs.toml ''; serviceConfig = nbLib.defaultHardening // { - RuntimeDirectory = "electrs"; - RuntimeDirectoryMode = "700"; # electrs only uses the working directory for reading electrs.toml - WorkingDirectory = "/run/electrs"; + WorkingDirectory = cfg.dataDir; ExecStart = '' ${config.nix-bitcoin.pkgs.electrs}/bin/electrs -vv \ --network=${bitcoind.makeNetworkName "bitcoin" "regtest"} \ diff --git a/test/tests.py b/test/tests.py index af7cb81..d7224c4 100644 --- a/test/tests.py +++ b/test/tests.py @@ -375,7 +375,6 @@ def _(): num_blocks = test_data["num_blocks"] if enabled("electrs"): - machine.wait_for_unit("onion-addresses") machine.wait_until_succeeds(log_has_string("electrs", "serving Electrum RPC")) get_block_height_cmd = ( """echo '{"method": "blockchain.headers.subscribe", "id": 0, "params": []}'"""