IPinningService¶
Namespace Nfty.Core.Publish.Ipfs in assembly Nfty.Core.
Somewhere a folder can be put on IPFS and kept there: a local Kubo node, or a pinning service.
Remarks¶
A folder's address is its CONTENTS. IPinningService.AddFolderAsync() returns the CID of a directory whose entries are the folder's files, so ipfs://CID/1.png names the folder's 1.png - the shape ExportOptions.ImageBaseUri was built around, with no images/ in the link.
No UI dependency and no package: the implementations speak HTTP through HttpClient, and the files are streamed one at a time, never buffered whole.
Properties¶
Provider¶
Which service this is, as a person reads it.
Methods¶
AddFolderAsync(string, string, IProgress<PinProgress>?, CancellationToken)¶
public abstract Task<string> AddFolderAsync(string folder, string label, IProgress<PinProgress>? progress = null, CancellationToken cancellationToken = default);
Adds and pins every file under folder, returning the CID of a directory whose entries are those files.
Parameters
folder(string) - The folder whose contents to add.label(string) - A name for the pin where the service keeps one (Pinata's dashboard).progress(IProgress<PinProgress>?) - Bytes sent so far.cancellationToken(CancellationToken) - Stops the upload. What the service already received may stay on it.
Returns. The root CID.
Exceptions
ArgumentException- The folder is missing or holds no file.PinningException- The service refused, failed or answered without a CID.
StatusAsync(CancellationToken)¶
Asks whether the service can be reached and accepts the credentials. Never throws for an unreachable service: that is an answer, reported in the result.
Parameters
cancellationToken(CancellationToken) - Stops the check.
Returns. What was found.