Skip to main content

ResQ.Storage.IStorageClient

IStorageClient.IsPinnedAsync(string, CancellationToken) Method

Checks if a CID is currently pinned.
System.Threading.Tasks.Task<bool> IsPinnedAsync(string cid, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

cid System.String The IPFS Content Identifier to check. cancellationToken System.Threading.CancellationToken Cancellation token for the operation.

Returns

System.Threading.Tasks.Task<System.Boolean>
True if the CID is pinned; false otherwise.

Exceptions

System.ArgumentNullException
Thrown when cid is null or empty.
System.OperationCanceledException
Thrown when the operation is cancelled.

Example

bool isPinned = await storage.IsPinnedAsync("Qmabc123...");
if (!isPinned)
{
    Console.WriteLine("Warning: Content may not be persisted");
}

Remarks

A pinned CID is guaranteed to remain available on the IPFS network. Unpinned content may be garbage collected by IPFS nodes.