Skip to content

Running default examples throws where upnp isn't enabled #406

@azf20

Description

@azf20

The default libp2p configuration includes a upnp configuration, so await createHelia() throws if this isn't supported (I am running on Apple M3, personal wifi):

Error: Service not found
    at Device.getService (<folder>/node_modules/.pnpm/@[email protected]/node_modules/@achingbrain/nat-port-mapper/src/upnp/device.ts:104:13)

I (think I) resolved by deleting the upnp variable:

const libp2p = libp2pDefaults()
libp2p.services = { ...libp2p.services }
delete (libp2p.services as any).upnp

const helia = await createHelia({
  libp2p,
})

But I am not sure about the downstream impact of this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions