Show / Hide Table of Contents

Class Peer

A daemon node on the IPFS network.

Inheritance
Object
Peer
Implements
IEquatable<Peer>
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public class Peer : IEquatable<Peer>
Remarks

Equality is based solely on the peer's Id.

Properties

| Improve this Doc View Source

Addresses

The multiple addresses of the node.

Declaration
public IEnumerable<MultiAddress> Addresses { get; set; }
Property Value
Type Description
IEnumerable<MultiAddress>

Where the peer can be found. The default is an empty sequence.

| Improve this Doc View Source

AgentVersion

The name and version of the IPFS software.

Declaration
public string AgentVersion { get; set; }
Property Value
Type Description
String

For example "go-ipfs/0.4.17/".

Remarks

There is no specification that describes the agent version string. The default is "unknown/0.0".

| Improve this Doc View Source

ConnectedAddress

The MultiAddress that the peer is connected on.

Declaration
public MultiAddress ConnectedAddress { get; set; }
Property Value
Type Description
MultiAddress

null when the peer is not connected to.

| Improve this Doc View Source

Id

Universally unique identifier.

Declaration
public MultiHash Id { get; set; }
Property Value
Type Description
MultiHash

This is the MultiHash of the peer's protobuf encoded PublicKey.

See Also
https://github.com/libp2p/specs/pull/100
| Improve this Doc View Source

Latency

The round-trip time it takes to get data from the peer.

Declaration
public TimeSpan? Latency { get; set; }
Property Value
Type Description
Nullable<TimeSpan>
| Improve this Doc View Source

ProtocolVersion

The name and version of the supported IPFS protocol.

Declaration
public string ProtocolVersion { get; set; }
Property Value
Type Description
String

For example "ipfs/0.1.0".

Remarks

There is no specification that describes the protocol version string. The default is "unknown/0.0".

| Improve this Doc View Source

PublicKey

The public key of the node.

Declaration
public string PublicKey { get; set; }
Property Value
Type Description
String

The base 64 encoding of the node's public key. The default is null

Remarks

The IPFS public key is the base-64 encoding of a protobuf encoding containing a type and the DER encoding of the PKCS Subject Public Key Info.

See Also
https://tools.ietf.org/html/rfc5280#section-4.1.2.7

Methods

| Improve this Doc View Source

Equals(Peer)

Declaration
public bool Equals(Peer that)
Parameters
Type Name Description
Peer that
Returns
Type Description
Boolean
| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean
Overrides
Object.Equals(Object)
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
Object.GetHashCode()
| Improve this Doc View Source

IsValid()

Determines if the information on the peer is valid.

Declaration
public bool IsValid()
Returns
Type Description
Boolean

true if all validation rules pass; otherwise false.

Remarks

Verifies that

  • The Id is defined
  • The Id is a hash of the PublicKey

| Improve this Doc View Source

ToString()

Returns the Base58 encoding of the Id.

Declaration
public override string ToString()
Returns
Type Description
String

A Base58 representaton of the peer.

Overrides
Object.ToString()

Operators

| Improve this Doc View Source

Equality(Peer, Peer)

Value equality.

Declaration
public static bool operator ==(Peer a, Peer b)
Parameters
Type Name Description
Peer a
Peer b
Returns
Type Description
Boolean
| Improve this Doc View Source

Implicit(String to Peer)

Implicit casting of a String to a Peer.

Declaration
public static implicit operator Peer(string s)
Parameters
Type Name Description
String s

A Base58 encoded Id.

Returns
Type Description
Peer

A new Peer.

Remarks

Equivalent to

new Peer { Id = s }

| Improve this Doc View Source

Inequality(Peer, Peer)

Value inequality.

Declaration
public static bool operator !=(Peer a, Peer b)
Parameters
Type Name Description
Peer a
Peer b
Returns
Type Description
Boolean

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX