ouroboros-network-0.1.0.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.Simple

Contents

Synopsis

Documentation

withPeerSelectionActions Source #

Arguments

∷ ∀ peeraddr peerconn resolver exception m a. (MonadAsync m, MonadDelay m, MonadThrow m, Ord peeraddr, Exception exception, Eq (Async m Void)) 
⇒ Tracer m (TraceLocalRootPeers peeraddr exception) 
→ Tracer m TracePublicRootPeers 
→ (IPPortNumber → peeraddr) 
DNSActions resolver exception m 
→ STM m PeerSelectionTargets 
→ STM m [(Int, Map RelayAccessPoint PeerAdvertise)]

local root peers

→ STM m [RelayAccessPoint]

public root peers

PeerStateActions peeraddr peerconn m 
→ (NumberOfPeers → m (Maybe (Set peeraddr, DiffTime))) 
→ (Maybe (Async m Void) → PeerSelectionActions peeraddr peerconn m → m a)

continuation, recieves a handle to the local roots peer provider thread (only if local root peers where non-empty).

→ m a 

Re-exports

data PeerSelectionTargets Source #

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.

data PeerAdvertise Source #

Should this peer be advertised to other peers asking for known peers? For certain peers specified by configuration it would be an appropriate policy to keep them private.

Instances

Instances details
Eq PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Ord PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Show PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Generic PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Associated Types

type Rep PeerAdvertiseTypeType Source #

FromJSON PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Methods

parseJSON ∷ Value → Parser PeerAdvertise

parseJSONList ∷ Value → Parser [PeerAdvertise]

ToJSON PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

Methods

toJSONPeerAdvertise → Value

toEncodingPeerAdvertise → Encoding

toJSONList ∷ [PeerAdvertise] → Value

toEncodingList ∷ [PeerAdvertise] → Encoding

type Rep PeerAdvertise Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.Types

type Rep PeerAdvertise = D1 ('MetaData "PeerAdvertise" "Ouroboros.Network.PeerSelection.Types" "ouroboros-network-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DoNotAdvertisePeer" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "DoAdvertisePeer" 'PrefixI 'False) (U1TypeType))