# pratibhanaikk/hiero-mirror-node architecture

> Architecture diagram of the GitHub repository pratibhanaikk/hiero-mirror-node, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pratibhanaikk/hiero-mirror-node
- Repository: https://github.com/pratibhanaikk/hiero-mirror-node

## Overview

Hiero Mirror Node archives network history: it obtains consensus-node stream files, validates their signatures and hash chain, processes them into indexed storage, and exposes the resulting data through several APIs. The README documents the ingestion and storage flow; the tree and source index identify the API subsystems. Some API-to-storage relationships are documented only at the product level, so those edges cite the README rather than implying specific unsampled calls.

Main entry points: [`importer/src/main/java/org/hiero/mirror/importer/downloader/block/transformer`](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader/block/transformer) (Stream processing), [`importer/src/main/java/org/hiero/mirror/importer/downloader`](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader) (Download and validation), [`importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java`](https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java) (Balance reconciliation), [`rest/server.js`](https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/rest/server.js) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Stream ingestion"]
  node_importer["Download and validation"]
  node_processing["Stream processing"]
  node_balance["Balance reconciliation"]
end

subgraph group_storage["Archive data"]
  node_common["Shared domain model"]
  node_database[("Indexed archive")]
end

subgraph group_apis["Data access"]
  node_rest["REST API<br/>[server.js]"]
  node_graphql["GraphQL API"]
  node_grpc["gRPC API"]
  node_restjava["REST Java API"]
  node_rosetta["Rosetta API"]
  node_web3["Web3 API"]
end

subgraph group_operations["Monitoring"]
  node_monitor["Subscription monitor"]
end

node_consensus(("Consensus nodes"))
node_cloud[("Cloud stream storage")]
node_api_users(("API clients"))
node_cloud_providers(("Cloud providers"))

node_consensus -->|"uploads stream files"| node_cloud
node_cloud_providers -->|"provide storage"| node_cloud
node_cloud -->|"supplies files"| node_importer
node_importer -->|"validates then processes"| node_processing
node_processing -->|"populates"| node_database
node_database -.->|"provides balances"| node_balance
node_balance -->|"reconciles balances"| node_database
node_common -.->|"models stream data"| node_processing
node_api_users -->|"requests data"| node_rest
node_api_users -->|"requests data"| node_graphql
node_api_users -->|"requests data"| node_grpc
node_api_users -->|"requests data"| node_restjava
node_api_users -->|"requests data"| node_rosetta
node_api_users -->|"requests data"| node_web3
node_api_users -->|"subscribes"| node_monitor
node_database -->|"serves indexed data"| node_rest
node_database -->|"serves indexed data"| node_graphql
node_database -->|"serves indexed data"| node_grpc
node_database -->|"serves indexed data"| node_restjava
node_database -->|"serves indexed data"| node_rosetta
node_database -->|"serves indexed data"| node_web3

click node_importer "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader"
click node_processing "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader/block/transformer"
click node_balance "https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java"
click node_common "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/common/src/main/java/org/hiero/mirror/common/domain"
click node_rest "https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/rest/server.js"
click node_graphql "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/graphql/src/main/java/org/hiero/mirror/graphql"
click node_grpc "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/grpc/src/main/java/org/hiero/mirror/grpc"
click node_restjava "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/rest-java/src/main/java/org/hiero/mirror/restjava"
click node_rosetta "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/rosetta"
click node_web3 "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/web3/src/main/java/org/hiero/mirror/web3"
click node_monitor "https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/monitor/src/main/java/org/hiero/mirror/monitor/subscribe"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_importer,node_processing,node_balance,node_api_users toneBlue
class node_common,node_database,node_cloud toneAmber
class node_rest,node_graphql,node_grpc,node_restjava,node_rosetta,node_web3 toneMint
class node_monitor toneRose
class node_consensus,node_cloud_providers toneIndigo
```

## Components

### Stream ingestion

- [Download and validation](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader): `importer/src/main/java/org/hiero/mirror/importer/downloader`
- [Stream processing](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/importer/src/main/java/org/hiero/mirror/importer/downloader/block/transformer): `importer/src/main/java/org/hiero/mirror/importer/downloader/block/transformer`
- [Balance reconciliation](https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java): `importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java`

### Archive data

- [Shared domain model](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/common/src/main/java/org/hiero/mirror/common/domain): `common/src/main/java/org/hiero/mirror/common/domain`
- **Indexed archive**

### Data access

- [REST API](https://github.com/pratibhanaikk/hiero-mirror-node/blob/main/rest/server.js): `rest/server.js`
- [GraphQL API](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/graphql/src/main/java/org/hiero/mirror/graphql): `graphql/src/main/java/org/hiero/mirror/graphql`
- [gRPC API](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/grpc/src/main/java/org/hiero/mirror/grpc): `grpc/src/main/java/org/hiero/mirror/grpc`
- [REST Java API](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/rest-java/src/main/java/org/hiero/mirror/restjava): `rest-java/src/main/java/org/hiero/mirror/restjava`
- [Rosetta API](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/rosetta): `rosetta`
- [Web3 API](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/web3/src/main/java/org/hiero/mirror/web3): `web3/src/main/java/org/hiero/mirror/web3`

### Monitoring

- [Subscription monitor](https://github.com/pratibhanaikk/hiero-mirror-node/tree/main/monitor/src/main/java/org/hiero/mirror/monitor/subscribe): `monitor/src/main/java/org/hiero/mirror/monitor/subscribe`

### Other components

- **Consensus nodes**
- **Cloud stream storage**
- **API clients**
- **Cloud providers**

## Connections

- Consensus nodes → Cloud stream storage: uploads stream files
- Cloud providers → Cloud stream storage: provide storage
- Cloud stream storage → Download and validation: supplies files
- Download and validation → Stream processing: validates then processes
- Stream processing → Indexed archive: populates
- Indexed archive → Balance reconciliation: provides balances
- Balance reconciliation → Indexed archive: reconciles balances (evidence: `importer/src/main/java/org/hiero/mirror/importer/reconciliation/BalanceReconciliationService.java`)
- Shared domain model → Stream processing: models stream data
- API clients → REST API: requests data
- API clients → GraphQL API: requests data
- API clients → gRPC API: requests data
- API clients → REST Java API: requests data
- API clients → Rosetta API: requests data
- API clients → Web3 API: requests data
- API clients → Subscription monitor: subscribes
- Indexed archive → REST API: serves indexed data
- Indexed archive → GraphQL API: serves indexed data
- Indexed archive → gRPC API: serves indexed data
- Indexed archive → REST Java API: serves indexed data
- Indexed archive → Rosetta API: serves indexed data
- Indexed archive → Web3 API: serves indexed data
