Skip to main content

Module server

Module server 

Source
Expand description

Full hermod-tracer server implementation

This module provides TracerServer, which accepts trace connections from Cardano nodes and routes them to file logs, Prometheus metrics, EKG polling, and optional re-forwarding — feature-for-feature with the Haskell cardano-tracer (excluding RTView and email alerts).

§Architecture

┌─────────────────────────────────────────────────────────┐
│                     TracerServer                         │
│                                                          │
│  ┌──────────┐   ┌──────────────┐   ┌─────────────────┐ │
│  │ Network  │   │  Prometheus  │   │ Log rotation    │ │
│  │ acceptor │   │  HTTP server │   │ background task │ │
│  └────┬─────┘   └──────────────┘   └─────────────────┘ │
│       │ per-connection                                   │
│  ┌────▼──────────────────────────────────────────────┐  │
│  │  handle_connection (one task per node)             │  │
│  │   ├─ trace loop  →  LogWriter + ReForwarder        │  │
│  │   ├─ EKG poller  →  NodeState::registry            │  │
│  │   └─ DataPoint idle (keeps channel alive)          │  │
│  └────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────┘

§Usage

Load a config::TracerConfig from a YAML file and pass it to TracerServer::new, then .await TracerServer::run:

use hermod::server::{TracerServer, config::TracerConfig};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let config = TracerConfig::from_file("hermod-tracer.yaml".as_ref())?;
    TracerServer::new(config).run().await
}

See config/hermod-tracer.yaml in the repository for a fully-annotated example configuration.

Modules§

acceptor
Network accept/connect loops for hermod-tracer
config
Haskell-compatible YAML configuration types for hermod-tracer
datapoint
DataPoint mini-protocol client (protocol 3)
ekg
EKG mini-protocol client (protocol 1)
logging
File-based log writing for hermod-tracer
node
Per-node state and shared tracer state
prometheus
Prometheus HTTP server for hermod-tracer
reforwarder
Re-forwarding — relay received traces to a downstream acceptor
rotation
Log rotation background task
trace_handler
Trace processing pipeline

Structs§

TracerServer
The top-level tracer server