Exports a createHelia function that returns an object that implements the Helia API.
Pass it to other modules like @helia/unixfs to make files available on the distributed web.
To create a node without @helia/libp2p or @helia/bitswap, and without
loading them, import createHeliaLight from helia/light instead. To add
your own libp2p node to it, use withLibp2pLight from @helia/libp2p/light.
Adding blocks to a Helia node does not announce them to the network. To let
other peers discover that this node can supply a CID, provide it explicitly.
Provided CIDs are re-announced periodically for as long as the node is
running, until helia.routing.cancelReprovide(cid) is called or the block is
deleted from the blockstore.
// announce the CID to the network so other peers can find this node as a // provider, it will be re-provided periodically while the node is running awaithelia.routing.provide(cid)
// stop re-providing the CID, existing provider records will expire from // the network over time awaithelia.routing.cancelReprovide(cid)
Other peers also need to be able to dial this node to fetch the blocks,
which is not always possible for nodes running in web browsers.
Exports a
createHeliafunction that returns an object that implements the Helia API.Pass it to other modules like @helia/unixfs to make files available on the distributed web.
To create a node without
@helia/libp2por@helia/bitswap, and without loading them, importcreateHeliaLightfromhelia/lightinstead. To add your own libp2p node to it, usewithLibp2pLightfrom@helia/libp2p/light.Example
Example: Providing content
Adding blocks to a Helia node does not announce them to the network. To let other peers discover that this node can supply a CID, provide it explicitly.
Provided CIDs are re-announced periodically for as long as the node is running, until
helia.routing.cancelReprovide(cid)is called or the block is deleted from the blockstore.Other peers also need to be able to dial this node to fetch the blocks, which is not always possible for nodes running in web browsers.