feat: per-project services opt-out#17
Merged
Merged
Conversation
Adds an optional `services` field to vechain-dev.config.mjs so a consumer can opt out of parts of the shared stack it doesn't need (e.g. a client app that only talks to thor-solo directly). Default is the full set (`thor`, `indexer`, `explorer`); `thor` is required. When neither `indexer` nor `explorer` is selected, `deploy`/`profiles` become optional since there's no address book to write, and `up` exits immediately after ensuring thor-solo. Also bumps the default thor image to vechain/thor:v2.4.3 and the block-explorer to vechain/block-explorer:2.42. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a per-project services selection to let consumers opt out of indexer/explorer components (defaulting to the full stack) while keeping thor mandatory, and updates the CLI/config/docs accordingly.
Changes:
- Introduces
servicesvalidation invechain-dev.config.mjsand helper logic for “needs address book”. - Updates
vechain-dev up/deployto start only the selected services and to make deploy/address-book steps conditional. - Bumps default Docker images (thor + block-explorer) and updates docs to describe service selection.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new services option and behavior when opting out of indexer/explorer. |
| package.json | Bumps package version to 0.3.0. |
| lib/config.mjs | Adds services parsing/validation and needsAddressBook() helper. |
| compose/base.yaml | Updates default thor image tag. |
| compose/explorer.yaml | Updates default block-explorer image tag. |
| bin/vechain-dev.mjs | Adds service planning and conditional infra/deploy/address-book logic. |
| AGENTS.md | Updates internal agent docs to mention services behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
4
| services: | ||
| thor-solo: | ||
| image: ${VECHAIN_DEV_THOR_IMAGE:-ghcr.io/vechain/thor:latest} | ||
| image: ${VECHAIN_DEV_THOR_IMAGE:-vechain/thor:v2.4.3} | ||
| container_name: thor-solo |
Comment on lines
1
to
4
| services: | ||
| block-explorer: | ||
| image: ${VECHAIN_DEV_EXPLORER_IMAGE:-ghcr.io/vechain/block-explorer:2.41.0} | ||
| image: ${VECHAIN_DEV_EXPLORER_IMAGE:-vechain/block-explorer:2.42} | ||
| container_name: block-explorer |
Comment on lines
49
to
+50
| 1. **`registerAddresses({ project, profiles, addresses })`** — exported from package main. Signature defined in `lib/register.d.ts`. Validates and atomically writes `~/.vechain-dev/config/<project>.json`. | ||
| 2. **`vechain-dev` CLI** — commands `up`, `down`, `reset`, `sync`, `status`. The `up` flow is load-config → ensure network → start thor+mongo → run consumer `deploy` → merge address book → recreate indexer+explorer → exec consumer `dev` (the dev process becomes the foreground; signals are forwarded). | ||
| 2. **`vechain-dev` CLI** — commands `up`, `down`, `reset`, `sync`, `status`. The `up` flow is load-config → ensure network → start thor+mongo → run consumer `deploy` → merge address book → recreate indexer+explorer → exec consumer `dev` (the dev process becomes the foreground; signals are forwarded). When `services` opts out of `indexer`/`explorer`, the address-book merge and the deploy-then-verify cycle are skipped (the deploy command is still run if declared, but its registration isn't required). Thor-only consumers exit immediately after `ensureThor()`. |
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
servicesfield tovechain-dev.config.mjsso a consumer can opt out of parts of the shared stack it doesn't need. Default is['thor', 'indexer', 'explorer'];'thor'is required.'indexer'nor'explorer'is selected,upexits immediately afterensureThor()anddeploy/profilesbecome optional in config (there's no address book to write).vechain/thor:v2.4.3and block-explorer tovechain/block-explorer:2.42(pre-existing onmain; included here so the published version aligns).0.3.0.Use case: a frontend or backend that talks to thor-solo directly via
THOR_NODE_URLand doesn't need the indexer/explorer can declareservices: ['thor']and skip the mongo + indexer + explorer overhead.Test plan
node --checkonbin/vechain-dev.mjsandlib/config.mjsagent-marketplace) via a portal: link withservices: ['thor']— only thor-solo came up, no mongo/indexer/explorer containersvechain-dev upon a consumer with noservicesfield and confirm the default path is unchanged🤖 Generated with Claude Code