Code Monkey home page Code Monkey logo

Comments (7)

hsanjuan avatar hsanjuan commented on June 6, 2024

I haven' t tried, but you should be able to add websocket, webtransport or whatever listen_multiaddresses in the configuration (only tcp and quic enabled by default):

    "listen_multiaddress": [
      "/ip4/0.0.0.0/tcp/9096",
      "/ip4/0.0.0.0/udp/9096/quic"
    ],

Let me know if that works.

from ipfs-cluster.

logesh2496 avatar logesh2496 commented on June 6, 2024

the service.json in /.ipfs-cluster already configured with

 "listen_multiaddress": [
      "/ip4/0.0.0.0/tcp/9096",
      "/ip4/0.0.0.0/udp/9096/quic"
    ],
    

I still couldn't connect from a browser node by dialing to /ip4/127.0.0.1/tcp/9096/ws/p2p/12D3KooWP9cTtnbNkNDJ9Dd5QWs3nckA3hMmmamJGAWLyYLsTPB8.

My helia node configuration:


import { webSockets } from '@libp2p/websockets'
import * as Filters from '@libp2p/websockets/filters'
import { bootstrap } from '@libp2p/bootstrap'

const libp2p = await createLibp2p({
  // ..other config
  transports: [
    webSockets({
      filter: Filters.all // this is necessary to dial local addresses using websockets
    })
    // other transports
  ],
  connectionGater: {
    denyDialMultiaddr: () => false // this is necessary to dial local addresses at all
  }
  peerDiscovery: [
    bootstrap({
      list: [
        `/ip4/[127.0.0.1/tcp/${PORT}/ws/p2p/${PEER_ID}`](http://127.0.0.1/tcp/$%7BPORT%7D/ws/p2p/$%7BPEER_ID%7D)
      ]
    })
  ]
})
    

from ipfs-cluster.

hsanjuan avatar hsanjuan commented on June 6, 2024

Add multiaddresses for the protocols you want to listen on, i.e websockets.

from ipfs-cluster.

logesh2496 avatar logesh2496 commented on June 6, 2024

@hsanjuan , I couldn't get that. can you please share some code snippets to do that?

How/Where do I add the protocol(websockets) in the service.json?

from ipfs-cluster.

hsanjuan avatar hsanjuan commented on June 6, 2024

i.e.

 "listen_multiaddress": [
      "/ip4/0.0.0.0/tcp/9096/ws",
    ],

from ipfs-cluster.

logesh2496 avatar logesh2496 commented on June 6, 2024

Thanks, I have added the ws address, but it doesn't look anything different. browser node is still not able to communicate to the ipfs cluster node.

"listen_multiaddress": [
      "/ip4/0.0.0.0/tcp/9096/ws",
      "/ip4/0.0.0.0/tcp/9096",
      "/ip4/0.0.0.0/udp/9096/quic"
    ],

I'm not sure if I should start the node with any other different command than ./ipfs-cluster-service daemon after saving the .ipfs-cluster/service.json file.

from ipfs-cluster.

logesh2496 avatar logesh2496 commented on June 6, 2024

It actually worked. My browser is connected to the ipfs-cluster. thanks

from ipfs-cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.