tsoracle
The standalone CLI for the tsoracle timestamp oracle — a tsoracle binary that runs a node directly from the command line, no embedding required.
A timestamp oracle hands out strictly increasing integer IDs that order events across a distributed system. This crate is the ready-to-run server: pick a consensus driver, point it at a data directory, and serve gRPC. To embed the server in your own binary instead, use tsoracle-server; to call a running node, use tsoracle-client.
Install
Quickstart
# Single-node, fsync-durable file driver. Listens on 127.0.0.1:50551,
# persists window state under ./tsoracle-data.
# Bare `tsoracle` is shorthand for `tsoracle serve file`.
Then call it from Rust with tsoracle-client:
use Client;
let client = connect.await?;
let ts = client.get_ts.await?; // a strictly increasing Timestamp
let batch = client.get_ts_batch.await?; // amortize RPC cost across many IDs
Commands
tsoracle serve file(default) — single-node, fsync-durable file driver. Window state is fsync'd before any timestamp in that window is issued, so a restart never rewinds.--state-dirdefaults to./tsoracle-data.tsoracle serve openraft— highly available via openraft (3+ node cluster). Takes--id,--raft-addr,--raft-dir, and--bootstrap/--memberson first boot.tsoracle serve paxos— highly available via OmniPaxos (3+ node cluster). Takes--node-id,--peer-listen,--peers,--tso-peers, and--data-dir.tsoracle init --seed-physical-ms <ms>— initialize a fresh file-driver state directory seeded at a given high-water, without serving.
Every serve subcommand shares the common knobs --listen (default 127.0.0.1:50551), --window-ahead, --failover-advance, --log, and TLS/mTLS for the client API (--tls-cert, --tls-key, --tls-client-ca). The HA drivers add their own peer-transport mTLS flags (--peer-tls-*). Run tsoracle serve <driver> --help for the full list.
Feature flags
The three drivers are compiled in by default; trim the binary by disabling the ones you don't deploy.
file(default) — the single-node file driver and the bare/serve filecommand.openraft(default) — the openraft HA driver andserve openraft.paxos(default) — the OmniPaxos HA driver andserve paxos.reflection— enable gRPC server reflection on the client API.bt— backtrace capture in error variants.
A driver that isn't compiled in produces a friendly "not included; rebuild with --features <driver>" message rather than a missing subcommand.
Documentation
docs/operations.md— deployment, TLS, and metrics.docs/consensus-integration.md— choosing between the file, openraft, and paxos drivers.- The repository README — architecture overview and the full crate map.