cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.NodeKernelAccess

Synopsis

Documentation

data NodeKernelAccess Source #

In-process access to the node kernel. Constructed by cardano-node once consensus initialisation completes.

Constructors

NodeKernelAccess 

Fields

Instances

Instances details
Has (IORef (Maybe NodeKernelAccess)) RpcEnv Source # 
Instance details

Defined in Cardano.Rpc.Server.Internal.Monad

mkNodeKernelAccess Source #

Arguments

:: Tracer IO Text

Tracer for unsupported block type warnings

-> BlockType blk

Block type witness

-> NodeKernel IO addrNTN addrNTC blk

Consensus node kernel

-> IO (Maybe NodeKernelAccess) 

Construct NodeKernelAccess from a consensus NodeKernel. Returns Nothing and traces the block type for non-Cardano block types.

fetchBlock Source #

Arguments

:: MonadIO m 
=> NodeKernelAccess

Node kernel access handle

-> SlotNo

Block slot number

-> Hash BlockHeader

Block header hash

-> m (Maybe (ByteString, BlockNo))

Raw CBOR bytes and block number, or Nothing if not found

Fetch a raw block and its block number from ChainDB by slot and header hash.

grabNodeKernelAccess :: MonadRpc e m => m NodeKernelAccess Source #

Grab the current NodeKernelAccess from the environment, or throw gRPC UNAVAILABLE if the node kernel has not yet initialised.