Show / Hide Table of Contents

Class IpfsEngine

Implements the ICoreApi which makes it possible to create a decentralised and distributed application without relying on an "IPFS daemon".

Inheritance
Object
IpfsEngine
Implements
ICoreApi
IService
IDisposable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Ipfs.Engine
Assembly: Ipfs.Engine.dll
Syntax
public class IpfsEngine : ICoreApi, IService, IDisposable
Remarks

The engine should be used as a shared object in your program. It is thread safe (re-entrant) and conserves resources when only one instance is used.

Constructors

| Improve this Doc View Source

IpfsEngine()

Creates a new instance of the IpfsEngine class with the IPFS_PASS environment variable.

Declaration
public IpfsEngine()
Remarks

Th passphrase must be in the IPFS_PASS environment variable.

| Improve this Doc View Source

IpfsEngine(Char[])

Creates a new instance of the IpfsEngine class with the specified passphrase.

Declaration
public IpfsEngine(char[] passphrase)
Parameters
Type Name Description
Char[] passphrase

The password used to access the keychain.

Remarks

A SecureString copy of the passphrase is made so that the array can be zeroed out after the call.

| Improve this Doc View Source

IpfsEngine(SecureString)

Creates a new instance of the IpfsEngine class with the specified passphrase.

Declaration
public IpfsEngine(SecureString passphrase)
Parameters
Type Name Description
SecureString passphrase

The password used to access the keychain.

Remarks

A copy of the passphrase is made.

Properties

| Improve this Doc View Source

Bitswap

Declaration
public IBitswapApi Bitswap { get; set; }
Property Value
Type Description
IBitswapApi
| Improve this Doc View Source

BitswapService

Exchange blocks with other peers.

Declaration
public AsyncLazy<Bitswap> BitswapService { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<Bitswap>
| Improve this Doc View Source

Block

Declaration
public IBlockApi Block { get; set; }
Property Value
Type Description
IBlockApi
| Improve this Doc View Source

BlockRepository

Declaration
public IBlockRepositoryApi BlockRepository { get; set; }
Property Value
Type Description
IBlockRepositoryApi
| Improve this Doc View Source

Bootstrap

Declaration
public IBootstrapApi Bootstrap { get; set; }
Property Value
Type Description
IBootstrapApi
| Improve this Doc View Source

Config

Declaration
public IConfigApi Config { get; set; }
Property Value
Type Description
IConfigApi
| Improve this Doc View Source

Dag

Declaration
public IDagApi Dag { get; set; }
Property Value
Type Description
IDagApi
| Improve this Doc View Source

Dht

Declaration
public IDhtApi Dht { get; set; }
Property Value
Type Description
IDhtApi
| Improve this Doc View Source

DhtService

Finds information with a distributed hash table.

Declaration
public AsyncLazy<Dht1> DhtService { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<Dht1>
| Improve this Doc View Source

Dns

Declaration
public IDnsApi Dns { get; set; }
Property Value
Type Description
IDnsApi
| Improve this Doc View Source

FileSystem

Declaration
public IFileSystemApi FileSystem { get; set; }
Property Value
Type Description
IFileSystemApi
| Improve this Doc View Source

Generic

Declaration
public IGenericApi Generic { get; set; }
Property Value
Type Description
IGenericApi
| Improve this Doc View Source

IsStarted

Determines if the engine has started.

Declaration
public bool IsStarted { get; }
Property Value
Type Description
Boolean

true if the engine has started; otherwise, false.

See Also
Start()
StartAsync()
| Improve this Doc View Source

Key

Declaration
public IKeyApi Key { get; set; }
Property Value
Type Description
IKeyApi
| Improve this Doc View Source

LocalPeer

Provides access to the local peer.

Declaration
public AsyncLazy<Peer> LocalPeer { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<Peer>

A task that represents the asynchronous operation. The task's result is a Peer.

| Improve this Doc View Source

MigrationManager

Manages the version of the repository.

Declaration
public MigrationManager MigrationManager { get; set; }
Property Value
Type Description
MigrationManager
| Improve this Doc View Source

Name

Declaration
public INameApi Name { get; set; }
Property Value
Type Description
INameApi
| Improve this Doc View Source

Object

Declaration
public IObjectApi Object { get; set; }
Property Value
Type Description
IObjectApi
| Improve this Doc View Source

Options

The configuration options.

Declaration
public IpfsEngineOptions Options { get; set; }
Property Value
Type Description
IpfsEngineOptions
| Improve this Doc View Source

Pin

Declaration
public IPinApi Pin { get; set; }
Property Value
Type Description
IPinApi
| Improve this Doc View Source

PingService

Determines latency to a peer.

Declaration
public AsyncLazy<Ping1> PingService { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<Ping1>
| Improve this Doc View Source

PubSub

Declaration
public IPubSubApi PubSub { get; set; }
Property Value
Type Description
IPubSubApi
| Improve this Doc View Source

PubSubService

Manages publishng and subscribing to messages.

Declaration
public AsyncLazy<NotificationService> PubSubService { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<NotificationService>
| Improve this Doc View Source

Stats

Declaration
public IStatsApi Stats { get; set; }
Property Value
Type Description
IStatsApi
| Improve this Doc View Source

Swarm

Declaration
public ISwarmApi Swarm { get; set; }
Property Value
Type Description
ISwarmApi
| Improve this Doc View Source

SwarmService

Manages communication with other peers.

Declaration
public AsyncLazy<Swarm> SwarmService { get; }
Property Value
Type Description
Nito.AsyncEx.AsyncLazy<Swarm>

Methods

| Improve this Doc View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Releases the unmanaged and optionally managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

| Improve this Doc View Source

KeyChainAsync(CancellationToken)

Provides access to the KeyChain.

Declaration
public Task<KeyChain> KeyChainAsync(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<KeyChain>

A task that represents the asynchronous operation. The task's result is the KeyChain.

| Improve this Doc View Source

ResolveIpfsPathToCidAsync(String, CancellationToken)

Resolve an "IPFS path" to a content ID.

Declaration
public Task<Cid> ResolveIpfsPathToCidAsync(string path, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
String path

A IPFS path, such as "Qm...", "Qm.../a/b/c" or "/ipfs/QM..."

CancellationToken cancel

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

Returns
Type Description
Task<Cid>

The content ID of path.

Exceptions
Type Condition
ArgumentException

The path cannot be resolved.

| Improve this Doc View Source

Start()

A synchronous start.

Declaration
public void Start()
Remarks

Calls StartAsync() and waits for it to complete.

| Improve this Doc View Source

StartAsync()

Starts the network services.

Declaration
public Task StartAsync()
Returns
Type Description
Task

A task that represents the asynchronous operation.

Remarks

Starts the various IPFS and PeerTalk network services. This should be called after any configuration changes.

Exceptions
Type Condition
Exception

When the engine is already started.

| Improve this Doc View Source

Stop()

A synchronous stop.

Declaration
public void Stop()
Remarks

Calls StopAsync() and waits for it to complete.

| Improve this Doc View Source

StopAsync()

Stops the running services.

Declaration
public Task StopAsync()
Returns
Type Description
Task

A task that represents the asynchronous operation.

Remarks

Multiple calls are okay.

Implements

ICoreApi
IService
System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX