Interface HeliaInit

Options used to create a Helia node.

interface HeliaInit {
    blockBrokers: ((components) => BlockBroker<ProgressEvent<any, any>, ProgressEvent<any, any>>)[];
    blockstore: Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>;
    codecs?: BlockCodec<any, any>[];
    components?: Record<string, any>;
    datastore: Datastore<{}, {}, {}, {}, {}, {}, {}, {}, {}, {}>;
    dns?: DNS;
    hashers?: MultihashHasher<number>[];
    holdGcLock?: boolean;
    logger?: ComponentLogger;
    metrics?: Metrics;
    providerLookupConcurrency?: number;
    routers?: Partial<Routing>[];
    loadCodec?(code): Await<BlockCodec<any, any>>;
    loadHasher?(code): Await<MultihashHasher<number>>;
}

Hierarchy

  • HeliaInit

    Properties

    blockBrokers: ((components) => BlockBroker<ProgressEvent<any, any>, ProgressEvent<any, any>>)[]

    A list of strategies used to fetch blocks when they are not present in the local blockstore

    Type declaration

    blockstore: Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>

    The blockstore is where blocks are stored

    Type declaration

      Type declaration

        Type declaration

          Type declaration

            Type declaration

              Type declaration

                Type declaration

                  Type declaration

                    codecs?: BlockCodec<any, any>[]

                    In order to pin CIDs that correspond to a DAG, it's necessary to know how to traverse that DAG. DAGWalkers take a block and yield any CIDs encoded within that block.

                    components?: Record<string, any>

                    Components used by subclasses

                    datastore: Datastore<{}, {}, {}, {}, {}, {}, {}, {}, {}, {}>

                    The datastore is where data is stored

                    Type declaration

                      Type declaration

                        Type declaration

                          Type declaration

                            Type declaration

                              Type declaration

                                Type declaration

                                  Type declaration

                                    Type declaration

                                      Type declaration

                                        dns?: DNS

                                        An optional DNS implementation used to perform queries for DNS records.

                                        hashers?: MultihashHasher<number>[]

                                        By default sha256, sha512 and identity hashes are supported for bitswap operations. To bitswap blocks with CIDs using other hashes pass appropriate MultihashHashers here.

                                        holdGcLock?: boolean

                                        Garbage collection requires preventing blockstore writes during searches for unpinned blocks as DAGs are typically pinned after they've been imported - without locking this could lead to the deletion of blocks while they are being added to the blockstore.

                                        By default this lock is held on the current process and other processes will contact this process for access.

                                        If Helia is being run in multiple processes, one process must hold the GC lock so use this option to control which process that is.

                                        Default

                                        true
                                        

                                        An optional logging component to pass to libp2p. If not specified the default implementation from libp2p will be used.

                                        metrics?: Metrics

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

                                        providerLookupConcurrency?: number

                                        During provider lookups, peers can be returned from routing implementations with no multiaddrs.

                                        This can happen when they've been retrieved from network peers that only store multiaddrs for a limited amount of time.

                                        When this happens the peer's info has to be looked up with a further query.

                                        To not have this query block the yielding of other providers returned with multiaddrs, a separate queue is used to perform this lookup.

                                        This config value controls the concurrency of that queue.

                                        Default

                                        5
                                        
                                        routers?: Partial<Routing>[]

                                        Routers perform operations such as looking up content providers, information about network peers or getting/putting records.

                                        Methods