helia-examples icon indicating copy to clipboard operation
helia-examples copied to clipboard

Running default examples throws where upnp isn't enabled

Open azf20 opened this issue 11 months ago • 0 comments

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.

azf20 avatar Jan 09 '25 11:01 azf20