Safe Haskell | None |
---|---|
Language | Haskell2010 |
Node kernel which does chain selection and block production.
Synopsis
- type NtNAddr = TestAddress NtNAddr_
- data NtNAddr_
- encodeNtNAddr :: NtNAddr -> Encoding
- decodeNtNAddr :: Decoder s NtNAddr
- ntnAddrToRelayAccessPoint :: NtNAddr -> Maybe RelayAccessPoint
- type NtNVersion = UnversionedProtocol
- data NtNVersionData = NtNVersionData {}
- type NtCAddr = TestAddress Int
- type NtCVersion = UnversionedProtocol
- type NtCVersionData = UnversionedProtocolData
- data BlockGeneratorArgs block s = BlockGeneratorArgs {
- bgaSlotDuration :: DiffTime
- bgaBlockGenerator :: s -> Anchor block -> SlotNo -> (Maybe block, s)
- bgaSeed :: s
- relayBlockGenerationArgs :: DiffTime -> seed -> BlockGeneratorArgs block seed
- randomBlockGenerationArgs :: DiffTime -> StdGen -> Int -> BlockGeneratorArgs Block StdGen
- data NodeKernel header block s (m :: Type -> Type) = NodeKernel {
- nkClientChains :: StrictTVar m (Map NtNAddr (StrictTVar m (Chain header)))
- nkChainProducerState :: StrictTVar m (ChainProducerState block)
- nkFetchClientRegistry :: FetchClientRegistry NtNAddr header block m
- nkPeerSharingRegistry :: PeerSharingRegistry NtNAddr m
- nkChainDB :: ChainDB block m
- nkPeerSharingAPI :: PeerSharingAPI NtNAddr s m
- nkPublicPeerSelectionVar :: StrictTVar m (PublicPeerSelectionState NtNAddr)
- newNodeKernel :: MonadSTM m => s -> m (NodeKernel header block s m)
- registerClientChains :: MonadSTM m => NodeKernel header block s m -> NtNAddr -> m (StrictTVar m (Chain header))
- unregisterClientChains :: MonadSTM m => NodeKernel header block s m -> NtNAddr -> m ()
- withNodeKernelThread :: forall block header m seed a. (Alternative (STM m), MonadAsync m, MonadDelay m, MonadThrow m, MonadThrow (STM m), HasFullHeader block, RandomGen seed) => BlockGeneratorArgs block seed -> (NodeKernel header block seed m -> Async m Void -> m a) -> m a
- data NodeKernelError = UnexpectedSlot !SlotNo !SlotNo
Common types
type NtNAddr = TestAddress NtNAddr_ Source #
Node-to-node address type.
Instances
encodeNtNAddr :: NtNAddr -> Encoding Source #
decodeNtNAddr :: Decoder s NtNAddr Source #
type NtNVersion = UnversionedProtocol Source #
data NtNVersionData Source #
Instances
Show NtNVersionData Source # | |
Defined in Test.Ouroboros.Network.Testnet.Node.Kernel showsPrec :: Int -> NtNVersionData -> ShowS # show :: NtNVersionData -> String # showList :: [NtNVersionData] -> ShowS # |
type NtCAddr = TestAddress Int Source #
type NtCVersion = UnversionedProtocol Source #
Node kernel
data BlockGeneratorArgs block s Source #
BlockGeneratorArgs | |
|
relayBlockGenerationArgs :: DiffTime -> seed -> BlockGeneratorArgs block seed Source #
Do not generate blocks.
randomBlockGenerationArgs :: DiffTime -> StdGen -> Int -> BlockGeneratorArgs Block StdGen Source #
Generate a block according to given probability.
data NodeKernel header block s (m :: Type -> Type) Source #
NodeKernel | |
|
newNodeKernel :: MonadSTM m => s -> m (NodeKernel header block s m) Source #
registerClientChains :: MonadSTM m => NodeKernel header block s m -> NtNAddr -> m (StrictTVar m (Chain header)) Source #
Register a new upstream chain-sync client.
unregisterClientChains :: MonadSTM m => NodeKernel header block s m -> NtNAddr -> m () Source #
Unregister an upstream chain-sync client.
:: forall block header m seed a. (Alternative (STM m), MonadAsync m, MonadDelay m, MonadThrow m, MonadThrow (STM m), HasFullHeader block, RandomGen seed) | |
=> BlockGeneratorArgs block seed | |
-> (NodeKernel header block seed m -> Async m Void -> m a) | The continuation which has a handle to the chain selection / block production thread. The thread might throw an exception. |
-> m a |
Run chain selection / block production thread.
data NodeKernelError Source #
Node kernel erros.
Instances
Exception NodeKernelError Source # | |
Show NodeKernelError Source # | |
Defined in Test.Ouroboros.Network.Testnet.Node.Kernel showsPrec :: Int -> NodeKernelError -> ShowS # show :: NodeKernelError -> String # showList :: [NodeKernelError] -> ShowS # |