Class Peer
A daemon node on the IPFS network.
Implements
Inherited Members
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 SourceAddresses
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. |
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".
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. |
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
| Improve this Doc View SourceLatency
The round-trip time it takes to get data from the peer.
Declaration
public TimeSpan? Latency { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeSpan> |
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".
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
Methods
| Improve this Doc View SourceEquals(Peer)
Declaration
public bool Equals(Peer that)
Parameters
Type | Name | Description |
---|---|---|
Peer | that |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceIsValid()
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
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A Base58 representaton of the peer. |
Overrides
Operators
| Improve this Doc View SourceEquality(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 |
Implicit(String to Peer)
Declaration
public static implicit operator Peer(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s |
Returns
Type | Description |
---|---|
Peer | A new Peer. |
Remarks
Equivalent to
new Peer { Id = s }
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 |