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

Ouroboros.Network.PeerSelection.RootPeersDNS

Synopsis

DNS based actions for local and public root providers

data DNSActions resolver exception m Source #

Dictionary of DNS actions vocabulary

Constructors

DNSActions 

Fields

  • dnsResolverResourceResolvConf → m (Resource m (DNSorIOError exception) resolver)

    TODO: it could be useful for publicRootPeersProvider.

  • dnsAsyncResolverResourceResolvConf → m (Resource m (DNSorIOError exception) resolver)

    Resource which passes the Resolver (or abstract resolver type) through a StrictTVar. Better than resolverResource when using in multiple threads.

    On Windows we use a different implementation which always returns a newly initialised Resolver at each step. This is because on Windows we don't have a way to check that the network configuration has changed. The dns library is using 'GetNetworkParams@ win32 api call to get the list of default dns servers.

  • dnsLookupWithTTLResolvConf → resolver → Domain → m ([DNSError], [(IP, TTL)])

    Like lookupA but also return the TTL for the results.

    DNS library timeouts do not work reliably on Windows (#1873), hence the additional timeout.

DNS resolver IO auxiliar functions

constantResourceApplicative m ⇒ a → Resource m err a Source #

DNSActions IO

ioDNSActionsLookupReqsDNSActions Resolver IOException IO Source #

Bundle of DNS Actions that runs in IO The IPv4 and IPv6 addresses the node will be using should determine the LookupReqs so that we can avoid lookups for address types that wont be used.

DNS based provider for local root peers

localRootPeersProvider Source #

Arguments

∷ ∀ m peerAddr resolver exception. (MonadAsync m, MonadDelay m, Eq (Async m Void), Ord peerAddr) 
⇒ Tracer m (TraceLocalRootPeers peerAddr exception) 
→ (IPPortNumber → peerAddr) 
ResolvConf 
DNSActions resolver exception m 
→ STM m [(Int, Map RelayAccessPoint PeerAdvertise)]

input

→ StrictTVar m (Seq (Int, Map peerAddr PeerAdvertise))

output TVar

→ m Void 

Resolve RelayAddress-es of local root peers using dns if needed. Local roots are provided wrapped in a StrictTVar, which value might change (re-read form a config file). The resolved dns names are available through the output StrictTVar.

data DomainAccessPoint Source #

A product of a Domain and PortNumber. After resolving the domain we will use the PortNumber to form SockAddr.

Instances

Instances details
Eq DomainAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord DomainAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Show DomainAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

FromJSON DomainAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

parseJSON ∷ Value → Parser DomainAccessPoint

parseJSONList ∷ Value → Parser [DomainAccessPoint]

ToJSON DomainAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

toJSONDomainAccessPoint → Value

toEncodingDomainAccessPoint → Encoding

toJSONList ∷ [DomainAccessPoint] → Value

toEncodingList ∷ [DomainAccessPoint] → Encoding

data RelayAccessPoint Source #

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

Bundled Patterns

pattern RelayDomainAccessPointDomainAccessPointRelayAccessPoint

RelayDomainAccessPoint a bidirectional pattern which links RelayAccessDomain and DomainAccessPoint.

Instances

Instances details
Eq RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Show RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

NFData RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

rnfRelayAccessPoint → () Source #

FromJSON RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

parseJSON ∷ Value → Parser RelayAccessPoint

parseJSONList ∷ Value → Parser [RelayAccessPoint]

ToJSON RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

toJSONRelayAccessPoint → Value

toEncodingRelayAccessPoint → Encoding

toJSONList ∷ [RelayAccessPoint] → Value

toEncodingList ∷ [RelayAccessPoint] → Encoding

data IP #

Constructors

IPv4 

Fields

IPv6 

Fields

Instances

Instances details
Enum IP 
Instance details

Defined in Data.IP.Addr

Methods

succIPIP Source #

predIPIP Source #

toEnumIntIP Source #

fromEnumIPInt Source #

enumFromIP → [IP] Source #

enumFromThenIPIP → [IP] Source #

enumFromToIPIP → [IP] Source #

enumFromThenToIPIPIP → [IP] Source #

Eq IP 
Instance details

Defined in Data.IP.Addr

Methods

(==)IPIPBool Source #

(/=)IPIPBool Source #

Data IP 
Instance details

Defined in Data.IP.Addr

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → IP → c IP Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c IP Source #

toConstrIPConstr Source #

dataTypeOfIPDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c IP) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c IP) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → IPIP Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → IP → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → IP → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → IP → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → IP → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source #

Ord IP 
Instance details

Defined in Data.IP.Addr

Methods

compareIPIPOrdering Source #

(<)IPIPBool Source #

(<=)IPIPBool Source #

(>)IPIPBool Source #

(>=)IPIPBool Source #

maxIPIPIP Source #

minIPIPIP Source #

Read IP 
Instance details

Defined in Data.IP.Addr

Show IP 
Instance details

Defined in Data.IP.Addr

Methods

showsPrecIntIPShowS Source #

showIPString Source #

showList ∷ [IP] → ShowS Source #

IsString IP 
Instance details

Defined in Data.IP.Addr

Methods

fromStringStringIP Source #

Generic IP 
Instance details

Defined in Data.IP.Addr

Associated Types

type Rep IPTypeType Source #

Methods

fromIPRep IP x Source #

toRep IP x → IP Source #

type Rep IP 
Instance details

Defined in Data.IP.Addr

type Rep IP = D1 ('MetaData "IP" "Data.IP.Addr" "iproute-1.7.12-05e1c06e95ad98d75f6a9a33f0ea4ecd286d5acebf9a6bc4c84febea70fead77" 'False) (C1 ('MetaCons "IPv4" 'PrefixI 'True) (S1 ('MetaSel ('Just "ipv4") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedUnpack) (Rec0 IPv4)) :+: C1 ('MetaCons "IPv6" 'PrefixI 'True) (S1 ('MetaSel ('Just "ipv6") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IPv6)))

data TraceLocalRootPeers peerAddr exception Source #

Instances

Instances details
(Show peerAddr, Show exception) ⇒ Show (TraceLocalRootPeers peerAddr exception) Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RootPeersDNS

Methods

showsPrecIntTraceLocalRootPeers peerAddr exception → ShowS Source #

showTraceLocalRootPeers peerAddr exception → String Source #

showList ∷ [TraceLocalRootPeers peerAddr exception] → ShowS Source #

DNS based provider for public root peers

publicRootPeersProvider ∷ ∀ peerAddr resolver exception a m. (MonadThrow m, MonadAsync m, Exception exception, Ord peerAddr) ⇒ Tracer m TracePublicRootPeers → (IPPortNumber → peerAddr) → ResolvConf → STM m [RelayAccessPoint] → DNSActions resolver exception m → ((Int → m (Set peerAddr, DiffTime)) → m a) → m a Source #

TODO track PeerAdvertise

resolveDomainAccessPoint ∷ ∀ exception resolver m. (MonadThrow m, MonadAsync m, Exception exception) ⇒ Tracer m TracePublicRootPeersResolvConfDNSActions resolver exception m → [DomainAccessPoint] → m (Map DomainAccessPoint (Set SockAddr)) Source #

Provides DNS resolution functionality.

DNS type re-exports

data ResolvConf #

Instances

Instances details
Show ResolvConf 
Instance details

Defined in Network.DNS.Types.Internal

type TTL = Word32 #

Socket type re-exports

data PortNumber #

Instances

Instances details
Bounded PortNumber 
Instance details

Defined in Network.Socket.Types

Enum PortNumber 
Instance details

Defined in Network.Socket.Types

Eq PortNumber 
Instance details

Defined in Network.Socket.Types

Integral PortNumber 
Instance details

Defined in Network.Socket.Types

Num PortNumber 
Instance details

Defined in Network.Socket.Types

Ord PortNumber 
Instance details

Defined in Network.Socket.Types

Read PortNumber 
Instance details

Defined in Network.Socket.Types

Real PortNumber 
Instance details

Defined in Network.Socket.Types

Show PortNumber 
Instance details

Defined in Network.Socket.Types

Storable PortNumber 
Instance details

Defined in Network.Socket.Types