Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cardano-tesnet: allow to specify output directory #6095

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Jan 29, 2025

Description

Adds the --output-dir to the cardano-testnet executable

Fixes #6078

How trust this PR

Use the new flag:

> ls /tmp > tmp-before # for checking data afterwards
> cabal run cardano-testnet -- cardano --testnet-magic 44 --output-dir output-dir

Witness that the output directory gets populated:

> tree output-dir
output-dir/
├── alonzo-genesis.json
├── byron-gen-command
│   └── genesis-keys.000.key
├── byron-genesis.json
├── byron.genesis.spec.json
├── configuration.yaml
├── conway-genesis.json
├── delegate-keys
│   ├── delegate1
│   │   ├── kes.skey
│   │   ├── kes.vkey
│   │   ├── key.skey
│   │   ├── key.vkey
...

You can check that the /tmp directory wasn't used, by comparing its current state with the state before:

> ls /tmp > tmp-after
> diff tmp-before tmp-after
# nothing gets printed

Now test that you can omit the flag:

> ls /tmp > tmp-before-2
> cabal run cardano-testnet -- cardano --testnet-magic 44

Observe that the testnet's log mentions a workspace in /tmp like before this PR:

    forAll77 =
      /tmp/nix-shell.hc4ID6/testnet-test-dc5d67c2dd8545dd
    
    forAll78 =
      Workspace: /tmp/nix-shell.hc4ID6/testnet-test-dc5d67c2dd8545dd

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/cardano-testnet-custom-output-dir branch 4 times, most recently from 4d30612 to 55313f5 Compare January 30, 2025 14:14
@smelc smelc marked this pull request as ready for review January 30, 2025 16:21
@smelc smelc requested a review from a team as a code owner January 30, 2025 16:21
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.

My main remark is about reusing mkConf, the other ones a just styling suggestions.

cardano-testnet/src/Testnet/Property/Run.hs Outdated Show resolved Hide resolved
cardano-testnet/src/Testnet/Property/Run.hs Show resolved Hide resolved
cardano-testnet/src/Testnet/Property/Run.hs Outdated Show resolved Hide resolved
@smelc smelc force-pushed the smelc/cardano-testnet-custom-output-dir branch from deb17c2 to 19f24f4 Compare January 31, 2025 10:31
@smelc smelc enabled auto-merge January 31, 2025 14:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] - cardano-testnet Use flags to specify the output directory for the cluster artifacts
2 participants