Interface IContentRouting
Find information about who has what content.
Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IContentRouting
Remarks
No IPFS documentation is currently available. See the code.
Methods
| Improve this Doc View SourceFindProvidersAsync(Cid, Int32, Action<Peer>, CancellationToken)
Find the providers for the specified content.
Declaration
Task<IEnumerable<Peer>> FindProvidersAsync(Cid id, int limit = 20, Action<Peer> providerFound = null, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Cid | id | The Cid of the content. |
Int32 | limit | The maximum number of peers to return. Defaults to 20. |
Action<Peer> | providerFound | An action to perform when a provider is found. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Peer>> | A task that represents the asynchronous operation that returns a sequence of IPFS Peer. |
ProvideAsync(Cid, Boolean, CancellationToken)
Adds the Cid to the content routing system.
Declaration
Task ProvideAsync(Cid cid, bool advertise = true, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Cid | cid | The ID of some content that the peer contains. |
Boolean | advertise | Advertise the |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |