-
Notifications
You must be signed in to change notification settings - Fork 509
Closed
Closed
Copy link
Labels
Description
I'm in the dark here, you could use some work on your git docs!
I found defaults https://github.com/ipfs/helia/blob/main/packages/helia/src/utils/libp2p-defaults.ts for libp2p cause I could not find it here.
used https://www.npmjs.com/package/@libp2p/circuit-relay-v2 because 'libp2p/circuit-relay' doesn't exist
got this error
(node:1675237) UnhandledPromiseRejectionWarning: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './peer-job-queue' is not defined by "exports" in /home/benz/Desktop/vite/app/node_modules/@libp2p/utils/package.json imported from /home/benz/Desktop/vite/app/node_modules/@libp2p/circuit-relay-v2/dist/src/transport/reservation-store.js
at new NodeError (node:internal/errors:399:5)
at exportsNotFound (node:internal/modules/esm/resolve:361:10)
at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
at packageResolve (node:internal/modules/esm/resolve:878:14)
at moduleResolve (node:internal/modules/esm/resolve:944:20)
at defaultResolve (node:internal/modules/esm/resolve:1159:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:1675237) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
The npm package put this main repo as where to report bugs, and they look like part of your team, so if you get mad at me for posting this here go ask why they did that in the first place.
-
Version:
the latest -
Platform:
inux benz-iMac 5.15.0-88-generic 98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux -
Subsystem:
libp2p
Severity:
boom
Description:
loaded libp2p
Steps to reproduce the error:
// this should be deleted after it is called
//const { MemoryDatastore } = await import('datastore-core')
//const { MemoryBlockstore } = await import('blockstore-core')
const { circuitRelayTransport, circuitRelayServer } = await import('@libp2p/circuit-relay-v2')
const { tcp } = await import('@libp2p/tcp')
const { webRTC, webRTCDirect } = await import('@libp2p/webrtc')
const { webSockets } = await import('@libp2p/websockets')
const { mdns } = await import('@libp2p/mdns')
const { noise } = await import('@chainsafe/libp2p-noise')
const { yamux } = await import('@chainsafe/libp2p-yamux')
const { identify } = await import('@libp2p/identify')
const { autoNAT } = await import('@libp2p/autonat')
const { uPnPNAT } = await import('@libp2p/upnp-nat')
const { dcutr } = await import('@libp2p/dcutr')
const { kadDHT } = await import('@libp2p/kad-dht')
const { ping } = await import('@libp2p/ping')
const { gossipsub } = await import('@chainsafe/libp2p-gossipsub') // https://github.com/ChainSafe/js-libp2p-gossipsub
const IPFS = await import('ipfs-core')
//const { createOrbitDB, IPFSAccessController } = await import('@orbitdb/core')
const { createLibp2p } = await import('libp2p')
const Room = require('ipfs-pubsub-room')
//const datastore = new MemoryDatastore()
//const blockstore = new MemoryBlockstore()
const libp2p = await createLibp2p({
//datastore,
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0', '/ip6/::/tcp/0', '/webrtc'],
swarm: ['/ip4/127.0.0.1/tcp/9090/ws']
},
transports: [
circuitRelayTransport({
discoverRelays: 1
}),
tcp(),
webRTC(),
webRTCDirect(),
webSockets()
],
peerDiscovery: [mdns()],
connectionEncryption: [noise()],
streamMuxers: [yamux()],
services: {
identify: identify(),
autoNAT: autoNAT(),
upnpNAT: uPnPNAT(),
dcutr: dcutr(),
circuitRelay: circuitRelayServer({
advertise: true
}),
dht: kadDHT(),
ping: ping(),
pubsub: gossipsub()
}
})