# wind-network/windexer architecture

> Architecture diagram of the GitHub repository wind-network/windexer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wind-network/windexer
- Repository: https://github.com/wind-network/windexer

## Overview

##### Project type and purpose
- wIndexer is a distributed, full-stack blockchain indexing solution for Solana.
- Key modules (crates) include:
- windexer-geyser (Geyser plugin for data ingestion)
- windexer-network (P2P network for propagation)
- windexer-store (hot/cold storage abstractions)
- windexer-api (HTTP/WebSocket query API)
- windexer-common (shared types/config)
- windexer-jito-staking (MEV integration)
- examples (TypeScript SDK, demos)

##### File structure
- Top-level “crates” directory holds independent Rust modules, each responsible for a slice of the system.
- “deployment/docker” contains Dockerfiles and compose config for Geyser plugin, P2P nodes, indexers.
- “examples/typescript” shows client integration over HTTP/WS.
- “scripts” and Makefile orchestrate local cluster bring-up (validator + geyser + nodes + indexers).

##### README for additional insights
- Confirms a modular architecture: Geyser plugin → distributed P2P nodes → indexers → HTTP/WS API → client SDK.
- Describes hot/cold storage (RocksDB, Parquet, PostgreSQL).
- Mentions metrics & monitoring, and Jito MEV integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Ingestion Layer"
        Validator["Solana Validator"]:::ingest
        Geyser["Geyser Plugin"]:::ingest
        Publisher["Publisher Module"]:::ingest
        Processor["Processor Module"]:::ingest
    end
    Validator -->|"Geyser RPC"| Geyser
    Geyser -->|"publish events"| Publisher
    Geyser -->|"process events"| Processor

    subgraph "P2P Network Layer"
        P2P["P2P Network Layer"]:::network
        Consensus["Consensus Submodule"]:::network
        Gossip["Gossip Submodule"]:::network
        P2PCLI["P2P Node CLI"]:::network
    end
    Publisher -->|"JSON/Protobuf"| P2P
    Consensus --> P2P
    Gossip --> P2P
    P2PCLI --> P2P

    subgraph "Indexer & Storage Layer"
        Indexer["Indexer Service"]:::storage
        Store["Storage Abstractions"]:::storage
        Hot["RocksDB (Hot)"]:::storage
        Archiver["Cold Archiver"]:::storage
        ColdParq["Parquet Store"]:::storage
        ColdPg["PostgreSQL Store"]:::storage
        Redis["Redis Cache"]:::storage
    end
    P2P -->|"subscribe"| Indexer
    Indexer -->|"write"| Hot
    Indexer -->|"archive trigger"| Archiver
    Archiver -->|"to Parquet"| ColdParq
    Archiver -->|"to PostgreSQL"| ColdPg
    Indexer -->|"cache"| Redis

    subgraph "API Layer"
        API["HTTP/WebSocket Endpoints"]:::api
    end
    Hot -->|"HTTP/WS"| API
    ColdParq -->|"query data"| API
    ColdPg -->|"SQL query"| API
    Redis -->|"cache lookup"| API

    subgraph "Clients & Examples"
        TS["TypeScript Client SDK"]:::client
        Camb["Cambrian AVS Example App"]:::client
        Examples["Example Indexer & Node Demos"]:::client
    end
    API -->|"HTTP/WS"| TS
    API -->|"HTTP/WS"| Camb
    API -->|"HTTP/WS"| Examples

    subgraph "Shared & Extensibility"
        Common["Shared Types & Config"]:::common
        Jito["Jito MEV Staking"]:::common
        JitoCLI["Jito CLI Entrypoint"]:::common
    end
    Common --> Geyser
    Common --> P2P
    Common --> Indexer
    Jito -->|"process MEV"| Indexer
    JitoCLI --> Jito

    subgraph "Deployment & Orchestration"
        Docker["Docker Deployment Config"]:::deploy
        Scripts["Makefile & scripts"]:::deploy
    end
    Docker --> Geyser
    Docker --> P2P
    Docker --> Indexer
    Scripts --> Docker
    Scripts -->|"orchestrate local cluster"| Validator

    subgraph "Metrics & Monitoring"
        M1["Geyser Metrics"]:::metrics
        M2["Network Metrics"]:::metrics
    end
    Geyser --> M1
    P2P --> M2
    M1 -->|"Prometheus"| M2
    M2 -->|"Prometheus"| Indexer

    click Geyser "https://github.com/wind-network/windexer/tree/main/crates/windexer-geyser"
    click Publisher "https://github.com/wind-network/windexer/tree/main/crates/windexer-geyser/src/publisher"
    click Processor "https://github.com/wind-network/windexer/tree/main/crates/windexer-geyser/src/processor"
    click P2P "https://github.com/wind-network/windexer/tree/main/crates/windexer-network"
    click Consensus "https://github.com/wind-network/windexer/tree/main/crates/windexer-network/src/consensus"
    click Gossip "https://github.com/wind-network/windexer/tree/main/crates/windexer-network/src/gossip"
    click P2PCLI "https://github.com/wind-network/windexer/blob/main/crates/windexer-network/src/main.rs"
    click Indexer "https://github.com/wind-network/windexer/tree/main/crates/windexer-api"
    click Store "https://github.com/wind-network/windexer/tree/main/crates/windexer-store"
    click ColdParq "https://github.com/wind-network/windexer/blob/main/crates/windexer-store/src/parquet_store.rs"
    click ColdPg "https://github.com/wind-network/windexer/blob/main/crates/windexer-store/src/db/postgres.rs"
    click Redis "https://github.com/wind-network/windexer/blob/main/crates/windexer-store/src/db/redis.rs"
    click API "https://github.com/wind-network/windexer/blob/main/crates/windexer-api/src/lib.rs"
    click TS "https://github.com/wind-network/windexer/tree/main/examples/typescript"
    click Camb "https://github.com/wind-network/windexer/tree/main/examples/camb-avs"
    click Examples "https://github.com/wind-network/windexer/tree/main/crates/windexer-examples"
    click Common "https://github.com/wind-network/windexer/tree/main/crates/windexer-common"
    click Jito "https://github.com/wind-network/windexer/tree/main/crates/windexer-jito-staking"
    click JitoCLI "https://github.com/wind-network/windexer/blob/main/crates/windexer-jito-staking/src/main.rs"
    click Docker "https://github.com/wind-network/windexer/tree/main/deployment/docker"
    click Scripts "https://github.com/wind-network/windexer/tree/main/Makefile & scripts/"
    click M1 "https://github.com/wind-network/windexer/blob/main/crates/windexer-geyser/src/metrics.rs"
    click M2 "https://github.com/wind-network/windexer/blob/main/crates/windexer-network/src/metrics.rs"

    classDef ingest fill:#FFDDC1,stroke:#F29822,color:#000;
    classDef network fill:#D0E8FF,stroke:#3399FF,color:#000;
    classDef storage fill:#DFFFD0,stroke:#4CAF50,color:#000;
    classDef api fill:#E5D0FF,stroke:#9072E0,color:#000;
    classDef client fill:#FFD0E5,stroke:#E03981,color:#000;
    classDef common fill:#F0F0F0,stroke:#999999,color:#000;
    classDef deploy fill:#FFF0D0,stroke:#CC9933,color:#000;
    classDef metrics fill:#FFD0D0,stroke:#E03E3E,color:#000;
```
