Show / Hide Table of Contents

Interface IGenericApi

Some miscellaneous methods.

Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IGenericApi

Methods

| Improve this Doc View Source

IdAsync(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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/...".

| Improve this Doc View Source

ShutdownAsync()

Stop the IPFS peer.

Declaration
Task ShutdownAsync()
Returns
Type Description
Task

A task that represents the asynchronous operation.

| Improve this Doc View Source

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.

See Also

Generic API spec
  • Improve this Doc
  • View Source
Back to top Generated by DocFX