ouroboros-network:sim-tests-lib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Description

Node kernel which does chain selection and block production.

Synopsis

Common types

data NtNAddr_ Source #

Node-to-node address type.

Instances

Instances details
Arbitrary NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

NFData NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Methods

rnf :: NtNAddr_ -> () #

Generic NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Associated Types

type Rep NtNAddr_ 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

type Rep NtNAddr_ = D1 ('MetaData "NtNAddr_" "Test.Ouroboros.Network.Diffusion.Node.NodeKernel" "ouroboros-network-0.17.1.1-inplace-sim-tests-lib" 'False) (C1 ('MetaCons "EphemeralIPv4Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :+: (C1 ('MetaCons "EphemeralIPv6Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :+: C1 ('MetaCons "IPAddr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IP) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PortNumber))))

Methods

from :: NtNAddr_ -> Rep NtNAddr_ x #

to :: Rep NtNAddr_ x -> NtNAddr_ #

Show NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Eq NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Ord NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Hashable NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

Methods

hashWithSalt :: Int -> NtNAddr_ -> Int #

hash :: NtNAddr_ -> Int #

GlobalAddressScheme NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

type Rep NtNAddr_ Source # 
Instance details

Defined in Test.Ouroboros.Network.Diffusion.Node.NodeKernel

type Rep NtNAddr_ = D1 ('MetaData "NtNAddr_" "Test.Ouroboros.Network.Diffusion.Node.NodeKernel" "ouroboros-network-0.17.1.1-inplace-sim-tests-lib" 'False) (C1 ('MetaCons "EphemeralIPv4Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :+: (C1 ('MetaCons "EphemeralIPv6Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :+: C1 ('MetaCons "IPAddr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 IP) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PortNumber))))

Node kernel

data BlockGeneratorArgs block s Source #

Constructors

BlockGeneratorArgs 

Fields

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.

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.

withNodeKernelThread Source #

Arguments

:: 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.