Manages IPFS blocks.
Namespace: Ipfs.CoreApi Assembly: Ipfs.Core.dll Syntaxpublic interface IBlockApi
Methods | Improve this Doc View Source GetAsync(Cid, CancellationToken)
Gets an IPFS block.
DeclarationTask<IDataBlock> GetAsync(Cid id, CancellationToken cancel = default(CancellationToken))
Parameters Returns Type Description Task<IDataBlock>
A task that represents the asynchronous get operation. The task's value contains the block's id and data.
| Improve this Doc View Source PutAsync(Byte[], String, String, String, Boolean, CancellationToken)Stores a byte array as an IPFS block.
DeclarationTask<Cid> PutAsync(byte[] data, string contentType = "dag-pb", string multiHash = "sha2-256", string encoding = "base58btc", bool pin = false, CancellationToken cancel = default(CancellationToken))
Parameters Type Name Description Byte[] data
The byte array to send to the IPFS network.
String contentTypeThe content type or format of the data
; such as "raw" or "dag-db". See MultiCodec for more details.
The MultiHash algorithm name used to produce the Cid.
String encodingThe MultiBase algorithm name used to produce the Cid.
Boolean pinIf true the block is pinned to local storage and will not be garbage collected. The default is false.
CancellationToken cancelIs used to stop the task. When cancelled, the TaskCanceledException is raised.
Returns Type Description Task<Cid>A task that represents the asynchronous put operation. The task's value is the block's Cid.
| Improve this Doc View Source PutAsync(Stream, String, String, String, Boolean, CancellationToken)Stores a stream as an IPFS block.
DeclarationTask<Cid> PutAsync(Stream data, string contentType = "dag-pb", string multiHash = "sha2-256", string encoding = "base58btc", bool pin = false, CancellationToken cancel = default(CancellationToken))
Parameters Type Name Description Stream data
The Stream of data to send to the IPFS network.
String contentTypeThe content type or format of the data
; such as "raw" or "dag-db". See MultiCodec for more details.
The MultiHash algorithm name used to produce the Cid.
String encodingThe MultiBase algorithm name used to produce the Cid.
Boolean pinIf true the block is pinned to local storage and will not be garbage collected. The default is false.
CancellationToken cancelIs used to stop the task. When cancelled, the TaskCanceledException is raised.
Returns Type Description Task<Cid>A task that represents the asynchronous put operation. The task's value is the block's Cid.
| Improve this Doc View Source RemoveAsync(Cid, Boolean, CancellationToken)Remove an IPFS block.
DeclarationTask<Cid> RemoveAsync(Cid id, bool ignoreNonexistent = false, CancellationToken cancel = default(CancellationToken))
Parameters Type Name Description Cid id
The Cid of the block.
Boolean ignoreNonexistentIf true do not raise exception when id
does not exist. Default value is false.
Is used to stop the task. When cancelled, the TaskCanceledException is raised.
Returns Type Description Task<Cid>The awaited Task will return the deleted id
or null if the id
does not exist and ignoreNonexistent
is true.
Information on an IPFS block.
DeclarationTask<IDataBlock> StatAsync(Cid id, CancellationToken cancel = default(CancellationToken))
Parameters Returns Type Description Task<IDataBlock>
A task that represents the asynchronous operation. The task's value contains the block's id and size or null.
See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4