refactor(testnets): rework db-sync bootstrap script#3516
Merged
Conversation
Rename `run-cardano-dbsync` to `run_dbsync.sh` and switch its shebang from `nix-shell --pure` to `nix develop ...#postgres`, dropping the env-keep flags so `DBSYNC_SCHEMA_DIR` and the `cardano-db-sync` binary are inherited from the caller environment. Add an optional `DBSYNC_ALLOW_PRIVATE_OFFCHAIN_URLS` toggle that appends `--allow-private-offchain-urls` for fetching off-chain anchor data from localhost, and fail early with a clear message when `cardano-db-sync` is not on PATH.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the testnet bootstrap db-sync launcher by replacing the old run-cardano-dbsync script with a new run_dbsync.sh that runs under nix develop, adds optional support for allowing private off-chain anchor URLs, and validates required environment prerequisites before starting cardano-db-sync.
Changes:
- Renames/replaces the db-sync bootstrap runner (
run-cardano-dbsync→run_dbsync.sh) and switches fromnix-shell --puretonix develop ...#postgres. - Adds
DBSYNC_ALLOW_PRIVATE_OFFCHAIN_URLSto optionally pass--allow-private-offchain-urls. - Fails early with a clear message when
cardano-db-syncis not available onPATH.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| testnets_bootstrap_template/run-cardano-dbsync | Removed the previous nix-shell --pure-based db-sync runner. |
| testnets_bootstrap_template/run_dbsync.sh | New nix develop-based db-sync runner with optional private off-chain URL support and prerequisite checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Rename
run-cardano-dbsynctorun_dbsync.shand switch its shebang fromnix-shell --puretonix develop ...#postgres, dropping the env-keep flags soDBSYNC_SCHEMA_DIRand thecardano-db-syncbinary are inherited from the caller environment.Add an optional
DBSYNC_ALLOW_PRIVATE_OFFCHAIN_URLStoggle that appends--allow-private-offchain-urlsfor fetching off-chain anchor data from localhost, and fail early with a clear message whencardano-db-syncis not on PATH.