-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Display dynamic FluxOS version codename in header #39
Description
Problem
The Fluxtracker header displays a hardcoded build string "v.11 troubled cod" at Header.svelte:122. This codename becomes stale as Flux releases new versions. The current daemon version is actually "MagicBean 9.0.6".
Solution
Fetch the version codename dynamically from the Flux daemon API on each header refresh (every 30 seconds).
API Source
GET https://api.runonflux.io/daemon/getnetworkinfo
Response: { "data": { "subversion": "/MagicBean:9.0.6/", ... } }
Parse subversion by stripping slashes and splitting on : to extract codename and version.
Reference Implementation
The Fluxnode site (2ndtlmining/Fluxnode) fetches FluxOS version from https://raw.githubusercontent.com/RunOnFlux/flux/master/package.json and displays it in the header. This implementation uses the daemon's getnetworkinfo instead, which includes the codename (MagicBean, TroubledCod, etc.).
Files to Change (3 files)
1. src/server.js (lines 297-338)
- Add fetch to
/daemon/getnetworkinfoin the existing/api/headerPromise.all block - Parse subversion field into
{ codename, daemonVersion } - Add
network.fluxCodenameandnetwork.daemonVersionto response
2. src/lib/components/Header.svelte (line 122)
- Replace hardcoded
v.11 troubled codwith dynamic values from/api/headerresponse - Fallback to
...if API unavailable
3. No other changes needed
- No database changes, no migrations, no backup impact
- Works identically in Supabase and SQLite modes
Deployment
No special order needed. Server and frontend can deploy together. Frontend gracefully handles missing fields with fallback text.
Risks
- API unavailable: header shows "..." fallback (graceful degradation)
- Additional API call: added to existing Promise.all (parallel), minimal latency impact (~100ms)
- Format change: defensive parsing with fallback to raw string