Expand description
Raft between orch nodes. Only coordination state goes through the log, the design is in
docs/specs/2026-10-26-multi-machine-cluster-design.md.
Re-exports§
Modules§
- config
- The
cluster:section of the global config - discovery
- Finds the other orch nodes on the tailnet from
tailscale status --json - local
- The localhost endpoint the CLI sends replicated writes to, so they go through the daemon’s log
- network
- Raft RPCs and forwarded writes between nodes, JSON over HTTP like
../agents-coordination. Every request carries the cluster secret, so reaching the port is not enough to join - progress
orch progressrecords: what an agent finished, what is left, and where the work is. The record goes through the log, the daemon’s engine commits and pushes before it writes one
Structs§
- Member
- One member as the leader sees it, for
orch nodes - Node
- A running node. The store holds one and sends every replicated write through it
- Node
Config - How one node of a cluster starts: its id, the address it listens on, the shared secret, the voters to initialize with, and whether it may lead (a witness may not)
- Raft
Store - The log and vote live in
raft.db, the state machine is orch’s own database. Apply writes each entry andraft:appliedin one transaction onorch.db, so a crash never applies an entry twice, and a log that runs ahead of the state is normal for Raft - Type
Config
Constants§
- SINGLE_
NODE_ ID - Id of the node when orch runs alone
Functions§
- enabled
- A
cluster:section turns the cluster on. Without one, orch writes straight to SQLite as it always has - members
- start
- Start this machine’s node from the
cluster:section and the tailnet. A learner keeps asking the cluster to add it until a member proves the secret and takes it - start_
node - Start one node of a cluster and serve its RPCs on
cfg.addr. Every voter initializes with the same membership, which openraft accepts, so no voter is special - start_
node_ on - Like
start_node, with a listener the caller already bound.cfg.addris the address peers use - start_
single - Start a one-node cluster over
store, with its log inraft_db, and route the store’s replicated writes through it