| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Ledger.SupportsPeerSelection
Contents
Synopsis
- class LedgerSupportsPeerSelection blk where
- getPeers ∷ ∀ (mk ∷ MapKind). LedgerState blk mk → [(PoolStake, NonEmpty StakePoolRelay)]
- newtype PoolStake = PoolStake {}
- data StakePoolRelay
- stakePoolRelayAccessPoint ∷ StakePoolRelay → LedgerRelayAccessPoint
- data IP
- data PortNumber
- data LedgerRelayAccessPoint
Documentation
class LedgerSupportsPeerSelection blk where Source #
Methods
getPeers ∷ ∀ (mk ∷ MapKind). LedgerState blk mk → [(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 ∷ ∀ (mk ∷ MapKind). LedgerState (HardForkBlock xs) mk → [(PoolStake, NonEmpty StakePoolRelay)] Source # | |
| LedgerSupportsPeerSelection m ⇒ LedgerSupportsPeerSelection (DualBlock m a) Source # | |
Defined in Ouroboros.Consensus.Ledger.Dual Methods getPeers ∷ ∀ (mk ∷ MapKind). LedgerState (DualBlock m a) mk → [(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 | |
data StakePoolRelay Source #
A relay registered for a stake pool
Constructors
| CurrentRelay LedgerRelayAccessPoint | One of the current relays |
| FutureRelay LedgerRelayAccessPoint | One of the future relays |
Instances
| NFData StakePoolRelay Source # | |
Defined in Ouroboros.Consensus.Ledger.SupportsPeerSelection Methods rnf ∷ StakePoolRelay → () # | |
| Show StakePoolRelay Source # | |
Defined in Ouroboros.Consensus.Ledger.SupportsPeerSelection Methods showsPrec ∷ Int → StakePoolRelay → ShowS # show ∷ StakePoolRelay → String # showList ∷ [StakePoolRelay] → ShowS # | |
| Eq StakePoolRelay Source # | |
Defined in Ouroboros.Consensus.Ledger.SupportsPeerSelection Methods (==) ∷ StakePoolRelay → StakePoolRelay → Bool # (/=) ∷ StakePoolRelay → StakePoolRelay → Bool # | |
Re-exports for convenience
A unified IP data for IPv4 and IPv6.
To create this, use the data constructors. Or use read "192.0.2.1" :: IP, for example. Also, "192.0.2.1" can be used as literal with OverloadedStrings.
>>>(read "192.0.2.1" :: IP) == IPv4 (read "192.0.2.1" :: IPv4)True>>>(read "2001:db8:00:00:00:00:00:01" :: IP) == IPv6 (read "2001:db8:00:00:00:00:00:01" :: IPv6)True
Instances
| 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 # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c IP # dataTypeOf ∷ IP → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c IP) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c IP) # gmapT ∷ (∀ b. Data b ⇒ b → b) → IP → IP # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → IP → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → IP → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → IP → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → IP → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → IP → m IP # | |||||
| IsString IP | |||||
Defined in Data.IP.Addr Methods fromString ∷ String → IP # | |||||
| Enum IP | |||||
| Generic IP | |||||
Defined in Data.IP.Addr Associated Types
| |||||
| Read IP | |||||
| Show IP | |||||
| Eq IP | Equality over IP addresses. Correctly compare IPv4 and IPv4-embedded-in-IPv6 addresses.
| ||||
| Ord IP | |||||
| type Rep IP | |||||
Defined in Data.IP.Addr type Rep IP = D1 ('MetaData "IP" "Data.IP.Addr" "iproute-1.7.15-fcef0a429c8013771ca81cf7a441e35de38d37dc1dea9302c8ee5a1633c1f547" '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 Source #
Port number.
Use the Num instance (i.e. use a literal) to create a
PortNumber value.
>>>1 :: PortNumber1>>>read "1" :: PortNumber1>>>show (12345 :: PortNumber)"12345">>>50000 < (51000 :: PortNumber)True>>>50000 < (52000 :: PortNumber)True>>>50000 + (10000 :: PortNumber)60000
Instances
data LedgerRelayAccessPoint Source #
A Relay as registered on the ledger.
The only difference with RelayAccessPoint is that
LedgerRelayAccessSRVDomain is not prefixed, as required by CIP#0155.
Constructors
| LedgerRelayAccessDomain !Domain !PortNumber | |
| LedgerRelayAccessSRVDomain !Domain | SRV domain as registered on the ledger |
| LedgerRelayAccessAddress !IP !PortNumber |