ipfs / helia

An implementation of IPFS in TypeScript
https://helia.io
Other
954 stars 105 forks source link

kadDHT Incompatible with dht #133

Closed TheGreatAlgo closed 1 year ago

TheGreatAlgo commented 1 year ago

In the following config based on the latest examples:

Screenshot 2023-05-23 at 4 26 39 PM

Screenshot 2023-05-23 at 4 41 54 PM

Current Versioning: "libp2p": "^0.45.1", "@libp2p/kad-dht": "^9.3.3",

Unsure if this is related, but it seems to not be getting any event listeners working suggesting to me that I won't be able to dial and connect to peers I want to connect to. Here is my config.

const libp2p = await createLibp2p({
        // transports allow us to dial peers that support certain types of addresses
        transports: [webSockets(), webTransport()],
        connectionEncryption: [noise()],
        streamMuxers: [mplex()], // streamMuxers: [yamux(), mplex()],
        peerDiscovery: [
            bootstrap({
                list: [
                    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
                    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
                    "/dnsaddr/bootstrap.libp2p.io/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp",
                    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
                    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
                ],
            }),
        ],
        contentRouters: [ipniContentRouting("https://cid.contact")],
        services: {
            // the identify service is used by the DHT and the circuit relay transport
            // to find peers that support the relevant protocols
            identify: identifyService(),
            // the DHT is used to find circuit relay servers we can reserve a slot on
            dht: kadDHT({
                clientMode: true,
                validators: {
                    ipns: ipnsValidator,
                },
                selectors: {
                    ipns: ipnsSelector,
                },
            }),
        },
    });

I did have it working before but I forget what versions it worked with

achingbrain commented 1 year ago

This works for me with the version ranges specified - do you have a lockfile? Can you try removing it and reinstalling?

TheGreatAlgo commented 1 year ago

Good point with the lockfile! Deleting it resolved the kaddht issue! But other problems still persist.

Seems like the helia node isn't so lively anymore. And only when I try to use the .cat does it find one peer which it can't even dial.

Screenshot 2023-05-24 at 11 25 33 AM

TheGreatAlgo commented 1 year ago

Using the above config, I also get this when trying to start a helia node

Screenshot 2023-05-24 at 11 30 00 AM

TheGreatAlgo commented 1 year ago

Maybe out of scope of this issue, but I am also getting this issue when trying to dial via webtransport address i know Screenshot 2023-05-24 at 12 04 57 PM

Have you experienced this before? It worked prior. Then it became intermittent, and now seemingly not working

achingbrain commented 1 year ago

Using the above config, I also get this when trying to start a helia node

I think you may have some outdated dependencies. Can you please make sure all libp2p/helia/multiformats/etc deps are on the latest versions.

when I try to use the .cat does it find one peer which it can't even dial.

What's the full multiaddr it's trying to dial? Is this a node listening locally?

I am also getting this issue when trying to dial via webtransport address i know

The browser is rejecting the certificate from the remote - could you open an issue on https://github.com/libp2p/js-libp2p-webtransport with some more information - what's the full multiaddr it's dialling, how long as the remote been running, etc.

TheGreatAlgo commented 1 year ago

Issue with latest helia update requiring node 18 or more

its trying to dial /ip4/45.55.32.80/udp/4001/quic-v1/webtransport/certhash/uEiAM_1-R7yfSAtnm9g_fzzcIccsT1RzKPfXPr5lKfqmVVQ/certhash/uEiAcLZS4mabYQl9V1K0QjWsToU21DtsWarGTjZQzecHFmg/p2p/12D3KooWG7itEPAHut3xsVo7CwyD8sKeQXKgQizotNhPsToCssXQ

maybe it works for you?

sure I can open an issue

github-actions[bot] commented 1 year ago

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it is missing author input.