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

Aperta
#1,229 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@carbolymer ci sta già lavorando.

Dal 27/5/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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 - #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 - #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 - #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

  • ReadTip (#1218) - same SyncService cluster, likely lands alongside FollowTip, but Kupo does not use it (tip comes back in FollowTip responses)
  • SubmitTx, EvalTx - already implemented, Kupo does not use them
  • Mempool watching, stake/governance queries - Kupo does not use them

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.

Lingua principale
Haskell
Stelle
41
Fork
33
Merge medio
3g 3h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/cardano-api

Tutte le issue di IntersectMBO/cardano-api

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.