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

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 :: Type -> Type ) 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

StIdle :: LocalStateQuery block point query

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

There is no timeout in this state.

StAcquiring :: LocalStateQuery 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.

StAcquired :: LocalStateQuery 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.

StDone :: LocalStateQuery 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

Show ( ClientHasAgency st) Source #
Instance details

Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type

( forall result. Show (query result)) => Show ( ServerHasAgency 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

Protocol ( 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) 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
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

class ( forall 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 :: forall result. query result -> result -> String Source #