ouroboros-network-protocols-0.8.1.0: Ouroboros Network Protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Type

Description

The type of the local ledger state query protocol.

This is used by local clients (like wallets and CLI tools) to query the ledger state of a local node.

Synopsis

Documentation

data LocalStateQuery block point (query ∷ TypeType) where Source #

The kind of the local state query protocol, and the types of the states in the protocol state machine.

It is parametrised over the type of block (for points), the type of queries and query results.

Constructors

StIdleLocalStateQuery block point query

The client has agency. It can ask to acquire a state or terminate.

There is no timeout in this state.

StAcquiringLocalStateQuery block point query

The server has agency. it must acquire the state at the requested point or report a failure.

There is a timeout in this state.

StAcquiredLocalStateQuery block point query

The client has agency. It can request queries against the current state, or it can release the state.

StQuerying ∷ result → LocalStateQuery block point query

The server has agency. It must respond with the query result.

StDoneLocalStateQuery block point query

Nobody has agency. The terminal state.

Instances

Instances details
(ShowProxy block, ShowProxy query) ⇒ ShowProxy (LocalStateQuery block point query ∷ Type) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

showProxyProxy (LocalStateQuery block point query) → String Source #

Show (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

(∀ result. Show (query result)) ⇒ Show (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

NFData (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfClientHasAgency st → () #

NFData (NobodyHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfNobodyHasAgency st → () #

(∀ result. NFData (query result)) ⇒ NFData (ServerHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfServerHasAgency st → () #

(ShowQuery query, Show point) ⇒ Show (Message (LocalStateQuery block point query) st st') Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

showsPrecIntMessage (LocalStateQuery block point query) st st' → ShowS #

showMessage (LocalStateQuery block point query) st st' → String #

showList ∷ [Message (LocalStateQuery block point query) st st'] → ShowS #

(∀ result. NFData (query result), NFData point) ⇒ NFData (Message (LocalStateQuery block point query) from to) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfMessage (LocalStateQuery block point query) from to → () #

(∀ result. NFData (query result)) ⇒ NFData (PeerHasAgency pr st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfPeerHasAgency pr st → () #

Protocol (LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Associated Types

data Message (LocalStateQuery block point query) st st' Source #

data ClientHasAgency st Source #

data ServerHasAgency st Source #

data NobodyHasAgency st Source #

data ClientHasAgency (st ∷ LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

data ClientHasAgency (st ∷ LocalStateQuery block point query) where
data Message (LocalStateQuery block point query) (from ∷ LocalStateQuery block point query) (to ∷ LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

data Message (LocalStateQuery block point query) (from ∷ LocalStateQuery block point query) (to ∷ LocalStateQuery block point query) where
data NobodyHasAgency (st ∷ LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

data NobodyHasAgency (st ∷ LocalStateQuery block point query) where
data ServerHasAgency (st ∷ LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

data ServerHasAgency (st ∷ LocalStateQuery block point query) where

data Target point Source #

Constructors

VolatileTip

The tip of the volatile chain

Cannot fail to be acquired.

SpecificPoint point

A specified point

Fails to be acquired if the point is not between VolatileTip and ImmutableTip (inclusive).

ImmutableTip

The tip of the immutable chain

Cannot fail to be acquired.

Requires at least NodeToClientV_16.

Instances

Instances details
Foldable Target Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

foldMonoid m ⇒ Target m → m #

foldMapMonoid m ⇒ (a → m) → Target a → m #

foldMap'Monoid m ⇒ (a → m) → Target a → m #

foldr ∷ (a → b → b) → b → Target a → b #

foldr' ∷ (a → b → b) → b → Target a → b #

foldl ∷ (b → a → b) → b → Target a → b #

foldl' ∷ (b → a → b) → b → Target a → b #

foldr1 ∷ (a → a → a) → Target a → a #

foldl1 ∷ (a → a → a) → Target a → a #

toListTarget a → [a] #

nullTarget a → Bool #

lengthTarget a → Int #

elemEq a ⇒ a → Target a → Bool #

maximumOrd a ⇒ Target a → a #

minimumOrd a ⇒ Target a → a #

sumNum a ⇒ Target a → a #

productNum a ⇒ Target a → a #

Traversable Target Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

traverseApplicative f ⇒ (a → f b) → Target a → f (Target b) #

sequenceAApplicative f ⇒ Target (f a) → f (Target a) #

mapMMonad m ⇒ (a → m b) → Target a → m (Target b) #

sequenceMonad m ⇒ Target (m a) → m (Target a) #

Functor Target Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

fmap ∷ (a → b) → Target a → Target b #

(<$) ∷ a → Target b → Target a #

Generic (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Associated Types

type Rep (Target point) ∷ TypeType #

Methods

fromTarget point → Rep (Target point) x #

toRep (Target point) x → Target point #

Show point ⇒ Show (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

showsPrecIntTarget point → ShowS #

showTarget point → String #

showList ∷ [Target point] → ShowS #

NFData point ⇒ NFData (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfTarget point → () #

Eq point ⇒ Eq (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

(==)Target point → Target point → Bool #

(/=)Target point → Target point → Bool #

Ord point ⇒ Ord (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

compareTarget point → Target point → Ordering #

(<)Target point → Target point → Bool #

(<=)Target point → Target point → Bool #

(>)Target point → Target point → Bool #

(>=)Target point → Target point → Bool #

maxTarget point → Target point → Target point #

minTarget point → Target point → Target point #

type Rep (Target point) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

type Rep (Target point) = D1 ('MetaData "Target" "Ouroboros.Network.Protocol.LocalStateQuery.Type" "ouroboros-network-protocols-0.8.1.0-inplace" 'False) (C1 ('MetaCons "VolatileTip" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "SpecificPoint" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 point)) :+: C1 ('MetaCons "ImmutableTip" 'PrefixI 'False) (U1TypeType)))

data AcquireFailure Source #

Instances

Instances details
Enum AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Generic AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Associated Types

type Rep AcquireFailureTypeType #

Show AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

NFData AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Methods

rnfAcquireFailure → () #

Eq AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

type Rep AcquireFailure Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

type Rep AcquireFailure = D1 ('MetaData "AcquireFailure" "Ouroboros.Network.Protocol.LocalStateQuery.Type" "ouroboros-network-protocols-0.8.1.0-inplace" 'False) (C1 ('MetaCons "AcquireFailurePointTooOld" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "AcquireFailurePointNotOnChain" 'PrefixI 'False) (U1TypeType))

class (∀ result. Show (query result)) ⇒ ShowQuery query where Source #

To implement Show for:

('Message' ('LocalStateQuery' block query) st st')

we need a way to print the query GADT and its type index, result. This class contain the method we need to provide this Show instance.

We use a type class for this, as this Show constraint propagates to a lot of places.

Methods

showResult ∷ ∀ result. query result → result → String Source #