hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.API.Server

Synopsis

Documentation

newtype Server tx m Source #

Handle to provide a means for sending server outputs to clients.

Constructors

Server 

Fields

withAPIServer :: forall tx. IsChainState tx => APIServerConfig -> RunOptions -> Environment -> Party -> EventSource (StateEvent tx) IO -> Tracer IO APIServerLog -> ChainStateType tx -> Chain tx IO -> PParams LedgerEra -> ServerOutputFilter tx -> (ClientInput tx -> IO ()) -> ((EventSink (StateEvent tx) IO, Server tx IO) -> IO ()) -> IO () Source #

setupServerNotification :: IO (NotifyServerRunning, WaitForServer) Source #

Setup notification and waiter to ensure that something only runs after the server is actually listening.

mkTimedServerOutputFromStateEvent :: IsChainState tx => Maybe (Snapshot tx) -> StateEvent tx -> Maybe (TimedServerOutput tx) Source #

Defines the subset of StateEvent that should be sent as TimedServerOutput to clients. The 'Maybe (Snapshot tx)' argument carries the snapshot currently being confirmed (from the preceding SnapshotRequested event), needed to reconstruct SnapshotConfirmed outputs when ServerOutput is absent from the event.

updateSeenSnapshot :: Maybe (Snapshot tx) -> StateChanged tx -> Maybe (Snapshot tx) Source #

Advance the seen-snapshot state as events are processed sequentially.

seenSnapshotOf :: NodeState tx -> Maybe (Snapshot tx) Source #

Extract the snapshot currently in SeenSnapshot from a NodeState, if any.

projectPendingDeposits :: IsTx tx => [TxIdType tx] -> StateChanged tx -> [TxIdType tx] Source #

Projection to obtain the list of pending deposits.

projectCommitInfo :: CommitInfo -> StateChanged tx -> CommitInfo Source #

Projection to obtain CommitInfo needed to draft commit transactions. NOTE: We only project HeadId when the Head is Open since that is when deposits can be made.