tsoracle-standalone
Driver selection, configuration, and peer transport for running a standalone tsoracle node.
This is the layer the tsoracle CLI is built on: it turns a DriverConfig into a constructed, running ConsensusDriver plus its background peer-transport task. The caller owns the client-facing tsoracle_server::Server; this crate owns only the driver and the peer transport that backs it.
Reach for it when you want the CLI's driver bootstrap — feature-gated file/openraft/paxos selection, peer mTLS, and graceful shutdown wiring — inside your own binary, without re-implementing the plumbing.
What's in the box
build(DriverConfig) -> Standalone— open storage, construct the selected driver, and bind + spawn its peer transport before returning, so a bind failure is a startup error rather than a background log line.Standalone— the running node: theArc<dyn ConsensusDriver>to hand totsoracle_server::Server, plustake_drain()(driver-specific pre-shutdown action, e.g. openraft leadership handoff) andshutdown()for the peer transport.DriverConfig+FileConfig/OpenraftConfig/PaxosConfig— the per-driver configuration types, withMemberAddr,PeerTlsConfig,RaftTuning, andparse_peer_mapfor parsing CLI-style peer lists.StandaloneError— startup failures (bad config, bind failure, storage open).
Usage shape
use Server;
use ;
async
Feature flags
file(default) — the single-node fsync-durable file driver.openraft(default) — the openraft HA driver and its peer transport.paxos(default) — the OmniPaxos HA driver and its peer transport.
Disable the drivers you don't deploy to trim the dependency tree; build only accepts a DriverConfig variant whose driver is compiled in.
Documentation
docs/consensus-integration.md— picking and configuring a driver.- The repository README — architecture overview and the full crate map.