Skip to content

Commit

Permalink
cardano-topology: skip BFT if --with-bft-node-0 not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Sep 14, 2021
1 parent e690be1 commit 9108166
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 12 additions & 6 deletions bench/cardano-topology/cardano-topology.hs
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions nix/workbench/topology.sh
Expand Up @@ -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 " + .)
Expand Down

0 comments on commit 9108166

Please sign in to comment.