API layer for Moloch audit chain.
This crate provides external access to the chain via:
- REST API for CRUD operations
- WebSocket for real-time subscriptions
- Authentication and rate limiting
Architecture
┌─────────────────────────────────────────────────────────┐
│ API Server │
│ (Axum router with middleware stack) │
└─────────────────────────────────────────────────────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌────────────┐ ┌───────────────────┐
│ REST API │ │ WebSocket │ │ Authentication │
│ (events,blocks)│ │(subscribe) │ │ (JWT, API keys) │
└─────────────────┘ └────────────┘ └───────────────────┘
│ │ │
└────────────────┼────────────────┘
▼
┌─────────────────────────────────────────────────────────┐
│ ApiState │
│ (Shared state: storage, index, consensus) │
└─────────────────────────────────────────────────────────┘