Skip to content

cardano-testnet enableP2P in config file#6439

Open
CarlosLopezDeLara wants to merge 1 commit intomasterfrom
clr/enablep2p
Open

cardano-testnet enableP2P in config file#6439
CarlosLopezDeLara wants to merge 1 commit intomasterfrom
clr/enablep2p

Conversation

@CarlosLopezDeLara
Copy link
Contributor

@CarlosLopezDeLara CarlosLopezDeLara commented Feb 13, 2026

Description

  • Add EnableP2P: true networking in the default testnet node configuration.
  • Add retry logic to --params-mainnet HTTP request: retries up to 3 times with a 2-second delay, logging each failure to stderr, and wraps the final failure in a descriptive MainnetParamsFetchError
    instead of an opaque exception
  • Improve CLI output after testnet startup

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-9.6 and ghc-9.12
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@CarlosLopezDeLara CarlosLopezDeLara requested a review from a team as a code owner February 13, 2026 05:23
@CarlosLopezDeLara CarlosLopezDeLara force-pushed the clr/enablep2p branch 5 times, most recently from c2b74cc to 152730f Compare February 13, 2026 06:55
Enhances the `cardano-testnet` user experience by refining startup output.

Improve messages when running the testnet

The HTTP call fetching mainnet protocol parameters from https://github.com/input-output-hk/cardano-parameters/blob/main/mainnet/parameters.json had no retry logic, so a transient network or TLS error would kill the testnet setup with an opaque exception. Retry up to 3 times with a  2-second delay, logging each attempt to stderr, and wrap the final failure in a descriptive error.

Update node_default_config.json
-- Turn logging on or off
, ("EnableLogging", Aeson.Bool True)

-- Configuration for the node's P2P network topology
Copy link
Contributor

@carbolymer carbolymer Feb 13, 2026

Choose a reason for hiding this comment

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

This parameter is not in use for node versions >= 10.6. Can you add a comment about that?

c.f. 833a5f7#diff-d4a6c1d885d0454ec160da57fbe77f888d95b0c069a3e7f91449f49e2b84a237L196

makeSocketDir (TmpAbsolutePath fp) =
let relPath = makeRelative (takeDirectory fp) fp
in if relPath == "."
then "socket"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is anything wrong with ./socket here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@CarlosLopezDeLara please explain this change

logInfo "Node sockets:"
forM_ nodes $ \node ->
logInfo $ " " <> display (Text.pack (nodeName node)) <> " " <> display (Text.pack (H.sprocketSystemName (nodeSprocket node)))
logInfo ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea with dumping cli connection details.

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

LGTM, just add a comment about EnableP2P.

, ("EnableLogging", Aeson.Bool True)

-- Configuration for the node's P2P network topology
, ("EnableP2P", Aeson.Bool True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need more nuance here. Technically this configuration field has been deprecated so it's not relevant to node master. If we are going to support multiple versions, hard coding a deprecated field is not the way to start that process.

makeSocketDir (TmpAbsolutePath fp) =
let relPath = makeRelative (takeDirectory fp) fp
in if relPath == "."
then "socket"
Copy link
Contributor

Choose a reason for hiding this comment

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

@CarlosLopezDeLara please explain this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants