ouroboros-network-api
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.LedgerPeers.Utils

Synopsis

Documentation

bigLedgerPeerQuota :: AccPoolStake Source #

The total accumulated stake of big ledger peers.

accumulateBigLedgerStake :: [(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

recomputeRelativeStake :: LedgerPeersKind -> [(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 

Instances

Instances details
NFData PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

rnf :: PoolStake -> () #

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

Eq PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

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 RelayDomainAccessPoint :: DomainAccessPoint -> RelayAccessPoint

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

NFData RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

rnf :: RelayAccessPoint -> () #

Show RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Eq RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint