ouroboros-network-0.1.0.1: A networking layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Examples

Synopsis

Documentation

localStateQueryClient :: forall block point query result m. Applicative m => [( Maybe point, query result)] -> LocalStateQueryClient block point query m [( Maybe point, Either AcquireFailure result)] Source #

An example LocalStateQueryClient , which, for each point in the given list, acquires the state for that point, and if that succeeds, returns the result for the corresponding query. When the state could not be acquired, the AcquireFailure is returned instead of the query results.

localStateQueryServer :: forall block point query m state. Applicative m => ( Maybe point -> Either AcquireFailure state) -> ( forall result. state -> query result -> result) -> LocalStateQueryServer block point query m () Source #

An example LocalStateQueryServer . The first function is called to acquire a state , after which the second will be used to query the state.