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

Cardano.Protocol.Socket.Client

Synopsis

Documentation

data ChainSyncHandle event Source #

Constructors

ChainSyncHandle 

Fields

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 #

ToJSON ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

FromJSON ClientMsg Source # 
Instance details

Defined in Cardano.Protocol.Socket.Client

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-0.1.0.0-EG2fOrGca5623jCDzCiAyI" '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.

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.