cardano-node-socket-emulator-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Node.Socket.Emulator.Types

Description

This module exports data types for logging, events and configuration

Synopsis

Documentation

type Tip = Tip (CardanoBlock StandardCrypto) Source #

type TxPool = [CardanoTx] Source #

data SocketEmulatorState Source #

Constructors

SocketEmulatorState 

Fields

Instances

Instances details
Show SocketEmulatorState Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Generic SocketEmulatorState Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Associated Types

type Rep SocketEmulatorState :: Type -> Type Source #

type Rep SocketEmulatorState Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

type Rep SocketEmulatorState = D1 ('MetaData "SocketEmulatorState" "Cardano.Node.Socket.Emulator.Types" "cardano-node-socket-emulator-1.2.0.0-EdqiJYpns1WHGNvporLa4Z" 'False) (C1 ('MetaCons "SocketEmulatorState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_emulatorState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EmulatorState) :*: (S1 ('MetaSel ('Just "_channel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TChan Block)) :*: S1 ('MetaSel ('Just "_tip") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Tip))))

emulatorState :: Lens' SocketEmulatorState EmulatorState Source #

channel :: Lens' SocketEmulatorState (TChan Block) Source #

data NodeServerConfig Source #

Node server configuration

Constructors

NodeServerConfig 

Fields

Instances

Instances details
Eq NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Show NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Generic NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Associated Types

type Rep NodeServerConfig :: Type -> Type Source #

ToJSON NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

FromJSON NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

parseJSON :: Value -> Parser NodeServerConfig

parseJSONList :: Value -> Parser [NodeServerConfig]

Default NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Pretty NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

pretty :: NodeServerConfig -> Doc ann

prettyList :: [NodeServerConfig] -> Doc ann

type Rep NodeServerConfig Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

type Rep NodeServerConfig = D1 ('MetaData "NodeServerConfig" "Cardano.Node.Socket.Emulator.Types" "cardano-node-socket-emulator-1.2.0.0-EdqiJYpns1WHGNvporLa4Z" 'False) (C1 ('MetaCons "NodeServerConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nscBaseUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BaseUrl) :*: (S1 ('MetaSel ('Just "nscInitialTxWallets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [WalletNumber]) :*: S1 ('MetaSel ('Just "nscSocketPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FilePath))) :*: ((S1 ('MetaSel ('Just "nscKeptBlocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "nscSlotConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SlotConfig)) :*: (S1 ('MetaSel ('Just "nscNetworkId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NetworkId) :*: S1 ('MetaSel ('Just "nscProtocolParametersJsonPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe FilePath))))))

data AppState Source #

Application State

Constructors

AppState 

Fields

Instances

Instances details
Show AppState Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

emulatorLogs :: Lens' AppState EmulatorLogs Source #

initialChainState :: MonadIO m => Map CardanoAddress Value -> m SocketEmulatorState Source #

ChainState with initial values

getChannel :: MonadIO m => MVar AppState -> m (TChan Block) Source #

setTip :: MonadIO m => MVar AppState -> Block -> m () Source #

data CNSEServerLogMsg Source #

Top-level logging data type for structural logging inside the CNSE server.

Constructors

StartingSlotCoordination UTCTime Millisecond 
StartingCNSEServer Int 
ProcessingEmulatorMsg EmulatorMsg 

Instances

Instances details
Show CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Generic CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Associated Types

type Rep CNSEServerLogMsg :: Type -> Type Source #

ToJSON CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

FromJSON CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

parseJSON :: Value -> Parser CNSEServerLogMsg

parseJSONList :: Value -> Parser [CNSEServerLogMsg]

Pretty CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

pretty :: CNSEServerLogMsg -> Doc ann

prettyList :: [CNSEServerLogMsg] -> Doc ann

type Rep CNSEServerLogMsg Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

type Rep CNSEServerLogMsg = D1 ('MetaData "CNSEServerLogMsg" "Cardano.Node.Socket.Emulator.Types" "cardano-node-socket-emulator-1.2.0.0-EdqiJYpns1WHGNvporLa4Z" 'False) (C1 ('MetaCons "StartingSlotCoordination" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Millisecond)) :+: (C1 ('MetaCons "StartingCNSEServer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "ProcessingEmulatorMsg" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EmulatorMsg))))

newtype BlockId Source #

The node protocols require a block header type.

Constructors

BlockId 

Fields

Instances

Instances details
Eq BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Ord BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Show BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Generic BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Associated Types

type Rep BlockId :: Type -> Type Source #

Pretty BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

pretty :: BlockId -> Doc ann

prettyList :: [BlockId] -> Doc ann

Serialise BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

Methods

encode :: BlockId -> Encoding

decode :: Decoder s BlockId

encodeList :: [BlockId] -> Encoding

decodeList :: Decoder s [BlockId]

type Rep BlockId Source # 
Instance details

Defined in Cardano.Node.Socket.Emulator.Types

type Rep BlockId = D1 ('MetaData "BlockId" "Cardano.Node.Socket.Emulator.Types" "cardano-node-socket-emulator-1.2.0.0-EdqiJYpns1WHGNvporLa4Z" 'True) (C1 ('MetaCons "BlockId" 'PrefixI 'True) (S1 ('MetaSel ('Just "getBlockId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

blockId :: Block -> BlockId Source #

A hash of the block's contents.

nodeToClientVersion :: NodeToClientVersion Source #

Protocol versions

nodeToClientVersionData :: NodeToClientVersionData Source #

A temporary definition of the protocol version. This will be moved as an argument to the client connection function in a future PR (the network magic number matches the one in the test net created by scripts)

doNothingInitiatorProtocol :: MonadTimer m => RunMiniProtocol 'InitiatorMode ByteString m a Void Source #

A protocol client that will never leave the initial state.

doNothingResponderProtocol :: MonadTimer m => RunMiniProtocol 'ResponderMode ByteString m Void a Source #

epochSlots :: EpochSlots Source #

Boilerplate codecs used for protocol serialisation.

The number of epochSlots is specific to each blockchain instance. This value is what the cardano main and testnet uses. Only applies to the Byron era.

codecVersion :: BlockNodeToClientVersion (CardanoBlock StandardCrypto) Source #

codecConfig :: CodecConfig (CardanoBlock StandardCrypto) Source #

nodeToClientCodecs :: forall m. MonadST m => ClientCodecs (CardanoBlock StandardCrypto) m Source #

chainSyncCodec :: block ~ CardanoBlock StandardCrypto => Codec (ChainSync block (Point block) Tip) DeserialiseFailure IO ByteString Source #

These codecs are currently used in the mock nodes and will probably soon get removed as the mock nodes are phased out.

txSubmissionCodec :: block ~ CardanoBlock StandardCrypto => Codec (LocalTxSubmission (GenTx block) (ApplyTxErr block)) DeserialiseFailure IO ByteString Source #

toCardanoBlock :: Header StandardCrypto -> Block -> CardanoBlock StandardCrypto Source #

fromCardanoBlock :: CardanoBlock StandardCrypto -> Block Source #