feat(bitcoin): multi-version support for Core & Knots (install/switch/pin/auto-update)
Lets a node runner choose which Bitcoin Core / Knots version to install (latest pre-selected), then switch, pin, or opt into auto-update from the app's interface — all manifest/catalog-driven, rootless, signed-registry, zero-data-loss. Motivated by upcoming BIP-110 signalling: runners need a real choice of software version. Backend: - version_config.rs: per-app pin + auto-update persistence (atomic, merge- preserving), downgrade detection, auto-update enumeration (+ unit tests). - app_catalog.rs: CatalogVersion / versions[] schema, catalog_versions(), catalog_image_for_version() (same-repo guard); a pin suppresses the update badge. - prod_orchestrator.rs: pinned version wins over the catalog default on every install/recreate. - install.rs: install-time `version` param persisted (default = unpinned). - set_config.rs: package.versions (read) + package.set-config (write) RPCs; downgrade is gated behind explicit confirm (warn + confirm + allow). - update.rs/main.rs: hourly per-app auto-update tick via the orchestrator (opt-in, pin-respecting); fix handle_package_update to be non-fatal for orchestrator-managed apps lacking a catalog primary image (bitcoin-core). UI: - MarketplaceAppDetails.vue: install-time version selector (shown when an app offers >=2 versions). - appDetails/AppSidebar.vue: "Version & Updates" card (switch / pin / auto- update toggle / downgrade warning), per app. - rpc-client.ts + en.json: RPC methods, types, strings. Phase 0 image pipeline: - scripts/build-bitcoin-image.sh: download official tarball + SHA256SUMS(.asc), verify SHA-256 + pinned-maintainer OpenPGP signature (fail-closed), build a minimal rootless image, smoke-test, tag + push. - apps/bitcoin-core/Dockerfile rewritten (drops stale community base); apps/bitcoin-knots/Dockerfile added. - generate-app-catalog.sh: emit curated versions[]; published + catalog now offers Core 25.2/26.2/27.2/28.4/29.3/30.2/31.0 + Knots 29.3.knots20260508. docs/bitcoin-multi-version-design.md: live progress tracker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d7c6f8c348
commit
6aa74c7386
@@ -15,6 +15,40 @@ export interface RPCResponse<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// Multi-version support (docs/bitcoin-multi-version-design.md). Mirrors the
|
||||
// `package.versions` / `package.set-config` RPC payloads.
|
||||
export interface CatalogVersionInfo {
|
||||
version: string
|
||||
default: boolean
|
||||
deprecated: boolean
|
||||
eol: string | null
|
||||
}
|
||||
|
||||
export interface PackageVersionsResponse {
|
||||
id: string
|
||||
supportsVersions: boolean
|
||||
default: string | null
|
||||
installedVersion: string | null
|
||||
pinnedVersion: string | null
|
||||
autoUpdate: boolean
|
||||
versions: CatalogVersionInfo[]
|
||||
}
|
||||
|
||||
export interface SetPackageConfigResponse {
|
||||
status: 'ok' | 'confirm_required'
|
||||
id: string
|
||||
// present on status === 'ok'
|
||||
pinnedVersion?: string | null
|
||||
autoUpdate?: boolean
|
||||
versionChanged?: boolean
|
||||
recreating?: boolean
|
||||
// present on status === 'confirm_required'
|
||||
kind?: string
|
||||
currentVersion?: string
|
||||
targetVersion?: string
|
||||
warning?: string
|
||||
}
|
||||
|
||||
/// Mirrors `crate::federation::pending::PendingPeerRequest` on the backend.
|
||||
export type PendingState = 'pending' | 'sent' | 'approved' | 'rejected' | 'expired'
|
||||
|
||||
@@ -586,6 +620,31 @@ class RPCClient {
|
||||
})
|
||||
}
|
||||
|
||||
// Multi-version support (docs/bitcoin-multi-version-design.md): list the
|
||||
// versions a runner may install / switch to for an app, plus the current pin
|
||||
// / auto-update preference and the version actually running.
|
||||
async getPackageVersions(id: string): Promise<PackageVersionsResponse> {
|
||||
return this.call({
|
||||
method: 'package.versions',
|
||||
params: { id },
|
||||
timeout: 15000,
|
||||
})
|
||||
}
|
||||
|
||||
// Persist a version pin (or un-pin to track latest) and/or the auto-update
|
||||
// toggle. A DOWNGRADE returns { status: 'confirm_required', warning } unless
|
||||
// confirm:true is passed — the UI warns first, then re-calls with confirm.
|
||||
async setPackageConfig(
|
||||
id: string,
|
||||
opts: { version?: string; autoUpdate?: boolean; confirm?: boolean },
|
||||
): Promise<SetPackageConfigResponse> {
|
||||
return this.call({
|
||||
method: 'package.set-config',
|
||||
params: { id, ...opts },
|
||||
timeout: 600000,
|
||||
})
|
||||
}
|
||||
|
||||
async checkPackageUpdates(): Promise<{
|
||||
status: string
|
||||
refreshed: boolean
|
||||
|
||||
Reference in New Issue
Block a user