Show / Hide Table of Contents

Interface IBootstrapApi

Manages the list of initial peers.

Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IBootstrapApi
Remarks

The API manipulates the "bootstrap list", which contains the addresses of the bootstrap nodes. These are the trusted peers from which to learn about other peers in the network.

Methods

| Improve this Doc View Source

AddAsync(MultiAddress, CancellationToken)

Adds a new peer.

Declaration
Task<MultiAddress> AddAsync(MultiAddress address, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
MultiAddress address

The address must end with the ipfs protocol and the public ID of the peer. For example "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<MultiAddress>

A task that represents the asynchronous operation. The task's result is the address that was added or null if the address is already in the bootstrap list.

| Improve this Doc View Source

AddDefaultsAsync(CancellationToken)

Adds the default peers to the list.

Declaration
Task<IEnumerable<MultiAddress>> AddDefaultsAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<IEnumerable<MultiAddress>>

A task that represents the asynchronous operation. The task's result is the sequence of addresses that were added.

| Improve this Doc View Source

ListAsync(CancellationToken)

List all the peers.

Declaration
Task<IEnumerable<MultiAddress>> ListAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<IEnumerable<MultiAddress>>

A task that represents the asynchronous operation. The task's result is a sequence of addresses.

| Improve this Doc View Source

RemoveAllAsync(CancellationToken)

Remove all the peers.

Declaration
Task RemoveAllAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
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.

| Improve this Doc View Source

RemoveAsync(MultiAddress, CancellationToken)

Delete the specified peer.

Declaration
Task<MultiAddress> RemoveAsync(MultiAddress address, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
MultiAddress address

The address must end with the ipfs protocol and the public ID of the peer. For example "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<MultiAddress>

A task that represents the asynchronous operation. The task's result is the address that was removed or null if the address is not in the bootstrap list.

See Also

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