Skip to content

cardano-testnet: Add --params-file and --params-mainnet flags to the direct cardano path #6457

@palas

Description

@palas

Problem

The --params-file and --params-mainnet flags (for custom on-chain parameters) are only available via the create-env subcommand. The direct cardano subcommand hardcodes DefaultParams (via def) when calling createTestnetEnv, so there is no way to use custom on-chain params without the two-step flow.

This is a feature gap that makes the two-step flow strictly more capable than the direct path.

Proposed fix

  1. Add pOnChainParams to the optsTestnet parser in Parsers/Cardano.hs.
  2. Thread the resulting TestnetOnChainParams through CardanoTestnetCliOptions (or a new field).
  3. Pass it to createTestnetEnv in the NoUserProvidedEnv branch of runCardanoOptions in Parsers/Run.hs, instead of def.

~10 lines across Parsers/Cardano.hs and Parsers/Run.hs. Purely additive; existing behaviour unchanged when flags are absent.

Depends on

None (independent)

Type: Consistency fix (feature gap)

Effort: Low (~10 lines)

Risk: Very low

Metadata

Metadata

Assignees

Labels

minorfixSomething that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions