From 594cb7f4467b88f88d11d5147d5231fcaf26ddf6 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Thu, 26 Mar 2020 11:05:52 -0400 Subject: [PATCH 1/2] scripts: use relaysNew by default for edgeNodes --- nix/scripts.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/scripts.nix b/nix/scripts.nix index c1bf8f0d65e..de96f82e40b 100644 --- a/nix/scripts.nix +++ b/nix/scripts.nix @@ -44,7 +44,7 @@ let topologyFile = let edgePort = if config.useProxy then config.proxyPort else config.edgePort; edgeHost = if config.useProxy then config.proxyHost else config.edgeHost; - edgeNodes = if config.useProxy then [] else config.edgeNodes; + edgeNodes = if config.useProxy then [] else [ config.relaysNew ]; in config.topologyFile or mkEdgeTopology { inherit (config) hostAddr port; inherit edgeNodes edgeHost edgePort; From 4aa3f72f8567f292c7ef2fc4303a9af4ed6dea56 Mon Sep 17 00:00:00 2001 From: Samuel Leathers Date: Thu, 26 Mar 2020 11:43:03 -0400 Subject: [PATCH 2/2] default to relaysNew for all clusters --- nix/nixos/cardano-node-service.nix | 2 +- nix/scripts.nix | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index bb61dfd9235..63fd30042dc 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -210,7 +210,7 @@ in { type = types.path; default = commonLib.mkEdgeTopology { inherit (cfg) port; - inherit (envConfig) edgeNodes; + edgeNodes = [ envConfig.relaysNew ]; }; description = '' Cluster topology diff --git a/nix/scripts.nix b/nix/scripts.nix index de96f82e40b..0994c949591 100644 --- a/nix/scripts.nix +++ b/nix/scripts.nix @@ -44,7 +44,12 @@ let topologyFile = let edgePort = if config.useProxy then config.proxyPort else config.edgePort; edgeHost = if config.useProxy then config.proxyHost else config.edgeHost; - edgeNodes = if config.useProxy then [] else [ config.relaysNew ]; + hasCustomEdgeNodes = __hasAttr "edgeNodes" customConfig; + hasRelaysNew = __hasAttr "relaysNew" config; + edgeNodes = let + relaysNodes = [ config.relaysNew ]; + edgeNodes' = if (hasCustomEdgeNodes || !hasRelaysNew) then config.edgeNodes else relaysNodes; + in if config.useProxy then [] else edgeNodes'; in config.topologyFile or mkEdgeTopology { inherit (config) hostAddr port; inherit edgeNodes edgeHost edgePort;