helia

Home > helia > HeliaInit

HeliaInit interface

Options used to create a Helia node.

Signature:

export interface HeliaInit<T extends Libp2p = Libp2p> 

Properties

Property Modifiers Type Description
blockstore?   Blockstore (Optional) The blockstore is where blocks are stored
dagWalkers?   DAGWalker[] (Optional) 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.
datastore?   Datastore (Optional) The datastore is where data is stored
hashers?   MultihashHasher[] (Optional) 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 <p>(Optional) 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.</p><p>By default this lock is held on the main process (e.g. node cluster’s primary process, the renderer thread in browsers) and other processes will contact the main process for access (worker processes in node cluster, webworkers in the browser).</p><p>If Helia is being run wholly in a non-primary process, with no other process expected to access the blockstore (e.g. being run in the background in a webworker), pass true here to hold the gc lock in this process.</p>
libp2p?   T | Libp2pOptions <p>(Optional) A libp2p node is required to perform network operations. Either a preconfigured node or options to configure a node can be passed here.</p><p>If node options are passed, they will be merged with the default config for the current platform. In this case all passed config keys will replace those from the default config.</p>
start?   boolean (Optional) Pass false to not start the Helia node