Skip to content

Commit

Permalink
Merge pull request #5936 from IntersectMBO/mgalazyn/feature/testnet-r…
Browse files Browse the repository at this point in the history
…emove-byron-add-conway-in-cli-options

cardano-testnet | remove --byron-era and add --conway-era in cardano-testnet CLI options
  • Loading branch information
palas authored Aug 6, 2024
2 parents 8829321 + d69c6cb commit 4f4e372
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
16 changes: 13 additions & 3 deletions cardano-testnet/src/Parsers/Cardano.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NumericUnderscores #-}

module Parsers.Cardano
( cmdCardano
) where

import Cardano.Api (bounded)
import Cardano.Api (AnyCardanoEra (..), EraInEon (..), ToCardanoEra (..), bounded)

import Cardano.CLI.Environment
import Cardano.CLI.EraBased.Options.Common hiding (pNetworkId)
import Cardano.CLI.Legacy.Options

import Prelude

import Data.Functor
import qualified Data.List as L
import Data.Word (Word64)
import Options.Applicative
Expand All @@ -25,7 +27,7 @@ optsTestnet :: EnvCli -> Parser CardanoTestnetOptions
optsTestnet envCli = CardanoTestnetOptions
-- TODO <$> (OA.many pSpo <|> pNumSpoNodes)
<$> pNumSpoNodes
<*> pLegacyCardanoEra envCli
<*> pCardanoEra
<*> OA.option auto
( OA.long "epoch-length"
<> OA.help "Epoch length, in number of slots"
Expand Down Expand Up @@ -76,6 +78,14 @@ optsTestnet envCli = CardanoTestnetOptions
<> OA.showDefault
)

where
-- TODO replace era in 'CardanoTestnetOptions' 'AnyShelleyBasedEra' - we're not supporting
-- byron testnets
pCardanoEra :: Parser AnyCardanoEra
pCardanoEra =
pAnyShelleyBasedEra envCli <&>
\case EraInEon eon -> AnyCardanoEra $ toCardanoEra eon

pNumSpoNodes :: Parser [TestnetNodeOptions]
pNumSpoNodes =
OA.option
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Usage: cardano-testnet (cardano | version | help)

Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
[ --byron-era
| --shelley-era
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--epoch-length SLOTS]
[--slot-length SECONDS]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
[ --byron-era
| --shelley-era
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
| --conway-era
]
[--epoch-length SLOTS]
[--slot-length SECONDS]
Expand All @@ -22,12 +22,12 @@ Available options:
--num-pool-nodes COUNT Number of pool nodes. Note this uses a default node
configuration for all nodes.
(default: [SpoTestnetNodeOptions Nothing [],SpoTestnetNodeOptions Nothing [],SpoTestnetNodeOptions Nothing []])
--byron-era Specify the Byron era
--shelley-era Specify the Shelley era
--allegra-era Specify the Allegra era
--mary-era Specify the Mary era
--alonzo-era Specify the Alonzo era
--babbage-era Specify the Babbage era (default)
--conway-era Specify the Conway era
--epoch-length SLOTS Epoch length, in number of slots (default: 500)
--slot-length SECONDS Slot length (default: 0.1)
--testnet-magic INT Specify a testnet magic id.
Expand Down

0 comments on commit 4f4e372

Please sign in to comment.