Getting Started
ConsensusOS is a modular, zero-dependency control plane for multi-chain consensus governance. This guide walks you through installation, booting the system, and running your first health check.
Installation
Section titled “Installation”npm install @mcptoolshop/consensus-osRequires Node.js 18+. Zero runtime dependencies.
Boot the control plane
Section titled “Boot the control plane”import { CoreLoader, createHealthSentinel, createReleaseVerifier, createConfigGuardian, createXrplAdapter,} from "@mcptoolshop/consensus-os";
const loader = new CoreLoader({ configs: { "health-sentinel": { intervalMs: 10_000 }, },});
// Register pluginsloader.register(createHealthSentinel());loader.register(createReleaseVerifier());loader.register(createConfigGuardian());loader.register(createXrplAdapter());
// Boot resolves dependencies, inits, and starts all pluginsawait loader.boot();The CoreLoader orchestrates the full plugin lifecycle: registration, dependency resolution, initialization, and startup. Boot order is determined by declared dependencies.
Subscribe to events
Section titled “Subscribe to events”loader.events.subscribe("health.*", (event) => { console.log(`[${event.topic}] from ${event.source}:`, event.data);});The event bus supports wildcard subscriptions, ordered delivery, and deterministic replay.
Check invariants
Section titled “Check invariants”const verdict = await loader.invariants.check({ action: "deploy" });console.log("Transition allowed:", verdict.allowed);The invariant engine is fail-closed — invalid transitions are always rejected, never partially applied.
Graceful shutdown
Section titled “Graceful shutdown”await loader.shutdown();Shutdown happens in reverse boot order, ensuring clean teardown of all plugins.
CLI quick start
Section titled “CLI quick start”npx consensusos doctor # Run health checksnpx consensusos status # System status overviewnpx consensusos plugins # List loaded plugins