cardano-api-1.30.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.IPC

Description

Node IPC protocols

Synopsis

Node interaction

Operations that involve talking to a local Cardano node.

connectToLocalNodeLocalNodeConnectInfo mode → LocalNodeClientProtocolsInMode mode → IO () Source #

Establish a connection to a local node and execute the given set of protocol handlers.

connectToLocalNodeWithVersionLocalNodeConnectInfo mode → (NodeToClientVersionLocalNodeClientProtocolsInMode mode) → IO () Source #

Establish a connection to a local node and execute the given set of protocol handlers parameterized on the negotiated node-to-client protocol version.

data LocalNodeClientProtocols block point tip tx txerr query m Source #

The protocols we can use with a local node. Use in conjunction with connectToLocalNode.

These protocols use the types from the rest of this API. The conversion to/from the types used by the underlying wire formats is handled by connectToLocalNode.

Modes

TODO move to Cardano.Api

data ByronMode Source #

The Byron-only consensus mode consists of only the Byron era.

This was used on the mainnet before the deployment of the multi-era CardanoMode. It is now of little practical use, though it illustrates how a single-era consensus mode works. It may be sensible to remove this at some stage.

Instances

Instances details
FromJSON (EraInMode ByronEra ByronMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode ByronEra ByronMode) #

parseJSONList ∷ Value → Parser [EraInMode ByronEra ByronMode] #

data ShelleyMode Source #

The Shelley-only consensus mode consists of only the Shelley era.

This was used for the early Shelley testnets prior to the use of the multi-era CardanoMode. It is useful for setting up Shelley test networks (e.g. for benchmarking) without having to go through the complication of the hard fork from Byron to Shelley eras. It also shows how a single-era consensus mode works. It may be replaced by other single-era modes in future.

Instances

Instances details
FromJSON (EraInMode ShelleyEra ShelleyMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode ShelleyEra ShelleyMode) #

parseJSONList ∷ Value → Parser [EraInMode ShelleyEra ShelleyMode] #

data CardanoMode Source #

The Cardano consensus mode consists of all the eras currently in use on the Cardano mainnet. This is currently: the ByronEra; ShelleyEra, AllegraEra and MaryEra, in that order.

This mode will be extended with new eras as the Cardano mainnet develops.

Instances

Instances details
FromJSON (EraInMode AlonzoEra CardanoMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode AlonzoEra CardanoMode) #

parseJSONList ∷ Value → Parser [EraInMode AlonzoEra CardanoMode] #

FromJSON (EraInMode MaryEra CardanoMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode MaryEra CardanoMode) #

parseJSONList ∷ Value → Parser [EraInMode MaryEra CardanoMode] #

FromJSON (EraInMode AllegraEra CardanoMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode AllegraEra CardanoMode) #

parseJSONList ∷ Value → Parser [EraInMode AllegraEra CardanoMode] #

FromJSON (EraInMode ShelleyEra CardanoMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode ShelleyEra CardanoMode) #

parseJSONList ∷ Value → Parser [EraInMode ShelleyEra CardanoMode] #

FromJSON (EraInMode ByronEra CardanoMode) Source # 
Instance details

Defined in Cardano.Api.Modes

Methods

parseJSON ∷ Value → Parser (EraInMode ByronEra CardanoMode) #

parseJSONList ∷ Value → Parser [EraInMode ByronEra CardanoMode] #

data ConsensusModeParams mode where Source #

The consensus-mode-specific parameters needed to connect to a local node that is using each consensus mode.

It is in fact only the Byron era that requires extra parameters, but this is of course inherited by the CardanoMode that uses the Byron era. The reason this parameter is needed stems from unfortunate design decisions from the legacy Byron era. The slots per epoch are needed to be able to decode epoch boundary blocks from the Byron era.

It is possible in future that we may be able to eliminate this parameter by discovering it from the node during the initial handshake.

Instances

Instances details
Show (ConsensusModeParams mode) Source # 
Instance details

Defined in Cardano.Api.Modes

newtype EpochSlots #

Constructors

EpochSlots 

Fields

Instances

Instances details
Eq EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Data EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → EpochSlots → c EpochSlots Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c EpochSlots Source #

toConstrEpochSlotsConstr Source #

dataTypeOfEpochSlotsDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c EpochSlots) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c EpochSlots) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → EpochSlotsEpochSlots Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → EpochSlots → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → EpochSlots → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

Ord EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Read EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Show EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Generic EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlotsTypeType Source #

Buildable EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

buildEpochSlotsBuilder

NoThunks EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

noThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

wNoThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

showTypeOfProxy EpochSlotsString

FromCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

fromCBOR ∷ Decoder s EpochSlots #

labelProxy EpochSlotsText #

ToCBOR EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

toCBOREpochSlots → Encoding #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochSlots → Size #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochSlots] → Size #

type Rep EpochSlots 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Cardano.Chain.Slotting.EpochSlots" "cardano-ledger-byron-0.1.0.0-afb98b8e980cee75d8bdc9504be615617050882fa9246457614ea65b70754e62" 'True) (C1 ('MetaCons "EpochSlots" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

Chain sync protocol

newtype ChainSyncClient header point tip (m ∷ TypeType) a #

Constructors

ChainSyncClient 

Fields

newtype ChainSyncClientPipelined header point tip (m ∷ TypeType) a #

Constructors

ChainSyncClientPipelined 

Fields

data BlockInMode mode where Source #

A Block in one of the eras supported by a given protocol mode.

For multi-era modes such as the CardanoMode this type is a sum of the different block types for all the eras. It is used in the ChainSync protocol.

Constructors

BlockInModeBlock era → EraInMode era mode → BlockInMode mode 

Instances

Instances details
Show (BlockInMode mode) Source # 
Instance details

Defined in Cardano.Api.Block

Methods

showsPrecIntBlockInMode mode → ShowS Source #

showBlockInMode mode → String Source #

showList ∷ [BlockInMode mode] → ShowS Source #

Local tx submission

newtype LocalTxSubmissionClient tx reject (m ∷ TypeType) a #

Constructors

LocalTxSubmissionClient 

Fields

data TxInMode mode where Source #

A Tx in one of the eras supported by a given protocol mode.

For multi-era modes such as the CardanoMode this type is a sum of the different transaction types for all the eras. It is used in the LocalTxSubmission protocol.

Constructors

TxInModeTx era → EraInMode era mode → TxInMode mode

Everything we consider a normal transaction.

TxInByronSpecial ∷ GenTx ByronBlock → EraInMode ByronEra mode → TxInMode mode

Byron has various things we can post to the chain which are not actually transactions. This covers: update proposals, votes and delegation certs.

Instances

Instances details
Show (TxInMode mode) Source # 
Instance details

Defined in Cardano.Api.TxInMode

Methods

showsPrecIntTxInMode mode → ShowS Source #

showTxInMode mode → String Source #

showList ∷ [TxInMode mode] → ShowS Source #

data TxValidationErrorInMode mode where Source #

A TxValidationError in one of the eras supported by a given protocol mode.

This is used in the LocalStateQuery protocol.

Instances

Instances details
Show (TxValidationErrorInMode mode) Source # 
Instance details

Defined in Cardano.Api.TxInMode

data TxValidationError era Source #

The transaction validations errors that can occur from trying to submit a transaction to a local node. The errors are specific to an era.

Instances

Instances details
Show (TxValidationError era) Source # 
Instance details

Defined in Cardano.Api.TxInMode

data SubmitResult reason #

Constructors

SubmitSuccess 
SubmitFail reason 

Instances

Instances details
Functor SubmitResult 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type

Methods

fmap ∷ (a → b) → SubmitResult a → SubmitResult b Source #

(<$) ∷ a → SubmitResult b → SubmitResult a Source #

Eq reason ⇒ Eq (SubmitResult reason) 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type

Methods

(==)SubmitResult reason → SubmitResult reason → Bool Source #

(/=)SubmitResult reason → SubmitResult reason → Bool Source #

Local state query

newtype LocalStateQueryClient block point (query ∷ TypeType) (m ∷ TypeType) a #

Constructors

LocalStateQueryClient 

Fields

data QueryInMode mode result where Source #

Instances

Instances details
Show (QueryInMode mode result) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

showsPrecIntQueryInMode mode result → ShowS Source #

showQueryInMode mode result → String Source #

showList ∷ [QueryInMode mode result] → ShowS Source #

data QueryInEra era result where Source #

Constructors

QueryByronUpdateStateQueryInEra ByronEra ByronUpdateState 
QueryInShelleyBasedEraShelleyBasedEra era → QueryInShelleyBasedEra era result → QueryInEra era result 

Instances

Instances details
Show (QueryInEra era result) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

showsPrecIntQueryInEra era result → ShowS Source #

showQueryInEra era result → String Source #

showList ∷ [QueryInEra era result] → ShowS Source #

queryNodeLocalState ∷ ∀ mode result. LocalNodeConnectInfo mode → Maybe ChainPointQueryInMode mode result → IO (Either AcquireFailure result) Source #

Establish a connection to a node and execute a single query using the local state query protocol.

data EraHistory mode where Source #

Constructors

EraHistoryConsensusBlockForMode mode ~ HardForkBlock xs ⇒ ConsensusMode mode → Interpreter xs → EraHistory mode 

getProgressSlotNoEraHistory mode → Either PastHorizonException (RelativeTime, SlotLength) Source #

Common queries

Helpers

data ConsensusMode mode where Source #

This GADT provides a value-level representation of all the consensus modes. This enables pattern matching on the era to allow them to be treated in a non-uniform way.

Instances

Instances details
Show (ConsensusMode mode) Source # 
Instance details

Defined in Cardano.Api.Modes

data NodeToClientVersion #

Instances

Instances details
Bounded NodeToClientVersion 
Instance details

Defined in Ouroboros.Network.NodeToClient.Version

Enum NodeToClientVersion 
Instance details

Defined in Ouroboros.Network.NodeToClient.Version

Eq NodeToClientVersion 
Instance details

Defined in Ouroboros.Network.NodeToClient.Version

Ord NodeToClientVersion 
Instance details

Defined in Ouroboros.Network.NodeToClient.Version

Show NodeToClientVersion 
Instance details

Defined in Ouroboros.Network.NodeToClient.Version