Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectionManager

ConnectionManager is responsible for managing the connection to IPFS.

Hierarchy

  • ConnectionManager

Index

Constructors

constructor

  • Creates an instance of ConnectionManager with configs and dependencies injected.

    Parameters

    • events: SteerEventEmitter

      Allow for event emitters to be added

    • registry: Registry

      Registry instance which contains the current protocols root db store

    • ipfs: IPFS

      IPFS instance which is used to interact with the ipfs network

    • orbit: Orbit
    • identityManager: IdentityManager

      IdentityManager instance which is used to manage the identity

    • logger: Logger

      Logger instance which is used to log events

    Returns ConnectionManager

Properties

connections

connections: {} = {}

Type declaration

  • [key: string]: { connection: any; statistics: { active: boolean; loadProgress: number; peers: string[]; replicationProgress: number; status: "inactive" | "active" | "replicating" | "loading" } }
    • connection: any
    • statistics: { active: boolean; loadProgress: number; peers: string[]; replicationProgress: number; status: "inactive" | "active" | "replicating" | "loading" }
      • active: boolean
      • loadProgress: number
      • peers: string[]
      • replicationProgress: number
      • status: "inactive" | "active" | "replicating" | "loading"

events

identityManager

identityManager: IdentityManager

ipfs

ipfs: IPFS

ipfs_swarm_peer

ipfs_swarm_peer: number = 0

logger

logger: Logger

orbit

orbit: Orbit

registry

registry: Registry

registry_peers

registry_peers: number = 0

Methods

addListeners

  • addListeners(db: default): void
  • Add listeners to the connection to update the statistics and the connection status. These listners events are emitted via the SteerEventEmitter.

    Parameters

    • db: default

      DB Store instance of the database to add listeners to

    Returns void

open

  • open<T>(type: DbType, nameOrAddress: string): Promise<T>
  • Opens a connection with a database utilizing the embedded/linked identity.

    Type parameters

    • T

    Parameters

    • type: DbType

      DBType from Orbit

    • nameOrAddress: string

      Address to a distributed db or a name of one which should be created

    Returns Promise<T>

    Store of the requested database

start

  • start(): Promise<void>

Generated using TypeDoc