subsystem-summary-of-main

Installation
SKILL.md

Main Subsystem — Technical Summary

Overview

The main subsystem is the central orchestration layer of stellar-core. It defines the Application interface and its concrete ApplicationImpl, which owns all other subsystem managers and coordinates the application lifecycle: construction, initialization, startup, the main event loop, graceful shutdown, and thread management. It also provides configuration parsing (Config), persistent state management (PersistentState), HTTP command handling (CommandHandler), query serving (QueryServer), CLI entry point and command routing (CommandLine, main.cpp), and various utilities (XDR dumping, diagnostics, settings upgrade helpers, maintenance).

Key Files

  • Application.h / Application.cpp — Abstract Application interface; factory method Application::create().
  • ApplicationImpl.h / ApplicationImpl.cpp — Concrete implementation; owns all subsystem managers, threads, io_contexts.
  • AppConnector.h / AppConnector.cpp — Thread-safe accessor facade isolating subsystems from direct Application access.
  • Config.h / Config.cppConfig class; TOML-based configuration parsing, defaults, validation.
  • PersistentState.h / PersistentState.cpp — Key-value persistence of node-critical state (LCL, SCP data, upgrades) across two SQL tables.
  • CommandHandler.h / CommandHandler.cpp — HTTP admin command server routing and handler implementations.
  • QueryServer.h / QueryServer.cpp — Multi-threaded HTTP query server for BucketListDB reads.
  • CommandLine.h / CommandLine.cpp — CLI argument parsing via Clara; dispatches to run functions for each subcommand.
  • main.cpp — Entry point; initializes crypto, checks XDR/version identity, delegates to handleCommandLine().
  • Maintainer.h / Maintainer.cpp — Periodic maintenance (prunes old SCP history, ledger data).
  • ApplicationUtils.h / ApplicationUtils.cpp — Higher-level application utilities (setupApp, runApp, catchup, selfCheck, dumpLedger, etc.).
Related skills
Installs
1
GitHub Stars
3.3K
First Seen
14 days ago