Skip to content

refactor(testnets): align scripts with cardonnay style#3515

Merged
mkoura merged 1 commit into
masterfrom
refactor_testnets_scripts
Jun 26, 2026
Merged

refactor(testnets): align scripts with cardonnay style#3515
mkoura merged 1 commit into
masterfrom
refactor_testnets_scripts

Conversation

@mkoura

@mkoura mkoura commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Restructure the testnet cluster scripts to match the cardonnay common/local_fast style: split start-cluster into local functions, use UPPERCASE readonly globals, and reuse rm_retry, get_address_balance and create_cluster_scripts from common.sh. supervisor.conf is now generated inline by start-cluster instead of shipped as a static template, and declares a [group:nodes] group so the supervisorctl_restart_nodes helper applies to the relay.

Convert cardano-node-relay1 and run-cardano-submit-api to args arrays with a compact PID log line, and add a command -v guard to run-cardano-submit-api.

Drop run-cardano-dbsync: it is now identical to common's version, which is already provided in the final testnet directory.

Fix the faucet balance call to not pass --testnet-magic twice, as common.sh get_address_balance now injects it.

Keep the POSIX cd "$(dirname "$0")" && pwd directory resolution in start-cluster itself, while the scripts emitted by common's create_cluster_scripts use readlink -m.

Restructure the testnet cluster scripts to match the cardonnay
common/local_fast style: split start-cluster into local functions,
use UPPERCASE readonly globals, and reuse rm_retry,
get_address_balance and create_cluster_scripts from common.sh.
supervisor.conf is now generated inline by start-cluster instead of
shipped as a static template, and declares a [group:nodes] group so
the supervisorctl_restart_nodes helper applies to the relay.

Convert cardano-node-relay1 and run-cardano-submit-api to args
arrays with a compact PID log line, and add a command -v guard to
run-cardano-submit-api.

Drop run-cardano-dbsync: it is now identical to common's version,
which is already provided in the final testnet directory.

Fix the faucet balance call to not pass --testnet-magic twice, as
common.sh get_address_balance now injects it.

Keep the POSIX `cd "$(dirname "$0")" && pwd` directory resolution in
start-cluster itself, while the scripts emitted by common's
create_cluster_scripts use `readlink -m`.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the testnets cluster scripts to align with the “cardonnay common/local_fast” scripting style: splitting start-cluster into smaller functions, using UPPERCASE readonly globals, generating supervisor.conf inline, and switching node/service wrappers to args arrays.

Changes:

  • Refactor start-cluster into initialize_globals, setup_state_cluster, configure_supervisor, and service startup helpers; generate supervisor.conf at runtime and introduce [group:nodes].
  • Convert cardano-node-relay1 and run-cardano-submit-api to use bash argument arrays and print compact PID+command log lines; add a command -v guard for cardano-submit-api.
  • Remove the static supervisor.conf template and remove run-cardano-dbsync from this directory.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cardano_node_tests/cluster_scripts/testnets/supervisor.conf Removes the static supervisor configuration template (now generated inline by start-cluster).
cardano_node_tests/cluster_scripts/testnets/start-cluster Refactors script into functions, generates supervisor config inline, and hooks into shared/common helpers for script creation and utilities.
cardano_node_tests/cluster_scripts/testnets/run-cardano-submit-api Refactors wrapper to an args array, adds a guard for missing binary, and adjusts logging.
cardano_node_tests/cluster_scripts/testnets/run-cardano-dbsync Removes the local db-sync wrapper script.
cardano_node_tests/cluster_scripts/testnets/dbsync_block_no.sh Refactors variable handling to UPPERCASE readonly globals.
cardano_node_tests/cluster_scripts/testnets/cardano-node-relay1 Refactors wrapper to an args array and adjusts logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cardano_node_tests/cluster_scripts/testnets/start-cluster
Comment thread cardano_node_tests/cluster_scripts/testnets/run-cardano-submit-api
@mkoura mkoura merged commit 54e45db into master Jun 26, 2026
2 checks passed
@mkoura mkoura deleted the refactor_testnets_scripts branch June 26, 2026 14:45
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.

2 participants