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, callsgetCommand(), spawns a process viamApp.getProcessManager().runProcess(), and installs an async callback that setsmDone/mEcand callswakeUp().onReset(): Clears done state, error code, and exit event.onAbort(): AttemptstryProcessShutdown()on the running process.getCommand(): Pure virtual — returnsCommandInfo{command, outFile}.