plutus-chain-index-core-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Protocol.Socket.Client

Synopsis

Documentation

data ChainSyncHandle event Source #

Constructors

ChainSyncHandle 

Fields

data ChainSyncEvent Source #

Constructors

Resume !ChainPoint 
RollForward !(BlockInMode CardanoMode) !ChainTip 
RollBackward !ChainPoint !ChainTip 

type ChainSyncCallback = ChainSyncEvent -> Slot -> IO () Source #

The Slot parameter here represents the current slot as computed from the current time. There is also the slot where the block was published, which is available from the ChainSyncEvent.

Currently we are using this current slot everywhere, which is why I leave it here, as a parameter.

data ClientMsg Source #

Instances

Instances details
Eq ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Show ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Generic ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Associated Types

type Rep ClientMsg :: Type -> Type Source #

FromJSON ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Methods

parseJSON :: Value -> Parser ClientMsg

parseJSONList :: Value -> Parser [ClientMsg]

ToJSON ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Methods

toJSON :: ClientMsg -> Value

toEncoding :: ClientMsg -> Encoding

toJSONList :: [ClientMsg] -> Value

toEncodingList :: [ClientMsg] -> Encoding

ToObject ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

Methods

toObject :: TracingVerbosity -> ClientMsg -> Object

textTransformer :: ClientMsg -> Object -> Text

type Rep ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

type Rep ClientMsg = D1 ('MetaData "ClientMsg" "Cardano.Protocol.Socket.Client" "plutus-chain-index-core-1.2.0.0-KXwe88sWnh3Kg9uXBYztrS" 'False) ((C1 ('MetaCons "Disconnected" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "Resumed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Point))) :+: (C1 ('MetaCons "RolledForward" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Tip)) :+: C1 ('MetaCons "RolledBackward" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Point))))

getCurrentSlot :: forall block. ChainSyncHandle block -> IO Slot Source #

runChainSync' :: FilePath -> SlotConfig -> NetworkId -> [ChainPoint] -> IO (ChainSyncHandle ChainSyncEvent) Source #

Run the chain sync protocol to get access to the current slot number.

runChainSync :: FilePath -> Trace IO ClientMsg -> SlotConfig -> NetworkId -> [ChainPoint] -> (ChainSyncEvent -> IO ()) -> IO (ChainSyncHandle ChainSyncEvent) Source #

chainSyncClient :: Trace IO ClientMsg -> SlotConfig -> [ChainPoint] -> ChainSyncCallback -> ChainSyncClient (BlockInMode CardanoMode) ChainPoint ChainTip IO () Source #

The client updates the application state when the protocol state changes.