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

Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions

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.

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.

Utils

Resource

newtype Resource m err a Source #

Evolving resource; We use it to reinitialise the dns library if the `etcresolv.conf` file was modified.

Constructors

Resource 

Fields

withResource' Source #

Arguments

∷ MonadDelay m 
⇒ Tracer m err 
NonEmpty DiffTime

delays between each re-try

Resource m err a 
→ m (a, Resource m err a) 

Like withResource but retries untill success.

constantResourceApplicative m ⇒ a → Resource m err a Source #

Error type

data DNSorIOError exception Source #

Constructors

DNSError !DNSError 
IOError !exception 

Instances

Instances details
Show exception ⇒ Show (DNSorIOError exception) Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions

Methods

showsPrecIntDNSorIOError exception → ShowS Source #

showDNSorIOError exception → String Source #

showList ∷ [DNSorIOError exception] → ShowS Source #

Exception exception ⇒ Exception (DNSorIOError exception) Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions