feat: gate deploy on registration + on-chain code; bump indexer to 6.31.5#15
Merged
Merged
Conversation
…31.5 vechain-dev up now skips the project's deploy command when the project is already registered in ~/.vechain-dev/config/<project>.json AND every registered address still has code on thor-solo. Pass --redeploy to force. Also bumps vechain-indexer and api images to 6.31.5. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR reduces unnecessary contract redeployments in local dev by gating the project deploy step on (1) the presence of a project registration file in ~/.vechain-dev/config/ and (2) an on-chain liveness check (hasCode) for all registered contract addresses, with a --redeploy override. It also bumps the indexer/api images and package version.
Changes:
- Add
isProjectDeployed(project)to determine whether a project’s registered addresses still have on-chain code, and expose it via the package entrypoint. - Update
vechain-dev upto skip the deploy command when already deployed, and add--redeployto force deploy; extend argv parsing to accept flags after the subcommand. - Bump
vechain-indexerandapiimages to6.31.5and package version to0.1.11.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Bumps package version to 0.1.11. |
| lib/register.mjs | Re-exports isProjectDeployed for consumers. |
| lib/register.d.ts | Adds TypeScript declarations for isProjectDeployed and its return type. |
| lib/check.mjs | Implements registration + on-chain code gating via hasCode. |
| compose/indexer.yaml | Updates indexer and api image tags to 6.31.5. |
| bin/vechain-dev.mjs | Skips deploy when already deployed; adds --redeploy; adjusts flag parsing and help text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+13
to
+16
| export async function isProjectDeployed(project, { rpcUrl = DEFAULT_RPC } = {}) { | ||
| let registration | ||
| try { | ||
| registration = JSON.parse(await readFile(projectConfigFile(project), 'utf8')) |
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.
Summary
vechain-dev upnow skips the project's deploy command when the project is already registered in~/.vechain-dev/config/<project>.jsonand every registered address still has code on thor-solo. Pass--redeployto force.lib/check.mjsexportsisProjectDeployed(project); re-exported fromlib/register.mjsfor consumers who want to gate their own deploy scripts.bin/vechain-dev.mjsextended to accept flags after the subcommand;--redeployis honored onup.vechain-indexerandapiimages to6.31.5.0.1.11.Why
Without gating, every
yarn devin consumer repos (e.g. b3tr) re-deploys ~30 contracts on the shared thor-solo, taking ~5 min and rotating addresses. Gating on registration alone isn't enough: if thor-solo state is wiped but~/.vechain-dev/config/remains, the registration is stale. ThehasCodeliveness check on every unique registered address handles that case and falls through to a fresh deploy.Test plan
vechain-dev upon a clean machine deploys (reason:not-registered).vechain-dev upon the same project skips deploy.vechain-dev up --redeployforces deploy even when registered.vechain-dev reset,vechain-dev updeploys again (registration gone).~/.vechain-dev/config/remains,vechain-dev updetects missing code and redeploys.6.31.5.🤖 Generated with Claude Code