Coder Social home page Coder Social logo

Comments (3)

vaibhavmuchandi avatar vaibhavmuchandi commented on June 2, 2024

bumping this

from js-libp2p.

achingbrain avatar achingbrain commented on June 2, 2024

Relayed connections are time/data limited which means they can be closed at any time so data-heavy protocols don't run over them by default.

This is normally overridable with a runOnTransientConnection option but it looks like GossipSub doesn't have one of these - this will add it: ChainSafe/js-libp2p-gossipsub#485

Once that's been merged & released you should be able to configure it as:

import { createLibp2p } from 'libp2p'
import { gossipsub } from '@libp2p/gossipsub'

const node = await createLibp2({
  // other config
  services: {
    pubsub: gossipsub({
      runOnTransientConnection: true
    })
  }
})

What's happening in your example is the pubsub message is being sent from node2 to the relay over the direct websocket connection, then from the relay to node1.

What you want is for the message to got from node2 to node1 over the relayed connection between them instead.

With the runOnTransientConnection option you can remove gossipsub from the relay entirely.

from js-libp2p.

achingbrain avatar achingbrain commented on June 2, 2024

@chainsafe/[email protected] contains the fix for runOnTransientConnection - please try that and the suggestions on https://gist.github.com/vaibhavmuchandi/7cc3d28161ceff68de9bb036bf03a24d

This should resolve the issue, please re-open this issue if you're still having trouble getting it working.

from js-libp2p.

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.