Interface IGenericApi
Some miscellaneous methods.
Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IGenericApi
Methods
| Improve this Doc View SourceIdAsync(MultiHash, CancellationToken)
Information about an IPFS peer.
Declaration
Task<Peer> IdAsync(MultiHash peer = null, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiHash | peer | The id of the IPFS peer. If not specified (e.g. null), then the local peer is used. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<Peer> | A task that represents the asynchronous operation. The task's value is the Peer information. |
Ping(MultiAddress, Int32, CancellationToken)
Send echo requests to a peer.
Declaration
IAsyncEnumerable<PingResult> Ping(MultiAddress address, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiAddress | address | The address of a peer to receive the echo requests. |
Int32 | count | The number of echo requests to send. Defaults to 10. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<PingResult> | An asynchronous stream of PingResult. |
Ping(MultiHash, Int32, CancellationToken)
Send echo requests to a peer.
Declaration
IAsyncEnumerable<PingResult> Ping(MultiHash peer, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiHash | peer | The peer ID to receive the echo requests. |
Int32 | count | The number of echo requests to send. Defaults to 10. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<PingResult> | An asynchronous stream of PingResult. |
PingAsync(MultiAddress, Int32, CancellationToken)
Send echo requests to a peer.
Declaration
Task<IEnumerable<PingResult>> PingAsync(MultiAddress address, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiAddress | address | The address of a peer to receive the echo requests. |
Int32 | count | The number of echo requests to send. Defaults to 10. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<IEnumerable<PingResult>> | A task that represents the asynchronous operation. The task's value is the sequence of PingResult. |
PingAsync(MultiHash, Int32, CancellationToken)
Send echo requests to a peer.
Declaration
Task<IEnumerable<PingResult>> PingAsync(MultiHash peer, int count = 10, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
MultiHash | peer | The peer ID to receive the echo requests. |
Int32 | count | The number of echo requests to send. Defaults to 10. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<IEnumerable<PingResult>> | A task that represents the asynchronous operation. The task's value is the sequence of PingResult. |
ResolveAsync(String, Boolean, CancellationToken)
Resolve a name.
Declaration
Task<string> ResolveAsync(string name, bool recursive = true, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | name | The name to resolve. |
Boolean | recursive | Resolve until the result is an IPFS name. Defaults to true. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<String> | A task that represents the asynchronous operation. The task's value is the resolved path as a String. |
Remarks
The name
can be Cid + [path], "/ipfs/..." or
"/ipns/...".
ShutdownAsync()
Stop the IPFS peer.
Declaration
Task ShutdownAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
VersionAsync(CancellationToken)
Get the version information.
Declaration
Task<Dictionary<string, string>> VersionAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<Dictionary<String, String>> | A task that represents the asynchronous operation. The task's value is a Dictionary<TKey,TValue> of values. |