How taubyte/tau works
Purpose and Entry Points
Taubyte is a Go-based distributed application platform: developers define projects/resources, build code into WebAssembly or web assets, and deploy/run them across a cloud providing functions, web hosting, KV databases, object storage, and pub/sub. The root node binary enters at main.go and CLI/node lifecycle at cli/app/app.go, cli/node/node.go, and cli/node/start.go. User-facing developer workflows are primarily the Tau CLI (tools/tau/main.go) and local multi-node “Dream” environment (tools/dream/main.go, dream/universe.go).
Node Composition and Service Plane
A running node composes named platform services through shared core abstractions in core/services/types.go and per-service implementations. The main service plane includes:
• identity, projects, repositories, certificates, and GitHub integration: services/auth/service.go, services/auth/http.go, services/auth/github.go;
• deployment/build coordination: services/patrick/service.go, services/patrick/jobs.go;
• artifact/content replication: services/hoarder/service.go, services/hoarder/placement.go;
• topology, health, DNS, geo routing: services/seer/service.go, services/seer/dns.go;
• configuration namespace: services/tns/service.go, services/tns/engine/run.go;
• request/data execution substrate: services/substrate/service.go, services/substrate/components.go.
Configuration, Project Model, and Publication Flow
Project configuration is represented as structured resources—applications, functions, websites, databases, storage, messaging, services, and smart operations—under pkg/schema/project/types.go and resource-specific schema packages such as pkg/schema/functions/types.go and pkg/schema/databases/types.go. Specs map these declarations to platform naming, paths, and runtime contracts in pkg/specs/structure/application.go and pkg/specs/methods/tns.go.
The typical control flow is: Tau CLI edits/clones Git-backed project/config repositories; Auth authorizes repository/project operations; configuration is pushed to TNS; Patrick consumes changes as build jobs; Monkey executes build/compile jobs and publishes output to Hoarder; Substrate resolves deployed definitions and serves them. Relevant boundaries: tools/tau/lib/project/push_config.go, services/tns/push.go, services/monkey/jobs/run.go, services/hoarder/assets.go.
Build and Execution Runtime
Monkey is the build worker and job processor, with code, library, website, configuration, and WebAssembly job paths under services/monkey/jobs/code.go, services/monkey/jobs/website.go, and services/monkey/jobs/wasm_helpers.go. Container backends isolate builds and workloads behind a common manager, with Docker and containerd implementations in pkg/containers/backend_manager.go, pkg/containers/backends/docker/docker.go, and pkg/containers/backends/containerd/containerd.go.
At serving time, Substrate routes HTTP, P2P, pub/sub, database, storage, and IPFS-oriented operations to deployed modules. Its runtime instantiates/caches modules in services/substrate/runtime/instantiate.go and services/substrate/runtime/cache/cache.go; endpoint-specific dispatch lives in services/substrate/components/http/function/function.go and services/substrate/components/http/website/website.go. The generic VM layer supports module loading and multiple artifact backends in pkg/vm/runtime.go, pkg/vm/loaders/loader.go, and pkg/vm/backend/dfs/backend.go.
Distributed Data and Networking
The platform is peer-to-peer: node primitives provide libp2p-style peers, DAGs, pub/sub, and stream transport in p2p/peer/peer.go, p2p/peer/pubsub.go, and p2p/streams/command/router/router.go. Hoarder manages placement, membership, reconciliation, and replicated assets; its persistence path uses the CRDT/Merkle KV database in services/hoarder/kvdb.go and pkg/kvdb/merklecrdt.go. Raft is separately available for clustered coordination in pkg/raft/cluster.go and pkg/raft/fsm.go.
APIs, Tooling, and Deployment Infrastructure
Taucorder exposes node/service operations as protobuf/Connect APIs, with contracts in pkg/taucorder/proto/taucorder/v1/*.proto and handlers in pkg/taucorder/service/handlers.go. Generated JavaScript clients mirror these APIs under pkg/taucorder/clients/js/src/Taucorder.ts. Dream supplies local in-process service universes plus HTTP/MCP control interfaces via dream/service.go, dream/api/api.go, and dream/mcp/service.go.
Spore Drive is the deployment/control-plane subsystem for configuring and displacing workloads across hosts, with Connect APIs and language clients rooted at pkg/spore-drive/proto/drive/v1/drive.proto, pkg/spore-drive/drive/service/serve.go, and pkg/spore-drive/clients/py/spore_drive/drive.py. External integrations include Git/GitHub (services/auth/github_client.go), ACME certificate handling (services/auth/api_acme.go), Docker/containerd, IPFS-oriented storage components, and host networking/firewall controls (pkg/netguard/netguard.go).
Main entry points: types.go Service core · hoarder/service.go Hoarder · tns/service.go TNS · main.go Tau CLI
Components 20
Developer workflows
Node control plane
- Node lifecycle · Starts the platform node and composes its services.
cli/node/start.go - Service core · Shared contracts for named node services.
core/services/types.go - Auth and GitHub · Authorizes project and repository operations.
services/auth/service.go - TNS · Publishes and serves platform configuration.
services/tns/service.go - Patrick · Consumes configuration changes as build jobs.
services/patrick/jobs.go - Seer · Provides health, DNS, geo-routing, and topology.
services/seer/service.go
Build and artifacts
- Project resources · Defines deployable applications and resource declarations.
pkg/schema/project/types.go - Platform specs · Maps declarations to platform paths and contracts.
pkg/specs/structure/application.go - Monkey · Builds code, websites, configuration, and WebAssembly jobs.
services/monkey/jobs/run.go - Container manager · Selects Docker or containerd for isolated builds and workloads.
pkg/containers/backend_manager.go - Hoarder · Places, reconciles, and replicates published assets.
services/hoarder/service.go
Execution and data plane
- Substrate · Routes deployed HTTP, P2P, pub/sub, database, and storage operations.
- Module runtime · Instantiates and caches deployed modules.
services/substrate/runtime/instantiate.go - VM and loaders · Loads modules through multiple artifact backends.
pkg/vm/runtime.go - P2P primitives · Provides peers, DAGs, pub/sub, and stream transport.
p2p/peer/peer.go - Merkle CRDT KV · Persists Hoarder state using CRDT/Merkle storage.
pkg/kvdb/merklecrdt.go
APIs and deployment
- Taucorder · Exposes node and service operations through Connect APIs.
pkg/taucorder/service/handlers.go - Spore Drive · Configures and displaces workloads across hosts.
pkg/spore-drive/drive/service/serve.go
Connections 25
- Tau CLI → Project resources: edits
- Project resources → Platform specs: mapped by
- Tau CLI → Auth and GitHub: repository operations
- Tau CLI → TNS: pushes configuration
- Dream → Node lifecycle: runs locally
- Node lifecycle → Service core: composes
- Service core → Auth and GitHub: hosts
- Service core → TNS: hosts
- Service core → Patrick: hosts
- Service core → Seer: hosts
- Service core → Substrate: hosts
- TNS → Patrick: configuration changes
- Patrick → Monkey: build jobs
- Monkey → Container manager: isolates jobs
- Monkey → Hoarder: publishes artifacts
- Hoarder → Merkle CRDT KV: persists replication state
- Hoarder → P2P primitives: replicates over
- Substrate → TNS: resolves definitions
- Substrate → Module runtime: dispatches to
- Module runtime → VM and loaders: loads modules
- VM and loaders → Hoarder: loads artifacts
- Substrate → P2P primitives: P2P and pub/sub
- Seer → Substrate: routes requests
- Taucorder → Node lifecycle: operates node services
- Spore Drive → Container manager: places workloads