Context
Part 2 of #6510. Depends on #6517.
Adds a --testnet-config-dir flag to tx-generator json_highlevel that auto-discovers the 4 infrastructure config fields from a cardano-testnet output directory. Discovered infrastructure always overrides any user-provided values for those fields; all other config fields must be supplied by the user.
See #6510 for the full design.
Changes
New: bench/tx-generator/src/Cardano/TxGenerator/Setup/TestnetDiscovery.hs
Discovery:
- Scan testnet dir for node ports, socket path, signing key, config file (using
Cardano.Node.Testnet.Paths)
- Localhost assumption documented in code (matches
testnetDefaultIpv4Address in Testnet.Types)
- Discovered infrastructure (socket path, signing key, node config file, target nodes) always overrides user-provided values
Modify: bench/tx-generator/src/Cardano/Benchmarking/Command.hs
- New
JsonHLSource ADT (FullConfig | TestnetSource) as alternative in parser
- Updated handler dispatching to
discoverTestnetConfig
Modify: bench/tx-generator/tx-generator.cabal
- Add
directory to build-depends
- Add
Cardano.TxGenerator.Setup.TestnetDiscovery to exposed-modules
- Note:
cardano-node is already a dependency (needed for Cardano.Node.Testnet.Paths)
New: tests
- Mock testnet directory test (generated programmatically from
Cardano.Node.Testnet.Paths)
- Round-trip test (
NixServiceOptions → JSON → NixServiceOptions)
- Property-based test verifying infrastructure fields always override user-provided values
Context
Part 2 of #6510. Depends on #6517.
Adds a
--testnet-config-dirflag totx-generator json_highlevelthat auto-discovers the 4 infrastructure config fields from acardano-testnetoutput directory. Discovered infrastructure always overrides any user-provided values for those fields; all other config fields must be supplied by the user.See #6510 for the full design.
Changes
New:
bench/tx-generator/src/Cardano/TxGenerator/Setup/TestnetDiscovery.hsDiscovery:
Cardano.Node.Testnet.Paths)testnetDefaultIpv4AddressinTestnet.Types)Modify:
bench/tx-generator/src/Cardano/Benchmarking/Command.hsJsonHLSourceADT (FullConfig | TestnetSource) as alternative in parserdiscoverTestnetConfigModify:
bench/tx-generator/tx-generator.cabaldirectorytobuild-dependsCardano.TxGenerator.Setup.TestnetDiscoverytoexposed-modulescardano-nodeis already a dependency (needed forCardano.Node.Testnet.Paths)New: tests
Cardano.Node.Testnet.Paths)NixServiceOptions→ JSON →NixServiceOptions)