Skip to content

Check for update, ask user to update, auto update#684

Draft
mahbd wants to merge 2 commits intodevfrom
check-for-update
Draft

Check for update, ask user to update, auto update#684
mahbd wants to merge 2 commits intodevfrom
check-for-update

Conversation

@mahbd
Copy link
Copy Markdown
Collaborator

@mahbd mahbd commented Apr 12, 2026

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made.
  • Version number has been updated.
  • Required modules have been added to respective "requirements*.txt" files.
  • Relevant Test Cases added to this description (below).
  • (Team) Label with affected action categories and semver status.

Overview

This PR introduces a self-updating mechanism for the ZeuZ Node, allowing users to stay current with releases without manual intervention.

Changes:

  • update.go Implementation: Introduced a dedicated module to handle version comparison, update fetching from the GitHub API, and file replacement logic.
  • Makefile Updates: Integrated update.go into the build process across all supported platforms (Windows, macOS, Linux) to ensure the update binary is bundled with every release.
  • Logic Improvements:
    • Added an asynchronous update check on startup to minimize latency.
    • Implemented a user-friendly CLI prompt providing options to update now, postpone, ignore the current version, or enable auto-updates.
    • Enhanced main.go file download logic to support cross-device renaming on Windows by falling back to a file-copy mechanism if os.Rename fails.
    • Added state persistence via update_prefs.json and update_cache.json in the .zeuz directory to track user preferences and cached release metadata.

Why:
To improve the user experience and ensure nodes are running the latest version, reducing the friction associated with manual binary replacement and minimizing potential compatibility issues with outdated software.

Test Cases

@mahbd
Copy link
Copy Markdown
Collaborator Author

mahbd commented Apr 12, 2026

📚 $\text{Stack Overview}$

Pulls submitted in this stack:

This comment was automatically generated by st.

@mahbd mahbd marked this pull request as ready for review April 12, 2026 11:03
@mahbd mahbd marked this pull request as draft April 12, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant