PeerInfo class

Metadata about a peer

Constructors

PeerInfo.new({required PeerId peerId, Set<MultiAddr>? addrs, Set<String>? protocols, Map<String, dynamic>? metadata, DateTime? firstSeen, DateTime? lastSeen})

Properties

addrs Set<MultiAddr>
The peer's known addresses
final
firstSeen DateTime
When this peer was first discovered
final
hashCode int
The hash code for this object.
no setterinherited
lastSeen DateTime
When this peer was last seen
getter/setter pair
metadata Map<String, dynamic>
Additional metadata about this peer
final
peerId PeerId
The peer's ID
final
protocols Set<String>
The protocols supported by this peer
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAddr(MultiAddr addr) → void
Adds a new address for this peer
addAddrs(Iterable<MultiAddr> newAddrs) → void
Adds multiple addresses for this peer
addProtocol(String protocol) → void
Adds a supported protocol
addProtocols(Iterable<String> newProtocols) → void
Adds multiple supported protocols
copy() PeerInfo
Creates a copy of this PeerInfo
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateLastSeen() → void
Updates the last seen timestamp

Operators

operator ==(Object other) bool
The equality operator.
inherited