bcc-api-1.99.0
Safe HaskellNone
LanguageHaskell2010

Bcc.Api.IPC

Description

Node IPC protocols

Synopsis

Node interaction

Operations that involve talking to a local Bcc 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 Bcc.Api

data ColeMode Source #

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

This was used on the mainnet before the deployment of the multi-era BccMode. 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.

data SophieMode Source #

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

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

data BccMode Source #

The Bcc consensus mode consists of all the eras currently in use on the Bcc mainnet. This is currently: the ColeEra; SophieEra, EvieEra and JenEra, in that order.

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

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 Cole era that requires extra parameters, but this is of course inherited by the BccMode that uses the Cole era. The reason this parameter is needed stems from unfortunate design decisions from the legacy Cole era. The slots per epoch are needed to be able to decode epoch boundary blocks from the Cole 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 Bcc.Api.Modes

newtype EpochSlots #

Constructors

EpochSlots 

Fields

Instances

Instances details
Eq EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Data EpochSlots 
Instance details

Defined in Bcc.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 Bcc.Chain.Slotting.EpochSlots

Read EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Show EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Generic EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlotsTypeType Source #

Buildable EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

buildEpochSlotsBuilder

NoThunks EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

noThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

wNoThunks ∷ Context → EpochSlotsIO (Maybe ThunkInfo)

showTypeOfProxy EpochSlotsString

FromCBOR EpochSlots 
Instance details

Defined in Bcc.Chain.Slotting.EpochSlots

Methods

fromCBOR ∷ Decoder s EpochSlots #

labelProxy EpochSlotsText #

ToCBOR EpochSlots 
Instance details

Defined in Bcc.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 Bcc.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 ('MetaData "EpochSlots" "Bcc.Chain.Slotting.EpochSlots" "bcc-ledger-cole-0.1.0.0-6008ffc54c78353d0f5147cdbc5bfdf298d329fad75e5df92e68f459a4ba4121" '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 BccMode 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 Bcc.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 BccMode 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.

TxInColeSpecial ∷ GenTx ColeBlock → EraInMode ColeEra mode → TxInMode mode

Cole 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 Bcc.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 Bcc.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 Bcc.Api.TxInMode

data SubmitResult reason #

Constructors

SubmitSuccess 
SubmitFail reason 

Instances

Instances details
Functor SubmitResult 
Instance details

Defined in Shardagnostic.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 Shardagnostic.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 #

Constructors

QueryCurrentEraConsensusModeIsMultiEra mode → QueryInMode mode AnyBccEra 
QueryInEraEraInMode era mode → QueryInEra era result → QueryInMode mode (Either EraMismatch result) 
QueryEraHistoryConsensusModeIsMultiEra mode → QueryInMode mode (EraHistory mode) 
QuerySystemStartQueryInMode mode SystemStart 

Instances

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

Defined in Bcc.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

QueryColeUpdateStateQueryInEra ColeEra ColeUpdateState 
QueryInSophieBasedEraSophieBasedEra era → QueryInSophieBasedEra era result → QueryInEra era result 

Instances

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

Defined in Bcc.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 Bcc.Api.Modes

data NodeToClientVersion #

Instances

Instances details
Bounded NodeToClientVersion 
Instance details

Defined in Shardagnostic.Network.NodeToClient.Version

Enum NodeToClientVersion 
Instance details

Defined in Shardagnostic.Network.NodeToClient.Version

Eq NodeToClientVersion 
Instance details

Defined in Shardagnostic.Network.NodeToClient.Version

Ord NodeToClientVersion 
Instance details

Defined in Shardagnostic.Network.NodeToClient.Version

Show NodeToClientVersion 
Instance details

Defined in Shardagnostic.Network.NodeToClient.Version