Skip to main content

Crate tsoracle_standalone

Crate tsoracle_standalone 

Source
Expand description

Driver selection, configuration, and peer transport for a standalone tsoracle node. See build.

Standalone::admin is the runtime membership-admin handle (MembershipAdmin): live for the openraft driver (add a learner, promote it to voter, remove a node, and list members — served over the --admin-listen gRPC port), and UnsupportedAdmin for the file and paxos drivers, which reject every mutating op.

Re-exports§

pub use admin::AdminError;
pub use admin::MemberEntry;
pub use admin::MemberRole;
pub use admin::MembershipAdmin;
pub use admin::MembershipView;
pub use admin::NewMember;
pub use admin::UnsupportedAdmin;

Modules§

admin
Driver-agnostic membership-admin surface. Re-exported types at the crate root preserve the original public surface; the module itself is also public so the test_support sub-module is reachable when its feature is enabled. Driver-agnostic membership-admin surface. The openraft impl lives in admin::openraft; paxos and file use UnsupportedAdmin.
admin_proto
Generated tsoracle.admin.v1 gRPC types (client + server). Public so the tsoracle admin CLI can use the client stub.

Structs§

AdminTlsConfig
mTLS material for the membership-admin gRPC server (PEM file paths, read at build()). Presence on an OpenraftConfig turns the admin port into mutual TLS: cert/key is this node’s admin-server identity; ca verifies connecting admin clients (operators dialing via tsoracle admin).
FatalSignal
One-per-node fail-fast signal. Any supervised transport-server task that exits unexpectedly trips it; the bin’s run loop selects on FatalSignal::tripped next to the OS shutdown signal and exits non-zero so an orchestrator restarts the node, instead of leaving a zombie whose peer/admin surface is dead while the consensus driver keeps running.
FileConfig
MemberAddr
openraft’s three-address membership entry: the raft peer RPC address, the scheme-less service endpoint clients are redirected to, and the scheme-less admin endpoint the tsoracle admin CLI is redirected to.
OpenraftConfig
PaxosConfig
PeerTlsConfig
mTLS material for the peer transport (PEM file paths, read at build()). Presence on a driver config turns the peer transport into mutual TLS: cert/key is this node’s identity (used as both the peer-server identity and the peer-client identity when dialing); ca verifies connecting peers. The CA MUST be cluster-dedicated — anyone holding a cert it signed can join replication.
RaftTuning
openraft timing knobs (milliseconds), defaulted to the values the example used.
Standalone
A constructed, running standalone node: the consensus driver plus the background peer-transport task (if any). The caller (the bin) owns the client-facing tsoracle_server::Server; this type owns only the driver and peer transport.
TransportHandle
Owns a spawned peer-transport server and shuts it down cooperatively. The file driver has no peer transport, so it uses TransportHandle::noop.

Enums§

DriverConfig
StandaloneError
Failure modes when bootstrapping a standalone node.

Functions§

build
Open storage, construct the selected driver, and spawn its peer transport (binding the peer listener before returning, so a bind failure is a startup error rather than a background log line).
init_file_seeded
One-shot seeded initialization for the file driver (migration setup).
parse_peer_map
Parse a comma-separated id=host:port peer map. Public so the bin and examples can reuse it instead of duplicating the parser.