Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libp2p crypto error - Not implemented #23789

Open
danimrangelb opened this issue May 13, 2024 · 0 comments
Open

libp2p crypto error - Not implemented #23789

danimrangelb opened this issue May 13, 2024 · 0 comments

Comments

@danimrangelb
Copy link

Version: Deno 1.43.3

I'm trying libp2p on deno and i'm getting this error from the crypto package:

image

this is my code

import { gossipsub } from "npm:@chainsafe/libp2p-gossipsub";
import { createLibp2p } from "npm:libp2p";
import { tcp } from "npm:@libp2p/tcp";
import { webSockets } from "npm:@libp2p/websockets";
import * as filters from 'npm:@libp2p/websockets/filters'
import { mplex } from "npm:@libp2p/mplex";
import { dcutr } from 'npm:@libp2p/dcutr'
import { noise } from "npm:@chainsafe/libp2p-noise";
import { mdns } from "npm:@libp2p/mdns";
import { kadDHT } from "npm:@libp2p/kad-dht";
import { yamux } from "npm:@chainsafe/libp2p-yamux";
import { bootstrap } from "npm:@libp2p/bootstrap";
import { identify } from 'npm:@libp2p/identify'
import { circuitRelayTransport } from "npm:@libp2p/circuit-relay-v2";

const node = await createLibp2p({
  transports: [
    tcp(),
    webSockets({
      filter: filters.all,
    }),
    circuitRelayTransport({
      discoverRelays: 1,
    }),
  ],
  streamMuxers: [yamux(), mplex()],
  connectionEncryption: [noise()],
  peerDiscovery: [
    mdns({
      interval: 1000,
    }),
    bootstrap({
      list: [
        // A list of bootstrap peers to connect to starting up the node
        "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
        "/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
        "/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
      ],
    }),
  ],
  connectionGater: {
    denyDialMultiaddr: () => {
      return false
    }
  },
  services: {
    identify: identify(),
    dht: kadDHT({
      kBucketSize: 20,
      clientMode: false,
    }),
    pubsub: gossipsub(),
    dcutr: dcutr(),
  },
  connectionManager: {
    minConnections: 0
  }
});

await node.start();

console.log(node.peerId.toString())

// node.services.pubsub.addEventListener('message', event => {
//   const topic = event.detail.topic
//   const message = toString(event.detail.data)

//   appendOutput(`Message received on topic '${topic}'`)
//   appendOutput(message)
// })

console.log("libp2p node started");

Is there a way to sole this? like replacing the module in the importmap or something?

@danimrangelb danimrangelb changed the title libp2p crypto error libp2p crypto error - Not implemented May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant