subsystem-summary-of-historywork
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}.
More from stellar/stellar-core
running-tests
running tests at various levels from smoke tests to full suite to randomized tests
1subsystem-summary-of-test
read this skill for a token-efficient summary of the test subsystem
1subsystem-summary-of-scp
read this skill for a token-efficient summary of the scp subsystem
1running-make-to-build
how to run make correctly to get a good build, and otherwise understand the build system
1subsystem-summary-of-history
read this skill for a token-efficient summary of the history subsystem
1subsystem-summary-of-invariant
read this skill for a token-efficient summary of the invariant subsystem
1