Show / Hide Table of Contents

Interface IPinApi

Manage pinned objects (locally stored and permanent).

Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IPinApi

Methods

| Improve this Doc View Source

AddAsync(String, Boolean, CancellationToken)

Adds an IPFS object to the pinset and also stores it to the IPFS repo. pinset is the set of hashes currently pinned (not gc'able).

Declaration
Task<IEnumerable<Cid>> AddAsync(string path, bool recursive = true, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String path

A CID or path to an existing object, such as "QmXarR6rgkQ2fDSHjSY5nM2kuCXKYGViky5nohtwgF65Ec/about" or "QmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V"

Boolean recursive

true to recursively pin links of the object; otherwise, false to only pin the specified object. Default is true.

CancellationToken cancel

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

Returns
Type Description
Task<IEnumerable<Cid>>

A task that represents the asynchronous operation. The task's value is a sequence of Cid that were pinned.

| Improve this Doc View Source

ListAsync(CancellationToken)

List all the objects pinned to local storage.

Declaration
Task<IEnumerable<Cid>> ListAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
CancellationToken cancel

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

Returns
Type Description
Task<IEnumerable<Cid>>

A task that represents the asynchronous operation. The task's value is a sequence of Cid.

| Improve this Doc View Source

RemoveAsync(Cid, Boolean, CancellationToken)

Unpin an object.

Declaration
Task<IEnumerable<Cid>> RemoveAsync(Cid id, bool recursive = true, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
Cid id

The CID of the object.

Boolean recursive

true to recursively unpin links of object; otherwise, false to only unpin the specified object. Default is true.

CancellationToken cancel

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

Returns
Type Description
Task<IEnumerable<Cid>>

A task that represents the asynchronous operation. The task's value is a sequence of Cid that were unpinned.

See Also

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