moloch-api 0.1.0

REST/WebSocket API layer for Moloch audit chain
Documentation

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)              │
└─────────────────────────────────────────────────────────┘