Skip to main content

Crate chaincodec_stream

Crate chaincodec_stream 

Source
Expand description

§chaincodec-stream

Real-time streaming engine for ChainCodec.

Connects to blockchain RPC/WebSocket endpoints, listens for new blocks, extracts raw log data, routes each log through the Schema Registry, decodes it, and emits strongly-typed DecodedEvent objects.

§Architecture

BlockListener (per chain, Tokio task)
      │
      ▼
RawEvent queue
      │
      ▼
SchemaRouter (fingerprint → schema lookup)
      │
      ▼
ChainDecoder::decode_event
      │
      ▼
broadcast::Sender<DecodedEvent>   ← multiple consumers subscribe

Re-exports§

pub use config::StreamConfig;
pub use engine::StreamEngine;
pub use ws_listener::EvmWsListener;

Modules§

config
Stream engine configuration.
engine
StreamEngine — orchestrates multiple chain listeners and decoder workers.
listener
BlockListener trait — abstraction over RPC/WS block polling.
ws_listener
EvmWsListener — concrete BlockListener implementation for EVM chains using an Ethereum JSON-RPC WebSocket subscription (eth_subscribe("logs", ...)).