# openaudio/go-openaudio architecture

> Architecture diagram of the GitHub repository openaudio/go-openaudio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openaudio/go-openaudio
- Repository: https://github.com/openaudio/go-openaudio

## Overview

Open Audio Protocol is a validator-oriented decentralized audio network node. A client or operator reaches the node through HTTP/RPC, which dispatches blockchain transactions, content-storage operations, diagnostics, and queries. Core services validate and commit state through CometBFT and PostgreSQL; Mediorum stores and serves media; ETL materializes blockchain data for faster reads; Console and Explorer present results. Ethereum integrations support registry, staking, and rewards. The sampled source confirms route wiring and storage diagnostics, while some subsystem links are inferred only from documented capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core Network"]
  node_http_host["HTTP RPC Host<br/>[main.go]"]
  node_core_api["Core API<br/>[service.pb.go]"]
  node_core_server["Core Server<br/>[server.go]"]
  node_comet{{"CometBFT Network"}}
  node_core_db[("Core PostgreSQL<br/>[db.go]")]
end

subgraph group_storage["Media Storage"]
  node_mediorum["Mediorum Storage<br/>[server.go]"]
  node_storage_api["Storage API<br/>[service.pb.go]"]
  node_media_disk[("Media Blob Store<br/>[local_disk.go]")]
  node_storage_metrics["Storage Metrics<br/>[storage_metrics.go]"]
end

subgraph group_data["Indexing and Views"]
  node_etl_server["ETL Service<br/>[server.go]"]
  node_etl_indexer["Blockchain Indexer<br/>[indexer.go]"]
  node_etl_db[("ETL PostgreSQL<br/>[db.go]")]
  node_explorer["Block Explorer<br/>[explorer.go]"]
  node_console["Node Console<br/>[routes.go]"]
end

subgraph group_integrations["Ethereum Integration"]
  node_eth_service["Ethereum Service<br/>[eth.go]"]
  node_contracts["Protocol Contracts<br/>[contracts.go]"]
end

subgraph group_operations["Operations"]
  node_genesis_writer["Genesis Writer<br/>[main.go]"]
end

node_client(("Client or Operator"))
node_ethereum{{"Ethereum Network"}}

node_client -->|"requests"| node_http_host
node_http_host -->|"dispatches"| node_core_api
node_http_host -->|"dispatches"| node_storage_api
node_http_host -.->|"dispatches"| node_etl_server
node_http_host -->|"serves"| node_console
node_http_host -.->|"serves"| node_explorer
node_core_api -->|"calls"| node_core_server
node_core_server -->|"commits state"| node_comet
node_core_server -->|"reads writes"| node_core_db
node_storage_api -->|"calls"| node_mediorum
node_mediorum -->|"stores blobs"| node_media_disk
node_mediorum -->|"records metrics"| node_storage_metrics
node_console -->|"gets diagnostics"| node_storage_api
node_etl_server -->|"runs indexer"| node_etl_indexer
node_etl_indexer -->|"materializes data"| node_etl_db
node_explorer -.->|"queries data"| node_etl_db
node_core_server -.->|"uses chain"| node_eth_service
node_eth_service -->|"binds contracts"| node_contracts
node_contracts -->|"calls contracts"| node_ethereum
node_genesis_writer -->|"writes history"| node_core_db
node_genesis_writer -->|"primes state"| node_comet

click node_http_host "https://github.com/openaudio/go-openaudio/blob/main/cmd/openaudio/main.go"
click node_core_api "https://github.com/openaudio/go-openaudio/blob/main/pkg/api/core/v1/service.pb.go"
click node_core_server "https://github.com/openaudio/go-openaudio/blob/main/pkg/core/server/server.go"
click node_core_db "https://github.com/openaudio/go-openaudio/blob/main/pkg/core/db/db.go"
click node_mediorum "https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/server.go"
click node_storage_api "https://github.com/openaudio/go-openaudio/blob/main/pkg/api/storage/v1/service.pb.go"
click node_media_disk "https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/local_disk.go"
click node_storage_metrics "https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/storage_metrics.go"
click node_etl_server "https://github.com/openaudio/go-openaudio/blob/main/pkg/etlserver/server.go"
click node_etl_indexer "https://github.com/openaudio/go-openaudio/blob/main/pkg/etl/indexer.go"
click node_etl_db "https://github.com/openaudio/go-openaudio/blob/main/pkg/etl/db/db.go"
click node_explorer "https://github.com/openaudio/go-openaudio/blob/main/pkg/explorer/explorer.go"
click node_console "https://github.com/openaudio/go-openaudio/blob/main/pkg/core/console/routes.go"
click node_eth_service "https://github.com/openaudio/go-openaudio/blob/main/pkg/eth/eth.go"
click node_contracts "https://github.com/openaudio/go-openaudio/blob/main/pkg/eth/contracts/contracts.go"
click node_genesis_writer "https://github.com/openaudio/go-openaudio/blob/main/cmd/genesis-writer/main.go"

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_http_host,node_core_api,node_core_server,node_comet,node_core_db,node_client toneBlue
class node_mediorum,node_storage_api,node_media_disk,node_storage_metrics toneAmber
class node_etl_server,node_etl_indexer,node_etl_db,node_explorer,node_console toneMint
class node_eth_service,node_contracts toneRose
class node_genesis_writer,node_ethereum toneIndigo
```

## Components

### Core Network

- [HTTP RPC Host](https://github.com/openaudio/go-openaudio/blob/main/cmd/openaudio/main.go): `cmd/openaudio/main.go`
- [Core API](https://github.com/openaudio/go-openaudio/blob/main/pkg/api/core/v1/service.pb.go): `pkg/api/core/v1/service.pb.go`
- [Core Server](https://github.com/openaudio/go-openaudio/blob/main/pkg/core/server/server.go): `pkg/core/server/server.go`
- **CometBFT Network**
- [Core PostgreSQL](https://github.com/openaudio/go-openaudio/blob/main/pkg/core/db/db.go): `pkg/core/db/db.go`

### Media Storage

- [Mediorum Storage](https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/server.go): `pkg/mediorum/server/server.go`
- [Storage API](https://github.com/openaudio/go-openaudio/blob/main/pkg/api/storage/v1/service.pb.go): `pkg/api/storage/v1/service.pb.go`
- [Media Blob Store](https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/local_disk.go): `pkg/mediorum/server/local_disk.go`
- [Storage Metrics](https://github.com/openaudio/go-openaudio/blob/main/pkg/mediorum/server/storage_metrics.go): `pkg/mediorum/server/storage_metrics.go`

### Indexing and Views

- [ETL Service](https://github.com/openaudio/go-openaudio/blob/main/pkg/etlserver/server.go): `pkg/etlserver/server.go`
- [Blockchain Indexer](https://github.com/openaudio/go-openaudio/blob/main/pkg/etl/indexer.go): `pkg/etl/indexer.go`
- [ETL PostgreSQL](https://github.com/openaudio/go-openaudio/blob/main/pkg/etl/db/db.go): `pkg/etl/db/db.go`
- [Block Explorer](https://github.com/openaudio/go-openaudio/blob/main/pkg/explorer/explorer.go): `pkg/explorer/explorer.go`
- [Node Console](https://github.com/openaudio/go-openaudio/blob/main/pkg/core/console/routes.go): `pkg/core/console/routes.go`

### Ethereum Integration

- [Ethereum Service](https://github.com/openaudio/go-openaudio/blob/main/pkg/eth/eth.go): `pkg/eth/eth.go`
- [Protocol Contracts](https://github.com/openaudio/go-openaudio/blob/main/pkg/eth/contracts/contracts.go): `pkg/eth/contracts/contracts.go`

### Operations

- [Genesis Writer](https://github.com/openaudio/go-openaudio/blob/main/cmd/genesis-writer/main.go): `cmd/genesis-writer/main.go`

### Other components

- **Client or Operator**
- **Ethereum Network**

## Connections

- Client or Operator → HTTP RPC Host: requests
- HTTP RPC Host → Core API: dispatches
- HTTP RPC Host → Storage API: dispatches
- HTTP RPC Host → ETL Service: dispatches
- HTTP RPC Host → Node Console: serves
- HTTP RPC Host → Block Explorer: serves
- Core API → Core Server: calls
- Core Server → CometBFT Network: commits state
- Core Server → Core PostgreSQL: reads writes
- Storage API → Mediorum Storage: calls
- Mediorum Storage → Media Blob Store: stores blobs
- Mediorum Storage → Storage Metrics: records metrics
- Node Console → Storage API: gets diagnostics
- ETL Service → Blockchain Indexer: runs indexer
- Blockchain Indexer → ETL PostgreSQL: materializes data
- Block Explorer → ETL PostgreSQL: queries data
- Core Server → Ethereum Service: uses chain
- Ethereum Service → Protocol Contracts: binds contracts
- Protocol Contracts → Ethereum Network: calls contracts
- Genesis Writer → Core PostgreSQL: writes history
- Genesis Writer → CometBFT Network: primes state
