ouroboros-network-api-0.7.3.0: A networking api shared with ouroboros-consensus
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.PeerSelection.LedgerPeers.Utils

Synopsis

Documentation

bigLedgerPeerQuotaAccPoolStake Source #

The total accumulated stake of big ledger peers.

accBigPoolStake ∷ [(PoolStake, NonEmpty RelayAccessPoint)] → [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))] Source #

Sort ascendingly a given list of pools with stake, and tag each one with cumulative stake, with a cutoff at bigLedgerPeerQuota

reRelativeStakeLedgerPeersKind → [(PoolStake, NonEmpty RelayAccessPoint)] → [(PoolStake, NonEmpty RelayAccessPoint)] Source #

Not all stake pools have valid / usable relay information. This means that we need to recalculate the relative stake for each pool.

newtype AccPoolStake Source #

The accumulated relative stake of a stake pool, like PoolStake but it also includes the relative stake of all preceding pools. A value in the range [0, 1].

Constructors

AccPoolStake 

Instances

Instances details
Num AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Fractional AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Ord AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

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
Num PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Fractional PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

showsPrecIntPoolStakeShowS #

showPoolStakeString #

showList ∷ [PoolStake] → ShowS #

NFData PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

rnfPoolStake → () #

Eq PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

(==)PoolStakePoolStakeBool #

(/=)PoolStakePoolStakeBool #

Ord PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

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
FromJSON RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

ToJSON 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 → () #

Eq RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint