ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
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 #

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

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

Show (ClientHasAgency st) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

(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 Source #

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

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

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' #

data ClientHasAgency st #

data ServerHasAgency st #

data NobodyHasAgency st #

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 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 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 ClientHasAgency (st ∷ LocalStateQuery block point query) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

data ClientHasAgency (st ∷ LocalStateQuery block point query) where

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 #