cardano-testnet: Add --nodes flag for per-node binary configuration#6559
Merged
Conversation
f0bcf8d to
88a49cf
Compare
9 tasks
--nodes flag for per-node binary configuration
9ca8af4 to
77fa7d8
Compare
88a49cf to
450f24b
Compare
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
reviewed
May 7, 2026
carbolymer
previously requested changes
May 7, 2026
Contributor
carbolymer
left a comment
There was a problem hiding this comment.
Exception handling is most important here
def6fd7 to
393ad15
Compare
450f24b to
6530ec1
Compare
393ad15 to
eb5f40e
Compare
6530ec1 to
8bb24b5
Compare
ebdfb5a to
0bbd001
Compare
Jimbo4350
reviewed
May 8, 2026
There was a problem hiding this comment.
Pull request overview
Adds per-node configuration support to cardano-testnet via a new --nodes CLI flag, allowing each node to be designated as SPO/relay and optionally pinned to a specific cardano-node binary (recorded in the generated env and reused when starting from --node-env).
Changes:
- Introduces
--nodes SPEC[,SPEC...]parsing (with role ordering validation and optionalnode-bin=path) and updates CLI help golden files. - Extends testnet node configuration types to carry an optional per-node binary path, and persists that choice into
node-data/nodeN/env. - Updates node startup to optionally use a custom binary via a new
procCustomhelper and astartNodesignature change.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs | Updates test to new node options type (NodeWithOptions). |
| cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs | Updates test to new node options type (NodeWithOptions). |
| cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs | Updates test node creation + startNode call to pass optional custom binary. |
| cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs | Updates startNode call to pass optional custom binary. |
| cardano-testnet/test/cardano-testnet-golden/files/golden/help/create-env.cli | Updates golden help output to document --nodes. |
| cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli | Updates golden help output to document --nodes. |
| cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli | Updates top-level golden help usage to show --nodes alternative. |
| cardano-testnet/src/Testnet/Start/Types.hs | Replaces exported node option types with NodeWithOptions/TestnetNodesWithOptions and adds nodeBin. |
| cardano-testnet/src/Testnet/Start/Cardano.hs | Writes/reads per-node env YAML for custom binaries; threads nodeBin into node startup. |
| cardano-testnet/src/Testnet/Runtime.hs | Extends startNode to accept an optional custom node binary. |
| cardano-testnet/src/Testnet/Process/RunIO.hs | Adds procCustom helper for running an explicitly provided binary path. |
| cardano-testnet/src/Parsers/Run.hs | Uses new readNodesWithOptionsFromEnv reader. |
| cardano-testnet/src/Parsers/Cardano.hs | Adds --nodes flag and Parsec-based parseNodeSpecs implementation. |
| cardano-testnet/src/Cardano/Testnet.hs | Updates re-exports to the renamed node options API. |
| cardano-testnet/changelog.d/20260506_035740_palas_testnet_specify_node_bin_per_node.md | Adds changelog entry for --nodes. |
| cardano-testnet/cardano-testnet.cabal | Adds parsec dependency for --nodes parsing. |
| cardano-node/src/Cardano/Node/Testnet/Paths.hs | Adds defaultNodeEnvFile path helper. |
| cardano-node-chairman/test/Spec/Chairman/Cardano.hs | Updates chairman test to use the new default node options value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jimbo4350
reviewed
May 11, 2026
71406e5 to
375d6a9
Compare
carbolymer
reviewed
May 12, 2026
carbolymer
reviewed
May 12, 2026
carbolymer
reviewed
May 12, 2026
carbolymer
reviewed
May 12, 2026
Contributor
carbolymer
left a comment
There was a problem hiding this comment.
Looks good to me. I'm leaving approval to @Jimbo4350
Jimbo4350
approved these changes
May 13, 2026
Contributor
Jimbo4350
left a comment
There was a problem hiding this comment.
LGTM, one minor comment
Contributor
Author
db7bdf5 to
17045df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
--nodesCLI flag tocardano-testnetthat allows specifying the role (SPO or relay) and optionally a customcardano-nodebinary for each node in the testnet. This enables running testnets with mixed node versions, which is needed for testing compatibility across node releases.The new flag coexists with the existing
--num-pool-nodesvia<|>in the parser, so either can be used:At creation time, custom binaries are validated by running
--versionand the result is recorded in a YAML env file (node-data/nodeN/env). At runtime, the env file is read to resolve the binary, falling back to the default resolution when no env file exists.Base PR: #6563 (enforces SPOs come first and splits node list into SPO and relay)
Checklist
See Running tests for more details
CHANGELOG.mdfor affected package.cabalfiles are updatedhlint. See.github/workflows/check-hlint.ymlto get thehlintversionstylish-haskell. See.github/workflows/stylish-haskell.ymlto get thestylish-haskellversionghc-9.6andghc-9.12