How wasmcloud/wadm works
Main Components
a) Core System Components:
• NATS Message Bus (central communication hub)
• Storage System (NATS KV Store)
• API Server
• Event Consumers
• Command Workers
• Scalers
• State Observer
b) External Integration Points:
• wasmCloud Hosts
• OCI Registries
• Client Applications (wash CLI)
Key Architectural Patterns
• Event-driven architecture
• Control loop pattern
• Publisher/Subscriber pattern
• State management system
Detailed Component Breakdown
a) Server Layer:
/crates/wadm/src/server/
• API Handlers
• Storage Interface
• Event Notifier
• Manifest Parser
b) Scaler System:
/crates/wadm/src/scaler/
• Config Scaler
• Daemon Scaler
• Spread Scaler
• Secret Scaler
• Status Scaler
c) Event System:
/crates/wadm/src/events/
• Event Serialization
• Event Deserialization
• Event Types
Data Flow Representation
• Command flow from API to workers
• Event flow from wasmCloud hosts through NATS
• State updates through the system
• Scaling decisions to host commands
Implementation Details
┌─────────────────────────────────────────────────────┐
• wadm │
• ┤
• ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
• API │━━━>│ Command │━━━>│ Scaler │ │
• Server │ │ Workers │ │ System │ │
• ┘ └──────────┘ └──────────────┘ │
• ▲ ▲ │ │
• ▼ │
• ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
• Storage │<───│ Event │<───│ State │ │
• (KV) │ │Consumers │ │ Observer │ │
• ┘ └──────────┘ └──────────────┘ │
• ┘
Integration Points
Connections to:
• wasmCloud hosts via NATS
• OCI registries for component retrieval
• Client tools (wash CLI)
• Multiple lattices (if applicable)
Scaling and HA
A section showing:
• Multiple wadm instances
• Load distribution
• State synchronization
• Failover paths