ouroboros-consensus-0.3.1.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Ledger.SupportsPeerSelection

Synopsis

Documentation

class LedgerSupportsPeerSelection blk where Source #

Methods

getPeersLedgerState blk → [(PoolStake, NonEmpty StakePoolRelay)] Source #

Return peers registered in the ledger ordered by descending PoolStake.

For example, for Shelley, the relays that have been registered in the ledger for the respective stake pools will be returned.

Ledgers/blocks that don't support staking can return an empty list.

Note: if the ledger state is old, the registered relays can also be old and may no longer be online.

newtype PoolStake Source #

The relative stake of a stakepool in relation to the total amount staked. A value in the [0, 1] range.

Constructors

PoolStake 

Fields

Instances

Instances details
Eq PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Fractional PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Num PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Ord PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

NFData PoolStake 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

rnfPoolStake → () Source #

data StakePoolRelay Source #

A relay registered for a stake pool

Constructors

CurrentRelay RelayAccessPoint

One of the current relays

FutureRelay RelayAccessPoint

One of the future relays

Re-exports for convenience

data DomainAccessPoint Source #

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

Constructors

DomainAccessPoint 

Fields

Instances

Instances details
Eq DomainAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord DomainAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Show DomainAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

FromJSON DomainAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

parseJSON ∷ Value → Parser DomainAccessPoint

parseJSONList ∷ Value → Parser [DomainAccessPoint]

ToJSON DomainAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

toJSONDomainAccessPoint → Value

toEncodingDomainAccessPoint → Encoding

toJSONList ∷ [DomainAccessPoint] → Value

toEncodingList ∷ [DomainAccessPoint] → 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-c5b098c152292ab5ec298715c7a54cbd2afbe17d758fe1a98c723e04d1caa538" '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 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

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 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Show RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

NFData RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

rnfRelayAccessPoint → () Source #

FromJSON RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

parseJSON ∷ Value → Parser RelayAccessPoint

parseJSONList ∷ Value → Parser [RelayAccessPoint]

ToJSON RelayAccessPoint 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

toJSONRelayAccessPoint → Value

toEncodingRelayAccessPoint → Encoding

toJSONList ∷ [RelayAccessPoint] → Value

toEncodingList ∷ [RelayAccessPoint] → Encoding