Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module exports data types for logging, events and configuration
Synopsis
- type Tip = Tip (CardanoBlock StandardCrypto)
- type TxPool = [CardanoTx]
- data SocketEmulatorState = SocketEmulatorState {
- _emulatorState :: EmulatorState
- _channel :: TChan Block
- _tip :: Tip
- tip :: Lens' SocketEmulatorState Tip
- emulatorState :: Lens' SocketEmulatorState EmulatorState
- channel :: Lens' SocketEmulatorState (TChan Block)
- data NodeServerConfig = NodeServerConfig {
- nscBaseUrl :: BaseUrl
- nscInitialTxWallets :: [WalletNumber]
- nscSocketPath :: FilePath
- nscKeptBlocks :: Integer
- nscSlotConfig :: SlotConfig
- nscNetworkId :: NetworkId
- nscProtocolParametersJsonPath :: Maybe FilePath
- defaultNodeServerConfig :: NodeServerConfig
- data AppState = AppState {
- _socketEmulatorState :: SocketEmulatorState
- _emulatorLogs :: EmulatorLogs
- socketEmulatorState :: Lens' AppState SocketEmulatorState
- emulatorLogs :: Lens' AppState EmulatorLogs
- fromEmulatorChainState :: MonadIO m => EmulatorState -> m SocketEmulatorState
- initialChainState :: MonadIO m => Map CardanoAddress Value -> m SocketEmulatorState
- getChannel :: MonadIO m => MVar AppState -> m (TChan Block)
- getTip :: MonadIO m => MVar AppState -> m Tip
- setTip :: MonadIO m => MVar AppState -> Block -> m ()
- data CNSEServerLogMsg
- = StartingSlotCoordination UTCTime Millisecond
- | StartingCNSEServer Int
- | ProcessingEmulatorMsg EmulatorMsg
- newtype BlockId = BlockId {
- getBlockId :: ShortByteString
- blockId :: Block -> BlockId
- nodeToClientVersion :: NodeToClientVersion
- nodeToClientVersionData :: NodeToClientVersionData
- doNothingInitiatorProtocol :: MonadTimer m => RunMiniProtocol 'InitiatorMode ByteString m a Void
- doNothingResponderProtocol :: MonadTimer m => RunMiniProtocol 'ResponderMode ByteString m Void a
- epochSlots :: EpochSlots
- codecVersion :: BlockNodeToClientVersion (CardanoBlock StandardCrypto)
- codecConfig :: CodecConfig (CardanoBlock StandardCrypto)
- nodeToClientCodecs :: forall m. MonadST m => ClientCodecs (CardanoBlock StandardCrypto) m
- chainSyncCodec :: block ~ CardanoBlock StandardCrypto => Codec (ChainSync block (Point block) Tip) DeserialiseFailure IO ByteString
- txSubmissionCodec :: block ~ CardanoBlock StandardCrypto => Codec (LocalTxSubmission (GenTx block) (ApplyTxErr block)) DeserialiseFailure IO ByteString
- toCardanoBlock :: Header StandardCrypto -> Block -> CardanoBlock StandardCrypto
- fromCardanoBlock :: CardanoBlock StandardCrypto -> Block
Documentation
data SocketEmulatorState Source #
SocketEmulatorState | |
|
Instances
Show SocketEmulatorState Source # | |
Defined in Cardano.Node.Socket.Emulator.Types | |
Generic SocketEmulatorState Source # | |
Defined in Cardano.Node.Socket.Emulator.Types from :: SocketEmulatorState -> Rep SocketEmulatorState x Source # to :: Rep SocketEmulatorState x -> SocketEmulatorState Source # | |
type Rep SocketEmulatorState Source # | |
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)))) |
tip :: Lens' SocketEmulatorState Tip Source #
emulatorState :: Lens' SocketEmulatorState EmulatorState Source #
channel :: Lens' SocketEmulatorState (TChan Block) Source #
data NodeServerConfig Source #
Node server configuration
NodeServerConfig | |
|
Instances
Application State
AppState | |
|
emulatorLogs :: Lens' AppState EmulatorLogs Source #
fromEmulatorChainState :: MonadIO m => EmulatorState -> m SocketEmulatorState Source #
initialChainState :: MonadIO m => Map CardanoAddress Value -> m SocketEmulatorState Source #
ChainState
with initial values
data CNSEServerLogMsg Source #
Top-level logging data type for structural logging inside the CNSE server.
StartingSlotCoordination UTCTime Millisecond | |
StartingCNSEServer Int | |
ProcessingEmulatorMsg EmulatorMsg |
Instances
The node protocols require a block header type.
BlockId | |
|
Instances
Eq BlockId Source # | |
Ord BlockId Source # | |
Defined in Cardano.Node.Socket.Emulator.Types | |
Show BlockId Source # | |
Generic BlockId Source # | |
Pretty BlockId Source # | |
Defined in Cardano.Node.Socket.Emulator.Types prettyList :: [BlockId] -> Doc ann | |
Serialise BlockId Source # | |
Defined in Cardano.Node.Socket.Emulator.Types encodeList :: [BlockId] -> Encoding decodeList :: Decoder s [BlockId] | |
type Rep BlockId Source # | |
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))) |
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 #