How thclab/keriox works
Main Components
• Core Library (keriox_core): This module contains the foundational mechanics such as event processing, database management (using modules like “redb”, “sled”, etc.), key and prefix management, query handling, and transport (HTTP, default, testing). It is the central piece upon which the other components depend.
• Components:
– Controller (components/controller): Acts as a client for accessing the infrastructure. It manages configuration, communication, and identifier-related operations.
– Watcher (components/watcher): Provides services like HTTP routing, monitoring, and watcher-specific logic. It listens for events and routes updates.
– Witness (components/witness): Functions as the entity that processes/witnesses events in the KERI protocol.
• Support Modules:
– Teliox (support/teliox): Provides additional functionalities related to event processing, state management, transport, and error handling.
– Gossip (support/gossip): Likely adds a layer for network gossip communication among nodes.
• Testing and Examples:
– Kernel tests (keriox_tests) and integration tests show how these components interact in real scenarios.
• CI/CD and Deployment Files:
– The .github/workflows, Dockerfiles (watcher.Dockerfile, witness.Dockerfile), and build scripts provide insight into how the application is built, tested, and deployed.
Component Relationships and Interactions
• The core library (keriox_core) is the foundation for handling low-level protocol functionalities such as key management, event generation, and database interaction.
• The Controller is an interface for client interaction (CLI-based or via FFI bindings), while the Watcher and Witness represent operational roles (event listening, processing, and signing) in the protocol.
• Additionally, show external integrations – for instance, clients (Rust, CLI via dkms-bin, or FFI bindings) connect to the Controller, and infrastructure services (such as those deployed via ambient-infrastructure or via Docker) interact with the Watcher and Witness services.
Architectural Patterns and Design Principles
• Modularity: The directory structure clearly separates concerns. Each primary role (controller, watcher, witness) is isolated into its own component, while the keriox_core acts as a shared library.
• Layered Architecture: There is a separation between the protocol core (data/event management, database interaction, transport) and the business logic in each component which extends that core functionality.
• Extensibility: Support modules are available to plug in additional functionalities like gossip communication or tel event generation.
• Testing & CI/CD: Multiple testing modules, integration tests, and GitHub workflows indicate a design that emphasizes continuous integration and safe deployment practices.