Skip to content

feat: per-project services opt-out#17

Merged
daithihearn merged 1 commit into
mainfrom
feat/services-opt-out
Jun 5, 2026
Merged

feat: per-project services opt-out#17
daithihearn merged 1 commit into
mainfrom
feat/services-opt-out

Conversation

@daithihearn
Copy link
Copy Markdown
Member

@daithihearn daithihearn commented Jun 5, 2026

Summary

  • 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. Default is ['thor', 'indexer', 'explorer']; 'thor' is required.
  • When neither 'indexer' nor 'explorer' is selected, up exits immediately after ensureThor() and deploy / profiles become optional in config (there's no address book to write).
  • Bumps the default thor image to vechain/thor:v2.4.3 and block-explorer to vechain/block-explorer:2.42 (pre-existing on main; included here so the published version aligns).
  • Version bumped to 0.3.0.

Use case: a frontend or backend that talks to thor-solo directly via THOR_NODE_URL and doesn't need the indexer/explorer can declare services: ['thor'] and skip the mongo + indexer + explorer overhead.

export default {
  project: 'my-client-app',
  services: ['thor'],
}

Test plan

  • Config validator unit-checked: thor-only, thor+indexer, indexer-without-thor (rejects), bogus service name (rejects), no services field (defaults to all + requires deploy)
  • node --check on bin/vechain-dev.mjs and lib/config.mjs
  • Manually tested against a sibling project (agent-marketplace) via a portal: link with services: ['thor'] — only thor-solo came up, no mongo/indexer/explorer containers
  • Reviewer: run a full-stack vechain-dev up on a consumer with no services field and confirm the default path is unchanged

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 5, 2026 13:05
@daithihearn daithihearn merged commit d86f47f into main Jun 5, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 services validation in vechain-dev.config.mjs and helper logic for “needs address book”.
  • Updates vechain-dev up/deploy to 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 thread compose/base.yaml
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 thread compose/explorer.yaml
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 thread AGENTS.md
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()`.
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