helia
    Preparing search index...

    Module index

    Adds libp2p functionality to Helia

    import { createHelia } from 'helia'
    import { withLibp2p } from '@helia/libp2p'

    const node = await withLibp2p(createHelia()).start()

    console.info(node.libp2p.peerId) // 12D3Koo...

    By default withLibp2p configures a libp2p node for the current environment.

    Each option passed replaces the default for that key. Pass config: 'merge' to merge the options into the default config instead.

    For full control over your node (and the bundle size), use withLibp2pLight from @helia/libp2p/light. That entry point does not load the default config or any of its dependencies:

    import { createHeliaLight } from 'helia/light'
    import { withLibp2pLight } from '@helia/libp2p/light'

    const node = await withLibp2pLight(createHeliaLight(), {
    //... libp2p config here
    }).start()

    console.info(node.libp2p.peerId) // 12D3Koo...
    DefaultLibp2pServices
    libp2pDefaults
    libp2pRouting
    withLibp2p
    CreateLibp2pOptions → CreateLibp2pOptions
    HeliaWithLibp2p → HeliaWithLibp2p
    withLibp2pLight → withLibp2pLight