Show / Hide Table of Contents

Class MerkleNode

The IPFS MerkleDag is the datastructure at the heart of IPFS. It is an acyclic directed graph whose edges are hashes.

Inheritance
Object
MerkleNode
Implements
IMerkleNode<IMerkleLink>
IDataBlock
IEquatable<MerkleNode>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Namespace: Ipfs.Http
Assembly: Ipfs.Http.Client.dll
Syntax
[DataContract]
public class MerkleNode : IMerkleNode<IMerkleLink>, IDataBlock, IEquatable<MerkleNode>
Remarks

Initially an MerkleNode is just constructed with its Cid.

Constructors

| Improve this Doc View Source

MerkleNode(Cid, String)

Creates a new instance of the MerkleNode with the specified Cid and optional Name.

Declaration
public MerkleNode(Cid id, string name = null)
Parameters
Type Name Description
Cid id

The Cid of the node.

String name

A name for the node.

| Improve this Doc View Source

MerkleNode(IMerkleLink)

Creates a new instance of the MerkleNode from the IMerkleLink.

Declaration
public MerkleNode(IMerkleLink link)
Parameters
Type Name Description
IMerkleLink link

The link to a node.

| Improve this Doc View Source

MerkleNode(String, String)

Creates a new instance of the MerkleNode with the specified Id and optional Name.

Declaration
public MerkleNode(string path, string name = null)
Parameters
Type Name Description
String path

The string representation of a Cid of the node or "/ipfs/cid".

String name

A name for the node.

Properties

| Improve this Doc View Source

BlockSize

Size of the raw, encoded node.

Declaration
[DataMember]
public long BlockSize { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

DataBytes

Declaration
[DataMember]
public byte[] DataBytes { get; }
Property Value
Type Description
Byte[]
| Improve this Doc View Source

DataStream

Declaration
public Stream DataStream { get; }
Property Value
Type Description
Stream
| Improve this Doc View Source

Id

Declaration
[DataMember]
public Cid Id { get; }
Property Value
Type Description
Cid
| Improve this Doc View Source

Links

Declaration
[DataMember]
public IEnumerable<IMerkleLink> Links { get; }
Property Value
Type Description
IEnumerable<IMerkleLink>
| Improve this Doc View Source

Name

The name for the node. If unknown it is "" (not null).

Declaration
[DataMember]
public string Name { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

Size

Declaration
[DataMember]
public long Size { get; }
Property Value
Type Description
Int64
See Also
BlockSize

Methods

| Improve this Doc View Source

Equals(MerkleNode)

Declaration
public bool Equals(MerkleNode that)
Parameters
Type Name Description
MerkleNode 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

ToLink(String)

Declaration
public IMerkleLink ToLink(string name = null)
Parameters
Type Name Description
String name
Returns
Type Description
IMerkleLink
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Operators

| Improve this Doc View Source

Equality(MerkleNode, MerkleNode)

TODO

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

Implicit(String to MerkleNode)

TODO

Declaration
public static implicit operator MerkleNode(string hash)
Parameters
Type Name Description
String hash
Returns
Type Description
MerkleNode
| Improve this Doc View Source

Inequality(MerkleNode, MerkleNode)

TODO

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

Implements

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