add Config.BinaryPath, PATH auto-detect, and Variant() (#97, #98, #99) - #111
Merged
Conversation
Phase 6.A: lay the groundwork for Bitcoin Inquisition support. Config.BinaryPath lets callers point the harness at any bitcoind binary without rewriting PATH. When unset, resolveBinary searches PATH for bitcoind-inquisition first and falls back to bitcoind, so an Inquisition build alongside Core "just works." Both binaries flow into the embedded manager script via BITCOIND_BIN / BITCOIN_CLI_BIN env vars; the script defaults to the literal names so direct invocation still works. Variant() introspects the running node via getnetworkinfo.subversion, returning VariantCore or VariantInquisition. The result is cached behind a mutex so subsequent calls are free; required for SupportsBIP and the skip-when-missing pattern landing in PR2. Closes #97, #98, #99. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rams, skip Core-only tests End-to-end testing against a real Inquisition 29.2 build surfaced three defects in the auto-detect path: 1. Inquisition's getnetworkinfo subversion is /Satoshi:29.2.0(inquisition)/ (lowercase). The case-sensitive Contains check resolved it as Core. Extracted parseVariant as a pure helper, made it case-insensitive, and added Test_ParseVariant pinning Core/Inquisition strings + casing variants so the resolver path is covered without a live binary. 2. Inquisition's -vbparams parser is strict on the 3-field form (deployment:start:timeout) where Core 24+ accepts both 3 and 4 fields. Emit the 4th field only when MinActivationHeight is non-zero so the same Config works against either binary. Test_VBParams_Render covers both branches. 3. Inquisition exposes testdummy as a non-BIP9 entry and activates BIP54 coinbase locktime rules. Three Core-only tests fail under it: TestMineUntilActive_Testdummy, TestExampleActivateTestdummy, TestRPC_GetBlockTemplate_SubmitBlock. Each now skips on VariantInquisition with a comment pointing to PR2's SupportsBIP as the eventual replacement for the variant check. ai-check green against bitcoind-inquisition on PATH. Still additive only; the 3-field vbparams default keeps the existing Core test suite green unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 26, 2026
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
Config.BinaryPathopt-in override: absolute / relative / bare-name (resolved via PATH).bitcoind-inquisitionfirst, falls back tobitcoind.Variant()getter parsesgetnetworkinfo.subversiononce and caches under a mutex.bitcoind_manager.shhonorsBITCOIND_BIN/BITCOIN_CLI_BINenv vars; defaults to literal names so direct invocation still works.This is the foundation PR for Phase 6 — subsequent PRs add the deployment registry (PR2), worked example + README (PR3), and the time API (PR4).
Closes #97, #98, #99.
Test plan
make ai-checkgreen (fmt + vet + lint + test-race + vuln).Test_Config_BinaryPath_Resolved— explicitBinaryPath = $(which bitcoind)starts/stops cleanly.Test_Config_BinaryPath_Invalid— nonexistent path fails fast atNew()with the path in the error.TestRPC_Variant_Returns— running against Core resolves toVariantCore(notUnknown).TestRPC_Variant_Cached— second call returns the same value after the node is stopped (proves caching).TestRPC_Variant_PreStart— pre-Start()call returnserrNotConnected.TestRPC_Variant_StringRoundTrip— enum strings stable.Test_Configupdated to round-tripBinaryPaththroughConfig().Variant()returnsVariantInquisition(deferred to [Phase 6.E.4] TestVariantDetection smoke test #109 in PR5; out of scope here).Notes
Variantcaching usessync.Mutex+ flag rather thansync.Onceto avoid permanently caching a transient RPC error on the first call.bitcoin-cliis resolved as a sibling ofbitcoindfirst, then via PATH — so Inquisition installs that ship paired binaries in their own directory work without further configuration.🤖 Generated with Claude Code