Show / Hide Table of Contents

Interface INameApi

Manages the IPNS (Interplanetary Name Space).

Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface INameApi
Remarks

IPNS is a PKI namespace, where names are the hashes of public keys, and the private key enables publishing new(signed) values. The default name is the node's own Id, which is the hash of its public key.

Methods

| Improve this Doc View Source

PublishAsync(Cid, String, Nullable<TimeSpan>, CancellationToken)

Publish an IPFS name.

Declaration
Task<NamedContent> PublishAsync(Cid id, string key = "self", TimeSpan? lifetime = default(TimeSpan? ), CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
Cid id

The Cid of the content to publish.

String key

The local key name used to sign the content. Defaults to "self".

Nullable<TimeSpan> lifetime

Duration that the record will be valid for. Defaults to 24 hours.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<NamedContent>

A task that represents the asynchronous operation. The task's value is the NamedContent of the published content.

| Improve this Doc View Source

PublishAsync(String, Boolean, String, Nullable<TimeSpan>, CancellationToken)

Publish an IPFS name.

Declaration
Task<NamedContent> PublishAsync(string path, bool resolve = true, string key = "self", TimeSpan? lifetime = default(TimeSpan? ), CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String path

The CID or path to the content to publish.

Boolean resolve

Resolve path before publishing. Defaults to true.

String key

The local key name used to sign the content. Defaults to "self".

Nullable<TimeSpan> lifetime

Duration that the record will be valid for. Defaults to 24 hours.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<NamedContent>

A task that represents the asynchronous operation. The task's value is the NamedContent of the published content.

| Improve this Doc View Source

ResolveAsync(String, Boolean, Boolean, CancellationToken)

Resolve an IPNS name.

Declaration
Task<string> ResolveAsync(string name, bool recursive = false, bool nocache = false, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String name

An IPNS address, such as: /ipns/ipfs.io or a CID.

Boolean recursive

Resolve until the result is not an IPNS name. Defaults to false.

Boolean nocache

Do not use cached entries. Defaults to false.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<String>

A task that represents the asynchronous operation. The task's value is the resolved path as a String, such as /ipfs/QmYNQJoKGNHTpPxCBPh9KkDpaExgd2duMa3aF6ytMpHdao.

See Also

Name API spec
  • Improve this Doc
  • View Source
Back to top Generated by DocFX