Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-testnet: QoL changes #6008

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions cardano-testnet/src/Parsers/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ module Parsers.Cardano
( cmdCardano
) where

import Cardano.Api (AnyShelleyBasedEra (AnyShelleyBasedEra), EraInEon (..), File (..),
bounded)
import Cardano.Api (AnyShelleyBasedEra (AnyShelleyBasedEra), EraInEon (..), bounded)

import Cardano.CLI.Environment
import Cardano.CLI.EraBased.Options.Common hiding (pNetworkId)
Expand Down Expand Up @@ -65,6 +64,8 @@ pCardanoTestnetCliOptions envCli = CardanoTestnetOptions

pNumSpoNodes :: Parser [TestnetNodeOptions]
pNumSpoNodes =
-- We don't support passing custom node configurations files on the CLI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

-- So we use a default node configuration for all nodes.
(`L.replicate` defaultSpoOptions) <$>
OA.option auto
( OA.long "num-pool-nodes"
Expand All @@ -75,29 +76,6 @@ pNumSpoNodes =
where
defaultSpoOptions = SpoNodeOptions Nothing []

_pSpo :: Parser TestnetNodeOptions
_pSpo =
SpoNodeOptions -- TODO add parser for node roles
. Just <$> parseNodeConfigFile
<*> pure [] -- TODO: Consider adding support for extra args

parseNodeConfigFile :: Parser NodeConfigurationYaml
parseNodeConfigFile = File <$>
strOption
(mconcat
[ long "configuration-file"
, metavar "NODE-CONFIGURATION"
, help helpText
, completer (bashCompleter "file")
]
)
where
helpText = unwords
[ "Configuration file for the cardano-node(s)."
, "Specify a configuration file per node you want to have in the cluster."
, "Or use num-pool-nodes to use cardano-testnet's default configuration."
]

pGenesisOptions :: Parser GenesisOptions
pGenesisOptions =
GenesisOptions
Expand Down
3 changes: 2 additions & 1 deletion cardano-testnet/src/Testnet/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ startNode
-> Int
-- ^ Testnet magic
-> [String]
-- ^ The command --socket-path will be added automatically.
-- ^ The command to execute to start the node.
-- @--socket-path@, @--port@, and @--host-addr@ gets added automatically.
-> ExceptT NodeStartFailure m TestnetNode
startNode tp node ipv4 port testnetMagic nodeCmd = GHC.withFrozenCallStack $ do
let tempBaseAbsPath = makeTmpBaseAbsPath tp
Expand Down
5 changes: 1 addition & 4 deletions cardano-testnet/src/Testnet/Start/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ getDefaultShelleyGenesis asbe maxSupply opts = do
-- > │   └── README.md
-- > ├── drep-keys
-- > │   ├── drep{1,2,3}
-- > │   │   └── drep.{skey,drep.vkey}
-- > │   │   └── drep.{skey,vkey}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you notice to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's @carbolymer who did this change, I think after seeing my (late) review on #6007 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- > │   └── README.md
-- > ├── genesis-keys
-- > │   ├── genesis{1,2,3}
Expand Down Expand Up @@ -234,9 +234,6 @@ cardanoTestnet
H.lbsWriteFile (tmpAbsPath </> "byron.genesis.spec.json")
. encode $ Defaults.defaultByronProtocolParamsJsonValue

-- Because in Conway the overlay schedule and decentralization parameter
-- are deprecated, we must use the "create-staked" cli command to create
-- SPOs in the ShelleyGenesis
Byron.createByronGenesis
testnetMagic
startTime
Expand Down
Loading