How sorellalabs/brontes works
Main components
• External Data Source & Integration: Show the integration with Reth as the source of raw Ethereum data. Also note the off-chain data enrichment (metadata, CEX prices, p2p data) mentioned in the README.
• Data Ingestion & Decoding: Represent the “brontes-core” crate along with parsing/decoding modules (see crates/brontes-core/decoding) that handle raw data processing.
• Classification & Inspector Framework: Include components such as “brontes-classifier” (with multiple submodules for protocols like Uniswap, Curve, etc.) and “brontes-inspect” for applying custom analytical logic (“inspectors”). Also, display the multi-frame classification components.
• Database Interaction: Show the “brontes-database” crate that interacts with databases (with submodules managing Clickhouse and MDBX integrations). Also reference the “libmdbx-rs” crate; these are critical for storing the structured data.
• Analytics, Pricing & Metrics: Illustrate the “brontes-pricing,” “brontes-metrics,” and “brontes-tracing” crates which process analytics information (price graphs, metrics, Prometheus exporter integration, tracing, etc.) and provide external exposure.
• Shared Types & Utilities: Include “brontes-types” and “brontes-macros” as cross-cutting libraries used by all other components for consistent interfaces and helper functions.
• CLI & Runner Components: Show the command-line interface (“crates/bin” and its subcomponents) as the entry point for running the analytics pipeline.
Relationships and interactions
• The ingestion/decoding module parses the trace data, passing it to the classifier modules for protocol-specific handling.
• Classified and enriched data then flows to the database layer for storage (Clickhouse/MDBX integration).
• In parallel, the inspector framework and pricing modules work on the processed data—running analytical algorithms and generating metrics.
• The metrics and trace modules handle logging/monitoring, pushing data to external systems (e.g., Prometheus, Grafana).
• The CLI/runner component orchestrates these processes based on user inputs, configuration files, and deployment scripts.
Architectural patterns and design principles
• Modularity: The system is split into many smaller, well-defined “crates” that interact through defined interfaces.
• Separation of Concerns: Data ingestion, classification, database management, analytics, and monitoring are distinct components.
• Extensibility: The Inspector Framework shows an emphasis on making analytics pluggable and user-definable.
• Integration: There is a clear pattern for integrating off-chain data and external JSON/ABI definitions (observable in the classifier-abis).
• Leveraging Rust’s package management (Cargo) for clear dependency management.