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

Test.Ouroboros.Network.Diffusion.Node

Synopsis

run a node

run :: forall extraState extraDebugState extraAPI extraPeers extraFlags extraChurnArgs extraCounters extraTrace exception resolver m. (Alternative (STM m), MonadAsync m, MonadDelay m, MonadEvaluate m, MonadFix m, MonadFork m, MonadLabelledSTM m, MonadTraceSTM m, MonadMask m, MonadSay m, MonadST m, MonadTime m, MonadTimer m, MonadThrow (STM m), MonadMVar m, Eq extraFlags, Eq extraCounters, Monoid extraPeers, Exception exception, resolver ~ (), forall a. Semigroup a => Semigroup (m a)) => BlockGeneratorArgs Block StdGen -> Interfaces extraAPI m -> Arguments extraChurnArgs extraFlags m -> extraState -> extraCounters -> PublicExtraPeersAPI extraPeers NtNAddr -> (forall (muxMode :: Mode) responderCtx ntnVersionData bytes a b. PeerSelectionGovernorArgs extraState extraDebugState extraFlags extraPeers extraAPI extraCounters extraTrace NtNAddr (PeerConnectionHandle muxMode responderCtx NtNAddr ntnVersionData bytes m a b) exception m) -> (forall (muxMode :: Mode) responderCtx ntnVersionData bytes a b. PeerSelectionState extraState extraFlags extraPeers NtNAddr (PeerConnectionHandle muxMode responderCtx NtNAddr ntnVersionData bytes m a b) -> extraCounters) -> (Map NtNAddr PeerAdvertise -> extraPeers) -> (PeerActionsDNS NtNAddr resolver m -> DNSSemaphore m -> (Map NtNAddr PeerAdvertise -> extraPeers) -> (NumberOfPeers -> LedgerPeersKind -> m (Maybe (Set NtNAddr, DiffTime))) -> LedgerPeersKind -> StdGen -> Int -> m (PublicRootPeers extraPeers NtNAddr, DiffTime)) -> (PeerChurnArgs m extraChurnArgs extraDebugState extraFlags extraPeers extraAPI extraCounters extraTrace NtNAddr -> m Void) -> Tracers NtNAddr NtNVersion NtNVersionData NtCAddr NtCVersion NtCVersionData extraState extraDebugState extraFlags extraPeers extraCounters extraTrace m -> Tracer m (TraceLabelPeer NtNAddr (TraceFetchClientState BlockHeader)) -> Tracer m (TraceTxLogic NtNAddr Int (Tx Int)) -> (NodeKernel BlockHeader Block StdGen Int m -> StdGen -> Applications NtNAddr NtNVersion NtNVersionData NtCAddr NtCVersion NtCVersionData m ()) -> m Void Source #

node types

type NtNAddr = TestAddress NtNAddr_ Source #

type NtNFD (m :: Type -> Type) = FD m NtNAddr Source #

type NtNVersion = UnversionedProtocol Source #

type NtCAddr = TestAddress Int Source #

type NtCFD (m :: Type -> Type) = FD m NtCAddr Source #

type NtCVersion = UnversionedProtocol Source #

type NtCVersionData = UnversionedProtocolData Source #

data NtNAddr_ Source #

Node-to-node address type.

Instances

Instances details
Arbitrary NtNAddr_ Source # 
Instance details

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

NFData NtNAddr_ Source # 
Instance details

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

Methods

rnf :: NtNAddr_ -> () #

Generic NtNAddr_ Source # 
Instance details

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

Associated Types

type Rep NtNAddr_ 
Instance details

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

type Rep NtNAddr_ = D1 ('MetaData "NtNAddr_" "Test.Ouroboros.Network.Diffusion.Node.Kernel" "ouroboros-network-0.23.0.0-inplace-ouroboros-network-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.Kernel

Eq NtNAddr_ Source # 
Instance details

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

Ord NtNAddr_ Source # 
Instance details

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

Hashable NtNAddr_ Source # 
Instance details

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

Methods

hashWithSalt :: Int -> NtNAddr_ -> Int #

hash :: NtNAddr_ -> Int #

GlobalAddressScheme NtNAddr_ Source # 
Instance details

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

Methods

getAddressType :: TestAddress NtNAddr_ -> AddressType

ephemeralAddress :: AddressType -> Natural -> TestAddress NtNAddr_

type Rep NtNAddr_ Source # 
Instance details

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

type Rep NtNAddr_ = D1 ('MetaData "NtNAddr_" "Test.Ouroboros.Network.Diffusion.Node.Kernel" "ouroboros-network-0.23.0.0-inplace-ouroboros-network-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))))

extra types used by the node

data PeerAdvertise #

Instances

Instances details
Arbitrary PeerAdvertise Source # 
Instance details

Defined in Test.Ouroboros.Network.PeerSelection.Instances

FromJSON PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

ToJSON PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

Generic PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

Associated Types

type Rep PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

type Rep PeerAdvertise = D1 ('MetaData "PeerAdvertise" "Ouroboros.Network.PeerSelection.PeerAdvertise" "ouroboros-network-0.23.0.0-inplace-api" 'False) (C1 ('MetaCons "DoNotAdvertisePeer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DoAdvertisePeer" 'PrefixI 'False) (U1 :: Type -> Type))
Show PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

Eq PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

Ord PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

type Rep PeerAdvertise 
Instance details

Defined in Ouroboros.Network.PeerSelection.PeerAdvertise

type Rep PeerAdvertise = D1 ('MetaData "PeerAdvertise" "Ouroboros.Network.PeerSelection.PeerAdvertise" "ouroboros-network-0.23.0.0-inplace-api" 'False) (C1 ('MetaCons "DoNotAdvertisePeer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DoAdvertisePeer" 'PrefixI 'False) (U1 :: Type -> Type))

data PeerSelectionTargets #

Adjustable targets for the peer selection mechanism.

These are used by the peer selection governor as targets. They are used by the peer churn governor loop as knobs to adjust, to influence the peer selection governor.

The known, established and active peer targets are targets both from below and from above: the governor will attempt to grow or shrink the sets to hit these targets.

Unlike the other targets, the root peer target is "one sided", it is only a target from below. The governor does not try to shrink the root set to hit it, it simply stops looking for more.

There is also an implicit target that enough local root peers are selected as active. This comes from the configuration for local roots, and is not an independently adjustable target.

Constructors

PeerSelectionTargets 

Fields

configuration constants

re-exports

data BlockGeneratorArgs block s Source #

Constructors

BlockGeneratorArgs 

Fields

randomBlockGenerationArgs :: DiffTime -> StdGen -> Int -> BlockGeneratorArgs Block StdGen Source #

Generate a block according to given probability.