Skip to content

feat: Display dynamic FluxOS version codename in header #39

@2ndtlmining

Description

@2ndtlmining

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/getnetworkinfo in the existing /api/header Promise.all block
  • Parse subversion field into { codename, daemonVersion }
  • Add network.fluxCodename and network.daemonVersion to response

2. src/lib/components/Header.svelte (line 122)

  • Replace hardcoded v.11 troubled cod with dynamic values from /api/header response
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions