subsystem-summary-of-historywork

Installation
SKILL.md

Historywork Subsystem Technical Summary

The historywork subsystem implements the concrete work units (tasks) for stellar-core's history archive interactions. It provides the building blocks for publishing ledger history to archives and downloading/verifying history during catchup. All classes inherit from the Work/BasicWork/BatchWork framework defined in src/work/.


Base Infrastructure

RunCommandWork (RunCommandWork.h/cpp)

Inherits: BasicWork

Base class for all work units that execute external shell commands via ProcessManager. Subclasses override getCommand() to return a CommandInfo (command string + optional output file path). The work spawns a process, enters WORK_WAITING, and wakes up via an async callback on ProcessExitEvent when the process completes.

Key functions:

  • onRun(): If not done, calls getCommand(), spawns a process via mApp.getProcessManager().runProcess(), and installs an async callback that sets mDone/mEc and calls wakeUp().
  • onReset(): Clears done state, error code, and exit event.
  • onAbort(): Attempts tryProcessShutdown() on the running process.
  • getCommand(): Pure virtual — returns CommandInfo{command, outFile}.
Related skills
Installs
1
GitHub Stars
3.3K
First Seen
14 days ago