Peer class
Represents a peer node in the IPFS network.
A Peer encapsulates information about a remote IPFS node, including its cryptographic identity, network addresses, latency metrics, and client version information.
Constructors
-
Peer({required PeerId id, required List<
FullAddress> addresses, required int latency, required String agentVersion}) - Creates a new Peer with the given properties.
- Peer.fromId(String peerId)
-
Creates a Peer with minimal information from a peer ID string.
factory
- Peer.fromProto(PeerProto proto)
-
Creates a Peer from its Protobuf representation.
factory
Properties
-
addresses
→ List<
FullAddress> -
Network addresses where this peer can be reached.
final
- agentVersion → String
-
The IPFS client version string reported by this peer.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → PeerId
-
The unique cryptographic identifier for this peer.
final
- latency → int
-
Network latency to this peer in milliseconds.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toProto(
) → PeerProto - Converts the Peer to its Protobuf representation.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromMultiaddr(
String multiaddr) → Future< Peer> - Creates a Peer from a multiaddr string