Interface Bitswap

interface Bitswap {
    peers: PeerId[];
    stats: Stats;
    afterStart?(): void | Promise<void>;
    afterStop?(): void | Promise<void>;
    beforeStart?(): void | Promise<void>;
    beforeStop?(): void | Promise<void>;
    cancelWants(cids): void;
    getWantlist(): IterableIterator<[string, WantListEntry]>;
    ledgerForPeer(peerId): undefined | Ledger;
    notify(cid, block, options?): void;
    start(): void | Promise<void>;
    stop(): void | Promise<void>;
    unwant(cids): void;
    want(cid, options?): Promise<Uint8Array>;
    wantlistForPeer(peerId): Map<string, WantListEntry>;
}

Hierarchy

Properties

peers: PeerId[]

The peers that we are tracking a ledger for

stats: Stats

Bitswap statistics

Methods

  • If implemented, this method will be invoked after the start method.

    All other components will have had their start method invoked before this method is called.

    Returns void | Promise<void>

  • If implemented, this method will be invoked after the stop method.

    All other components will have had their stop method invoked before this method is called.

    Returns void | Promise<void>

  • If implemented, this method will be invoked before the start method.

    It should not assume any other components have been started.

    Returns void | Promise<void>

  • If implemented, this method will be invoked before the stop method.

    Any other components will still be running when this method is called.

    Returns void | Promise<void>

  • This method will be invoked to start the component.

    It should not assume that any other components have been started.

    Returns void | Promise<void>

  • This method will be invoked to stop the component.

    It should not assume any other components are running when it is called.

    Returns void | Promise<void>

Generated using TypeDoc