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 SourcePublishAsync(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. |
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 |
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. |
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
|