From 24069aa2c6982fb3e6c492379a486c1ce3aebcbd Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 27 Sep 2020 12:43:16 +0200 Subject: [PATCH] electrs: add option 'monitoringPort' --- modules/electrs.nix | 10 ++++++++-- test/scenarios/withnetns.py | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/electrs.nix b/modules/electrs.nix index f594783..4804eb7 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -34,13 +34,18 @@ in { address = mkOption { type = types.str; default = "127.0.0.1"; - description = "RPC listening address."; + description = "RPC and monitoring listening address."; }; port = mkOption { type = types.port; default = 50001; description = "RPC port."; }; + monitoringPort = mkOption { + type = types.port; + default = 4224; + description = "Prometheus monitoring port."; + }; extraArgs = mkOption { type = types.separatedString " "; default = ""; @@ -87,7 +92,8 @@ in { } \ --db-dir='${cfg.dataDir}' \ --daemon-dir='${bitcoind.dataDir}' \ - --electrum-rpc-addr=${toString cfg.address}:${toString cfg.port} \ + --electrum-rpc-addr=${cfg.address}:${toString cfg.port} \ + --monitoring-addr=${cfg.address}:${toString cfg.monitoringPort} \ --daemon-rpc-addr=${builtins.elemAt bitcoind.rpcbind 0}:${toString bitcoind.rpc.port} \ ${cfg.extraArgs} ''; diff --git a/test/scenarios/withnetns.py b/test/scenarios/withnetns.py index 5f3be5a..8aec4f5 100644 --- a/test/scenarios/withnetns.py +++ b/test/scenarios/withnetns.py @@ -15,9 +15,8 @@ btcpayserver_ip = "169.254.1.24" def electrs(): - machine.wait_until_succeeds( - "ip netns exec nb-electrs nc -z localhost 4224" - ) # prometeus metrics provider + # prometeus metrics provider + machine.wait_until_succeeds(f"nc -z {electrs_ip} 4224") def nbxplorer():