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

Test.Ouroboros.Network.Testnet.Internal

Description

Diffusion simulation.

Synopsis

Run diffusion simulation

diffusionSimulation Source #

Arguments

:: (Alternative (STM m), MonadAsync m, MonadDelay m, MonadFix m, MonadFork m, MonadSay m, MonadST m, MonadEvaluate m, MonadLabelledSTM m, MonadTraceSTM m, MonadMask m, MonadTime m, MonadTimer m, MonadThrow (STM m), MonadMVar m, forall a. Semigroup a => Semigroup (m a)) 
=> BearerInfo 
-> DiffusionScript 
-> Tracer m (WithTime (WithName NtNAddr DiffusionTestTrace))

timed trace of nodes in the system

-> m Void 

Run an arbitrary topology

data DiffusionScript Source #

Multinode Diffusion Simulator Script

SimArgs with all the values needed for running the simulation, followed by a list of NodeArgs where each element represents one running node and respective Commands.

Constructors

DiffusionScript SimArgs DomainMapScript [(NodeArgs, [Command])] 

data SimArgs Source #

Diffusion Simulator Arguments

Contains all necessary randomly generated values needed to run diffusion in simulation.

Constructors

SimArgs 

Instances

Instances details
Show SimArgs Source # 
Instance details

Defined in Test.Ouroboros.Network.Testnet.Internal

mainnetSimArgs :: Int -> SimArgs Source #

Simulation arguments.

Slot length needs to be greater than 0 else we get a livelock on the IOSim.

Quota values matches mainnet, so a slot length of 1s and 1 / 20 chance that someone gets to make a block.

data NodeArgs Source #

Diffusion Simulator Node Arguments

Contains all necessary randomly generated values needed to run a node in simulation.

Constructors

NodeArgs 

Fields

Instances

Instances details
Show NodeArgs Source # 
Instance details

Defined in Test.Ouroboros.Network.Testnet.Internal

data ServiceDomainName Source #

Constructors

DomainName Domain

a well configured domain name

Misconfigured Domain

a domain name which is advertised but its' IPs are wrong.

NoDomainName 

data HotDiffusionScript Source #

Multinode Hot Diffusion Simulator Script

List of SimArgs. Each element of the list represents one running node.

Constructors

HotDiffusionScript SimArgs DomainMapScript [(NodeArgs, [Command])] 

QuickCheck properties

Tracing

iosimTracer :: forall s a. (Show a, Typeable a) => Tracer (IOSim s) (WithTime (WithName NtNAddr a)) Source #

A debug tracer which embeds events in DiffusionTestTrace.

Re-exports

newtype TestAddress addr #

Constructors

TestAddress 

Fields

Instances

Instances details
NFData addr => NFData (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Methods

rnf :: TestAddress addr -> () #

Generic (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Associated Types

type Rep (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

type Rep (TestAddress addr) = D1 ('MetaData "TestAddress" "Ouroboros.Network.Snocket" "ouroboros-network-framework-0.14.0.0-inplace" 'True) (C1 ('MetaCons "TestAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTestAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 addr)))

Methods

from :: TestAddress addr -> Rep (TestAddress addr) x #

to :: Rep (TestAddress addr) x -> TestAddress addr #

Show addr => Show (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Methods

showsPrec :: Int -> TestAddress addr -> ShowS #

show :: TestAddress addr -> String #

showList :: [TestAddress addr] -> ShowS #

Eq addr => Eq (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Methods

(==) :: TestAddress addr -> TestAddress addr -> Bool #

(/=) :: TestAddress addr -> TestAddress addr -> Bool #

Ord addr => Ord (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Methods

compare :: TestAddress addr -> TestAddress addr -> Ordering #

(<) :: TestAddress addr -> TestAddress addr -> Bool #

(<=) :: TestAddress addr -> TestAddress addr -> Bool #

(>) :: TestAddress addr -> TestAddress addr -> Bool #

(>=) :: TestAddress addr -> TestAddress addr -> Bool #

max :: TestAddress addr -> TestAddress addr -> TestAddress addr #

min :: TestAddress addr -> TestAddress addr -> TestAddress addr #

Hashable addr => Hashable (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

Methods

hashWithSalt :: Int -> TestAddress addr -> Int #

hash :: TestAddress addr -> Int #

Typeable addr => NoThunks (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

type Rep (TestAddress addr) 
Instance details

Defined in Ouroboros.Network.Snocket

type Rep (TestAddress addr) = D1 ('MetaData "TestAddress" "Ouroboros.Network.Snocket" "ouroboros-network-framework-0.14.0.0-inplace" 'True) (C1 ('MetaCons "TestAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTestAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 addr)))

data RelayAccessPoint #

A relay can have either an IP address and a port number or a domain with a port number

Bundled Patterns

pattern RelayDomainAccessPoint :: DomainAccessPoint -> RelayAccessPoint

RelayDomainAccessPoint a bidirectional pattern which links RelayAccessDomain and DomainAccessPoint.

Instances

Instances details
Arbitrary RelayAccessPoint Source # 
Instance details

Defined in Test.Ouroboros.Network.PeerSelection.Instances

FromJSON RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

ToJSON RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

NFData RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

rnf :: RelayAccessPoint -> () #

Show RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Eq RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

newtype Script a #

Constructors

Script (NonEmpty a) 

Instances

Instances details
Functor Script 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

fmap :: (a -> b) -> Script a -> Script b #

(<$) :: a -> Script b -> Script a #

Foldable Script 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

fold :: Monoid m => Script m -> m #

foldMap :: Monoid m => (a -> m) -> Script a -> m #

foldMap' :: Monoid m => (a -> m) -> Script a -> m #

foldr :: (a -> b -> b) -> b -> Script a -> b #

foldr' :: (a -> b -> b) -> b -> Script a -> b #

foldl :: (b -> a -> b) -> b -> Script a -> b #

foldl' :: (b -> a -> b) -> b -> Script a -> b #

foldr1 :: (a -> a -> a) -> Script a -> a #

foldl1 :: (a -> a -> a) -> Script a -> a #

toList :: Script a -> [a] #

null :: Script a -> Bool #

length :: Script a -> Int #

elem :: Eq a => a -> Script a -> Bool #

maximum :: Ord a => Script a -> a #

minimum :: Ord a => Script a -> a #

sum :: Num a => Script a -> a #

product :: Num a => Script a -> a #

Traversable Script 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

traverse :: Applicative f => (a -> f b) -> Script a -> f (Script b) #

sequenceA :: Applicative f => Script (f a) -> f (Script a) #

mapM :: Monad m => (a -> m b) -> Script a -> m (Script b) #

sequence :: Monad m => Script (m a) -> m (Script a) #

Arbitrary a => Arbitrary (Script a) 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

arbitrary :: Gen (Script a) #

shrink :: Script a -> [Script a] #

Show a => Show (Script a) 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

showsPrec :: Int -> Script a -> ShowS #

show :: Script a -> String #

showList :: [Script a] -> ShowS #

Eq a => Eq (Script a) 
Instance details

Defined in Ouroboros.Network.Testing.Data.Script

Methods

(==) :: Script a -> Script a -> Bool #

(/=) :: Script a -> Script a -> Bool #

data DebugPeerSelection peeraddr where #

Constructors

TraceGovernorState :: forall peeraddr peerconn. Show peerconn => Time -> Maybe DiffTime -> PeerSelectionState peeraddr peerconn -> DebugPeerSelection peeraddr 

Instances

Instances details
(Ord peeraddr, Show peeraddr) => Show (DebugPeerSelection peeraddr) 
Instance details

Defined in Ouroboros.Network.PeerSelection.Governor.Types

Methods

showsPrec :: Int -> DebugPeerSelection peeraddr -> ShowS #

show :: DebugPeerSelection peeraddr -> String #

showList :: [DebugPeerSelection peeraddr] -> ShowS #

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

data TracePeerSelection peeraddr #

Instances

Instances details
(Ord peeraddr, Show peeraddr) => Show (TracePeerSelection peeraddr) 
Instance details

Defined in Ouroboros.Network.PeerSelection.Governor.Types

Methods

showsPrec :: Int -> TracePeerSelection peeraddr -> ShowS #

show :: TracePeerSelection peeraddr -> String #

showList :: [TracePeerSelection peeraddr] -> ShowS #