p2p/host/peerstore/pstoremem library
Export the memory-based peerstore implementation.
Classes
- AddrSub
- A subscription to address updates.
- AddrSubManager
- A manager for address subscriptions.
- ExpiringAddr
- An address with an expiration time.
- MemoryAddrBook
- A memory-based implementation of the AddrBook interface.
- MemoryKeyBook
- A memory-based implementation of the KeyBook interface.
- MemoryMetrics
- A memory-based implementation of the Metrics interface.
- MemoryPeerMetadata
- A memory-based implementation of the PeerMetadata interface.
- MemoryPeerstore
- A memory-based implementation of the Peerstore interface.
- MemoryProtoBook
- A memory-based implementation of the ProtoBook interface.
- PeerAddrs
- A collection of peer addresses.
- PeerRecordState
- ProtoSegment
- A segment of the protocol book, used for sharding.
Constants
- defaultMaxSignedPeerRecords → const int
- defaultMaxUnconnectedAddrs → const int
- latencyEWMASmoothing → const double
- The smoothing factor for the exponentially weighted moving average.
Functions
-
newAddrBook(
{int maxUnconnectedAddrs = 1000000}) → MemoryAddrBook - Creates a new memory-based address book implementation.
-
newKeyBook(
) → MemoryKeyBook - Creates a new memory-based key book implementation.
-
newMetrics(
) → MemoryMetrics - Creates a new memory-based metrics implementation.
-
newPeerMetadata(
) → MemoryPeerMetadata - Creates a new memory-based peer metadata implementation.
-
newPeerstore(
{MemoryMetrics? metrics, MemoryKeyBook? keyBook, MemoryAddrBook? addrBook, MemoryProtoBook? protoBook, MemoryPeerMetadata? peerMetadata}) → MemoryPeerstore - Creates a new memory-based peerstore implementation.
-
newProtoBook(
{int maxProtos = 128}) → MemoryProtoBook - Creates a new memory-based protocol book implementation.
-
ttlIsConnected(
Duration ttl) → bool - Returns true if the TTL is at least as long as the connected TTL.
Exceptions / Errors
- ErrTooManyProtocols
- Error thrown when too many protocols are added for a peer.