Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PublicRootPeers peeraddr = PublicRootPeers {
- getPublicConfigPeers :: !(Map peeraddr PeerAdvertise)
- getBootstrapPeers :: !(Set peeraddr)
- getLedgerPeers :: !(Set peeraddr)
- getBigLedgerPeers :: !(Set peeraddr)
- invariant :: Ord peeraddr => PublicRootPeers peeraddr -> Bool
- empty :: PublicRootPeers peeraddr
- null :: PublicRootPeers peeraddr -> Bool
- size :: PublicRootPeers peeraddr -> Int
- member :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> Bool
- merge :: Ord peeraddr => PublicRootPeers peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr
- difference :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr -> PublicRootPeers peeraddr
- intersection :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr -> PublicRootPeers peeraddr
- toSet :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr
- toPublicConfigPeerSet :: PublicRootPeers peeraddr -> Set peeraddr
- toAllLedgerPeerSet :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr
- insertPublicConfigPeer :: Ord peeraddr => peeraddr -> PeerAdvertise -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr
- insertBootstrapPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr
- insertLedgerPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr
- insertBigLedgerPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr
- fromPublicRootPeers :: Map peeraddr PeerAdvertise -> PublicRootPeers peeraddr
- fromBootstrapPeers :: Set peeraddr -> PublicRootPeers peeraddr
- fromLedgerPeers :: Set peeraddr -> PublicRootPeers peeraddr
- fromBigLedgerPeers :: Set peeraddr -> PublicRootPeers peeraddr
- fromMapAndSet :: Ord peeraddr => Map peeraddr PeerAdvertise -> Set peeraddr -> Set peeraddr -> Set peeraddr -> PublicRootPeers peeraddr
Types
data PublicRootPeers peeraddr Source #
Public Root Peers consist of either a set of manually configured bootstrap peers.
There's an implicit precedence that will priorise bootstrap peers over the other sets, so if we are adding a bootstrap peer and that peer is already a member of other public root set, it is going to be removed from that set and added to the bootstrap peer set.
PublicRootPeers | |
|
Instances
Basic operations
empty :: PublicRootPeers peeraddr Source #
null :: PublicRootPeers peeraddr -> Bool Source #
size :: PublicRootPeers peeraddr -> Int Source #
merge :: Ord peeraddr => PublicRootPeers peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr Source #
difference :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr -> PublicRootPeers peeraddr Source #
intersection :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr -> PublicRootPeers peeraddr Source #
toPublicConfigPeerSet :: PublicRootPeers peeraddr -> Set peeraddr Source #
toAllLedgerPeerSet :: Ord peeraddr => PublicRootPeers peeraddr -> Set peeraddr Source #
insertPublicConfigPeer :: Ord peeraddr => peeraddr -> PeerAdvertise -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr Source #
insertBootstrapPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr Source #
insertLedgerPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr Source #
insertBigLedgerPeer :: Ord peeraddr => peeraddr -> PublicRootPeers peeraddr -> PublicRootPeers peeraddr Source #
fromPublicRootPeers :: Map peeraddr PeerAdvertise -> PublicRootPeers peeraddr Source #
fromBootstrapPeers :: Set peeraddr -> PublicRootPeers peeraddr Source #
fromLedgerPeers :: Set peeraddr -> PublicRootPeers peeraddr Source #
fromBigLedgerPeers :: Set peeraddr -> PublicRootPeers peeraddr Source #
:: Ord peeraddr | |
=> Map peeraddr PeerAdvertise | public configured root peers |
-> Set peeraddr | bootstrap peers |
-> Set peeraddr | ledger peers |
-> Set peeraddr | big ledger peers |
-> PublicRootPeers peeraddr |
Preserves PublicRootPeers invariant. If the two sets are not disjoint, removes the common ones from the bootstrap peers set since its the most sensitive set.