From 749ebcc64d7e9b93f15db435d0657e9a9e8c93f6 Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Wed, 8 Sep 2021 23:30:41 +0300 Subject: [PATCH] cardano-topology: skip BFT if --with-bft-node-0 not specified --- bench/cardano-topology/cardano-topology.hs | 18 ++++++++++++------ nix/workbench/topology.sh | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bench/cardano-topology/cardano-topology.hs b/bench/cardano-topology/cardano-topology.hs index 16ead1ac0a0..96c33a99f09 100644 --- a/bench/cardano-topology/cardano-topology.hs +++ b/bench/cardano-topology/cardano-topology.hs @@ -143,12 +143,18 @@ main = do ( long "loc" <> help "Region (at least one)" <> metavar "LOCNAME" )) - <*> pure defaultRoleSelector - - defaultRoleSelector = \case - 0 -> Nothing -- BFT node has no pools - 1 -> Just 1 -- Regular pools have just 1 pool - _ -> Just 2 -- Dense pools have any amount >1 as marker + <*> (roleSelector <$> + flag False True + ( long "with-bft-node-0" + <> help "Include a BFT node-0")) + + roleSelector withBft = \case + -- TODO: prepare for deprecation of BFT nodes by switching 1 & 0 + 1 -> Just 1 -- Normal pools are just that -- a single pool + 0 -> if withBft + then Nothing -- The BFT node has no pools + else Just 1 -- Dense pools are denoted by any amount >1 + _ -> Just 2 opts = info (cliParser <**> helper) ( fullDesc diff --git a/nix/workbench/topology.sh b/nix/workbench/topology.sh index 128d3e18c61..e3b6ac3d1d4 100644 --- a/nix/workbench/topology.sh +++ b/nix/workbench/topology.sh @@ -38,6 +38,8 @@ case "${op}" in args=( --topology-output "$outdir"/topology-nixops.json --dot-output "$outdir"/topology.dot --size $n_hosts + ## TODO: drop this, once we fully deprecate BFT in all scenarios + --with-bft-node-0 $(jq '.composition.locations | map("--loc " + .)