Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/20260602_cardano_api_consensus_reexports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project: cardano-api
pr: 1232
kind:
- compatible
description: |
Re-export consensus types from Cardano.Api.Consensus for node kernel access: NodeKernel, ChainDB, BlockComponent, RealPoint, OneEraHash, HeaderHash, HasHeader, BlockType, StandardCrypto, CardanoBlock, blockNo.
6 changes: 6 additions & 0 deletions .changes/20260602_cardano_rpc_fetchblock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project: cardano-rpc
pr: 1232
kind:
- feature
description: |
Implement FetchBlock SyncService method via node kernel access. Fetches blocks from ChainDB with raw CBOR bytes and cardano block header (slot, hash, height).
Comment on lines +3 to +6
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ cardano-wasm/examples/*/main.js
cardano-wasm/examples/*/cardano_node_grpc_web_pb.js
.ghc-wasm/

.serena/
13 changes: 13 additions & 0 deletions cardano-api/src/Cardano/Api/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,25 @@ module Cardano.Api.Consensus
, ProtocolClientInfoArgs (..)

-- * Reexports from @ouroboros-consensus@
, BlockComponent (..)
, ByronBlock
, CardanoBlock
, ChainDB.ChainDB
, ChainDB.getBlockComponent
, ChainDepState
, GenTx (..)
, EraMismatch (..)
, HasHeader
, HeaderHash
, NodeKernel (..)
, OneEraHash (..)
, PastHorizonException
, PraosProtocolSupportsNode
, PraosProtocolSupportsNodeCrypto
, RealPoint (..)
, ShelleyGenesisStaking (..)
, StandardCrypto
, blockNo
, byronIdTx
, condense
, getOpCertCounters
Expand All @@ -68,3 +79,5 @@ import Cardano.Api.Consensus.Internal.InMode
import Cardano.Api.Consensus.Internal.Mode
import Cardano.Api.Consensus.Internal.Protocol
import Cardano.Api.Consensus.Internal.Reexport

import Ouroboros.Consensus.Storage.ChainDB qualified as ChainDB
18 changes: 16 additions & 2 deletions cardano-api/src/Cardano/Api/Consensus/Internal/Reexport.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
module Cardano.Api.Consensus.Internal.Reexport
( ByronBlock
( BlockComponent (..)
, ByronBlock
, CardanoBlock
, ChainDepState
, GenTx (..)
, HasHeader
, HeaderHash
, EraMismatch (..)
, NodeKernel (..)
, OneEraHash (..)
, PastHorizonException
, PraosProtocolSupportsNode
, PraosProtocolSupportsNodeCrypto
, RealPoint (..)
, ShelleyGenesisStaking (..)
, StandardCrypto
, blockNo
, byronIdTx
, condense
, getOpCertCounters
Expand All @@ -16,19 +25,24 @@ module Cardano.Api.Consensus.Internal.Reexport
)
where

import Cardano.Protocol.Crypto (StandardCrypto)
import Ouroboros.Consensus.Block (HasHeader, HeaderHash, RealPoint (..), blockNo)
import Ouroboros.Consensus.Byron.Ledger (ByronBlock, GenTx (..), byronIdTx)
import Ouroboros.Consensus.Cardano.Block (EraMismatch (..))
import Ouroboros.Consensus.Cardano.Block (CardanoBlock, EraMismatch (..))
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (OneEraHash (..))
import Ouroboros.Consensus.HardFork.History.EpochInfo (interpreterToEpochInfo)
import Ouroboros.Consensus.HardFork.History.Qry
( PastHorizonException
, unsafeExtendSafeZone
)
import Ouroboros.Consensus.Ledger.SupportsMempool (txId)
import Ouroboros.Consensus.Node (NodeKernel (..))
import Ouroboros.Consensus.Protocol.Abstract (ChainDepState)
import Ouroboros.Consensus.Protocol.Praos.Common
( PraosProtocolSupportsNode
, PraosProtocolSupportsNodeCrypto
, getOpCertCounters
)
import Ouroboros.Consensus.Shelley.Node (ShelleyGenesisStaking (..))
import Ouroboros.Consensus.Storage.Common (BlockComponent (..))
import Ouroboros.Consensus.Util.Condense (condense)
2 changes: 1 addition & 1 deletion cardano-rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It implements [UTxO RPC](https://utxorpc.org/introduction) protobuf communicatio

| Method | Status |
|--------|--------|
| [FetchBlock](https://utxorpc.org/sync/spec/#fetchblockrequest) | ⬜ Not supported |
| [FetchBlock](https://utxorpc.org/sync/spec/#fetchblockrequest) | 🚧 In progress (missing: `Block.timestamp`, `Block.body.tx`) |
| [DumpHistory](https://utxorpc.org/sync/spec/#dumphistoryrequest) | ⬜ Not supported |
| [FollowTip](https://utxorpc.org/sync/spec/#followtiprequest) | ⬜ Not supported |
| [ReadTip](https://utxorpc.org/sync/spec/#readtiprequest) | ⬜ Not supported |
Expand Down
6 changes: 6 additions & 0 deletions cardano-rpc/cardano-rpc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ library
Cardano.Rpc.Proto.Api.Node
Cardano.Rpc.Proto.Api.UtxoRpc.Query
Cardano.Rpc.Proto.Api.UtxoRpc.Submit
Cardano.Rpc.Proto.Api.UtxoRpc.Sync
Cardano.Rpc.Server
Cardano.Rpc.Server.Config
Cardano.Rpc.Server.Internal.Env
Expand All @@ -62,7 +63,10 @@ library
Cardano.Rpc.Server.Internal.UtxoRpc.Predicate
Cardano.Rpc.Server.Internal.UtxoRpc.Query
Cardano.Rpc.Server.Internal.UtxoRpc.Submit
Cardano.Rpc.Server.Internal.UtxoRpc.Sync
Cardano.Rpc.Server.Internal.UtxoRpc.Type
Cardano.Rpc.Server.NodeKernelAccess
Cardano.Rpc.Server.NodeKernelAccess.Internal

other-modules:
Cardano.Rpc.Server.Internal.Orphans
Expand Down Expand Up @@ -111,6 +115,8 @@ library gen
Proto.Utxorpc.V1beta.Query.Query_Fields
Proto.Utxorpc.V1beta.Submit.Submit
Proto.Utxorpc.V1beta.Submit.Submit_Fields
Proto.Utxorpc.V1beta.Sync.Sync
Proto.Utxorpc.V1beta.Sync.Sync_Fields

build-depends:
proto-lens-protobuf-types,
Expand Down
Loading
Loading