Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Ledger.SupportsPeerSelection
Contents
Synopsis
- class LedgerSupportsPeerSelection blk where
- getPeers ∷ LedgerState blk → [(PoolStake, NonEmpty StakePoolRelay)]
- newtype PoolStake = PoolStake {}
- data StakePoolRelay
- stakePoolRelayAccessPoint ∷ StakePoolRelay → RelayAccessPoint
- data DomainAccessPoint = DomainAccessPoint {
- dapDomain ∷ !Domain
- dapPortNumber ∷ !PortNumber
- data IP
- data PortNumber
- data RelayAccessPoint where
- RelayAccessDomain !Domain !PortNumber
- RelayAccessAddress !IP !PortNumber
- pattern RelayDomainAccessPoint ∷ DomainAccessPoint → RelayAccessPoint
Documentation
class LedgerSupportsPeerSelection blk where Source #
Methods
getPeers ∷ LedgerState 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.
Instances
CanHardFork xs ⇒ LedgerSupportsPeerSelection (HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger.PeerSelection Methods getPeers ∷ LedgerState (HardForkBlock xs) → [(PoolStake, NonEmpty StakePoolRelay)] Source # | |
LedgerSupportsPeerSelection m ⇒ LedgerSupportsPeerSelection (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getPeers ∷ LedgerState (DualBlock m a) → [(PoolStake, NonEmpty StakePoolRelay)] 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
Eq PoolStake | |
Fractional PoolStake | |
Num PoolStake | |
Ord PoolStake | |
Show PoolStake | |
NFData PoolStake | |
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 |
Instances
Eq StakePoolRelay Source # | |
Defined in Ouroboros.Consensus.Ledger.SupportsPeerSelection Methods (==) ∷ StakePoolRelay → StakePoolRelay → Bool Source # (/=) ∷ StakePoolRelay → StakePoolRelay → Bool Source # | |
Show StakePoolRelay Source # | |
NFData StakePoolRelay Source # | |
Defined in Ouroboros.Consensus.Ledger.SupportsPeerSelection Methods rnf ∷ StakePoolRelay → () Source # |
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
Enum IP | |
Eq IP | |
Data IP | |
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 # toConstr ∷ IP → Constr Source # dataTypeOf ∷ IP → DataType Source # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c IP) Source # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c IP) Source # gmapT ∷ (∀ b. Data b ⇒ b → b) → IP → IP 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 # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → IP → u Source # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP Source # | |
Ord IP | |
Read IP | |
Show IP | |
IsString IP | |
Defined in Data.IP.Addr Methods fromString ∷ String → IP Source # | |
Generic IP | |
type Rep IP | |
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
data RelayAccessPoint Source #
A relay can have either an IP address and a port number or a domain with a port number
Constructors
RelayAccessDomain !Domain !PortNumber | |
RelayAccessAddress !IP !PortNumber |
Bundled Patterns
pattern RelayDomainAccessPoint ∷ DomainAccessPoint → RelayAccessPoint |
|