Options
All
  • Public
  • Public/Protected
  • All
Menu

Ceramic core Dispatcher used for handling messages from pub/sub topic.

Hierarchy

  • Dispatcher

Index

Constructors

constructor

  • new Dispatcher(_ipfs: IpfsApi, topic: string, repository: Repository, _logger: DiagnosticsLogger, _pubsubLogger: ServiceLogger, maxQueriesPerSecond: number): Dispatcher

Properties

Readonly _ipfs

_ipfs: IpfsApi

Readonly dagNodeCache

dagNodeCache: LRUMap<string, any>

Readonly messageBus

messageBus: MessageBus

Readonly repository

repository: Repository

Methods

close

  • close(): Promise<void>

handleMessage

publishTip

  • publishTip(streamId: StreamID, tip: CID): Subscription

retrieveCommit

  • retrieveCommit(cid: CID | string, streamId?: StreamID): Promise<any>
  • Retrieves one Ceramic commit by CID, and enforces that the commit doesn't exceed the maximum commit size. To load an IPLD path or a CID from IPFS that isn't a Ceramic commit, use retrieveFromIPFS.

    Parameters

    • cid: CID | string

      Commit CID

    • Optional streamId: StreamID

      StreamID of the stream the commit belongs to, used for logging.

    Returns Promise<any>

retrieveFromIPFS

  • retrieveFromIPFS(cid: CID | string, path?: string): Promise<any>
  • Retrieves an object from the IPFS dag

    Parameters

    • cid: CID | string
    • Optional path: string

      optional IPLD path to load, starting from the object represented by cid

    Returns Promise<any>

storeCommit

  • storeCommit(data: any, streamId?: StreamID): Promise<CID>
  • Store Ceramic commit (genesis|signed|anchor).

    Parameters

    • data: any

      Ceramic commit data

    • Optional streamId: StreamID

      StreamID of the stream the commit belongs to, used for logging.

    Returns Promise<CID>