Skip to content

gRPC: Replace Ogmios as Kupo's chain data source with cardano-rpc gRPC #1229

@carbolymer

Description

@carbolymer

Goal

Enable Kupo to use cardano-rpc as a drop-in replacement for its Ogmios backend.
Kupo currently uses Ogmios for chain synchronisation via WebSocket/JSON-RPC.
The same capability can be provided natively by cardano-rpc over gRPC, eliminating the need for a separate Ogmios process.

Kupo's Ogmios usage

Kupo depends on exactly three Ogmios methods:

Ogmios method Mini-protocol Purpose
findIntersection ChainSync Resume sync from a known chain point
nextBlock ChainSync Stream blocks (RollForward/RollBackward) with full block data
queryNetwork/genesisConfiguration Network query One-shot Byron genesis bootstrap (optional if local genesis files available)

Additionally, Kupo's HTTP API uses a separate Ogmios connection for ad-hoc historical block lookups (e.g. the /metadata endpoint fetches a block by slot on demand).

Required gRPC services

  1. SyncService.FollowTip - gRPC: Implement FollowTip (UTxO RPC SyncService) in cardano-rpc #1219
    Server-streaming RPC delivering blocks as applied/rolled back.
    Must carry full block data (transactions, inputs, outputs, datums, scripts, redeemers, metadata).
    This is the primary blocker - replaces Ogmios's findIntersection + nextBlock streaming.

  2. SyncService.FetchBlock - gRPC: Implement FetchBlock (UTxO RPC SyncService) in cardano-rpc #1216
    Retrieve a full block by chain point.
    Required for Kupo's HTTP API endpoints that perform ad-hoc historical block lookups (e.g. /metadata).

  3. QueryService.ReadGenesis - gRPC: Implement ReadGenesis (UTxO RPC QueryService) in cardano-rpc #1217
    Return genesis configuration for all eras.
    Only required when Kupo cannot read genesis files from disk.

Prerequisites

  • ADR-019 (node kernel access) - direct ChainDB access is needed for efficient block streaming and block-by-point retrieval.
    Current N2C IPC (one connection per request, double serialisation) cannot support this.

Not required for this goal

Downstream integration

Once the gRPC services exist, Kupo needs a new ChainProducer backend (alongside its existing CardanoNode, Ogmios, Hydra backends) that connects via gRPC instead of WebSocket.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions