Skip to content

Conversation

@smelc
Copy link
Contributor

@smelc smelc commented Mar 14, 2025

Warning

If this design is chosen (over #6103), then cardano-foundation/developer-portal#1426 needs to be amended correspondingly

Description

Fixes #6069

Fixes #6137

Variant of #6103 where passing the node configuration file and the genesis files are tied:

  • Either you pass the node configuration file and all 3 genesis files,
  • or you pass none of these; and cardano-testnet generates everything for you

Follow-up issues to create

@Jimbo4350> please tick them if you agree 🙂 I'll create them

  • Have pTestnetNodeOptions return a list of TestnetNodeOption and TestnetNodeOption be UserProvidedNodeOptions Filepath | SpoNodeOptions [Srting] | RelayNodeOptions [ String]. In other words merge the types TestnetNodeOptions and AutomaticNodeOption. This will generalize the behavior so that the user can create multiple nodes, no matter whether they are using custom options or using default behavior (Spo or Relay). This will require a bit of generalization in Cardano.hs but not much. ↔️ shown here: cardano-testnet: show in types the two scenarios that are supported #6155
  • Change cardanoTestnet to take Filepath for genesis files instead of Haskell values, maybe? Decided against
  • Check that the CLI flags changing genesis values are not used when passing a custom genesis file (TODOs are added in the code already about this).
  • Reflect in the types the tying behavior between the node configuration file being passed by the user and the genesis files being passed by the user too. ↔️ shown here: cardano-testnet: show in types the two scenarios that are supported #6155
  • Created already: cardano-testnet: runTestnet: don't tie it with H.Integration #6122

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • CI passes. See note on CI. The following CI checks are required:
  • Self-reviewed the diff

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

else
-- Here we forbid mixing defaulting of genesis files with providing a user node configuration file:
--
-- Because of this check, either the user passes a node configuration file AND he passes all the genesis files.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


-- Make Non P2P topology files
forM_ (zip [1..] portNumbers) $ \(i, myPortNumber) -> do
-- TODO: if the user provided its own configuration file, and requested a P2P topology file,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you turn this into an issue so we can track it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done here: #6150

<> testnetNodeExtraCliArgs nodeOptions
<> maybe [] extraCliArgs nodeOptions
pure $ eRuntime <&> \rt -> rt{poolKeys=mKeys}
-- TODO log the node's pid in a file. This is useful for killing the node later.
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is deserving of an issue can you create it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow-up issue created: #6149

@smelc smelc force-pushed the smelc/testnet-pass-config-files-2 branch from 2f5e95e to 3ae3a62 Compare March 17, 2025 12:56
@smelc smelc added this pull request to the merge queue Mar 17, 2025
Merged via the queue into master with commit fa3fa2f Mar 17, 2025
23 checks passed
@smelc smelc deleted the smelc/testnet-pass-config-files-2 branch March 17, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants