helia
    Preparing search index...

    Interface HeliaWithLibp2p<M>

    The API presented by a Helia node

    interface HeliaWithLibp2p<M extends ServiceMap = DefaultLibp2pServices> {
        blockstore: Blocks;
        datastore: Datastore;
        dns: DNS;
        events: TypedEventEmitter<HeliaEvents<HeliaWithLibp2p<M>>>;
        getCodec: CodecLoader;
        getCrypto: CryptoLoader;
        getHasher: HasherLoader;
        info: NodeInfo;
        keychain: Keychain;
        libp2p: Libp2p<M>;
        logger: ComponentLogger;
        metrics?: Metrics;
        pins: Pins;
        routing: Routing;
        status: "starting" | "started" | "stopping" | "stopped";
        addBlockBroker(
            blockBroker:
                | BlockBroker<ProgressEvent<any, any>, ProgressEvent<any, any>>
                | ((components: any) => BlockBroker),
        ): void;
        addMixin<T extends Helia = Helia & Record<string, any>>(
            mixin: HeliaMixin<T>,
        ): void;
        addRouter(router: Router | ((components: any) => Router)): void;
        gc(options?: GCOptions): Promise<void>;
        hasBlockBroker(name: string): boolean;
        hasRouter(name: string): boolean;
        start(options?: AbortOptions): Promise<HeliaWithLibp2p<M>>;
        stop(options?: AbortOptions): Promise<HeliaWithLibp2p<M>>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    blockstore: Blocks

    Where the blocks are stored

    datastore: Datastore

    A key/value store

    dns: DNS

    The DNS property can be used to perform lookups of various record types and will use a resolver appropriate to the current platform.

    Event emitter for Helia start and stop events

    getCodec: CodecLoader

    Load an IPLD codec. Implementations may return a promise if, for example, the codec is being fetched from the network.

    getCrypto: CryptoLoader

    Cryptography implementations securely sign and verify data

    getHasher: HasherLoader

    Hashers can be used to hash a piece of data with the specified hashing algorithm. Implementations may return a promise if, for example, the hasher is being fetched from the network.

    info: NodeInfo

    Runtime information about the node

    keychain: Keychain

    Secure storage for private keys

    libp2p: Libp2p<M>

    Libp2p provides a peer identity and a networking layer

    A logging component that can be reused by consumers

    metrics?: Metrics

    A metrics object that can be used to collected arbitrary stats about node usage.

    pins: Pins

    Pinning operations for blocks in the blockstore

    routing: Routing

    The routing component allows performing operations such as looking up content providers, information about peers, etc.

    status: "starting" | "started" | "stopping" | "stopped"

    The current status of the Helia node

    Methods

    • Add a router

      Parameters

      Returns void

    • Remove any unpinned blocks from the blockstore

      Parameters

      Returns Promise<void>

    • Returns true if a block broker with the passed name has been configured

      Parameters

      • name: string

      Returns boolean

    • Returns true if a router with the passed name has been configured

      Parameters

      • name: string

      Returns boolean