Comments (7)
Can you provide us a test case for this?
I locally tried go node with js node using gossipsub (directly connected), and after subscribing I could receive the messages as expected.
from js-libp2p-gossipsub.
They will be able to receive the messages, but it will depend on how your overlay network is defined.
You will need to be connected to a set of libp2p nodes sharing the same pubsub topic interests, in order to receive the message. How are you establishing your node connectivity and peer discover, and how will they discover go nodes? Moreover, are you using this on Node.js or browser node?
from js-libp2p-gossipsub.
I connect them directly to each other using peerstore and dial and they still don't receive messages. I am using electron which is executed in context of nodejs.
from js-libp2p-gossipsub.
I have this same issue, I cannot get the data to be received in a simple test
import Gossipsub from 'libp2p-gossipsub';
import Libp2p from 'libp2p';
test('exact reporoduction of gossip', async (done)=>{
const Gossipsub = require('libp2p-gossipsub');
const options = {emitSelf: true, gossipIncoming: true};
const node1= await createNodeExact();
const node2 = await createNodeExact();
// await node1.start();
// await node2.start();
const gsub1 = new Gossipsub(node1, options);
const gsub2 = new Gossipsub(node2, options);
await gsub1.start();
await gsub2.start();
gsub1.on('fruit', (data) => {
console.log(data)
done();
});
gsub1.subscribe('fruit');
gsub2.publish('fruit', new TextEncoder().encode('banana'))
}, 20e3);
async function createNodeExact() {
const transportKey = TCP.prototype[Symbol.toStringTag];
const defaultConfig = {
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0']
},
modules: {
transport: [TCP],
streamMuxer: [MPLEX],
connEncryption: [NOISE],
peerDiscovery: [MulticastDNS],
pubsub: Gossipsub
},
config: {
pubsub: {
emitSelf: true,
enabled: false
},
peerDiscovery: {
autoDial: true,
[MulticastDNS.tag]: {
interval: 1000,
enabled: true
}
},
transport: {
[transportKey]: {
filter: filters.all
}
}
}
};
return Libp2p.create(defaultConfig);
}
from js-libp2p-gossipsub.
Hey @jerradpatch
For your nodes to be able to properly exchange messages they need to be connected to a set of common peers (you can look into the spec: https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.0.md). If the peers are directly connected to each other, they will be able to to exchange pubsub messages without any problems, but if they are not they will need to have the minimum number of common connected peers to be able to exchange pubsub messages reliably. You can see the tests in https://github.com/ChainSafe/js-libp2p-gossipsub/blob/master/test/go-gossipsub.js for tests that create these connectivity scenarios, denseConnected and sparseConnect
from js-libp2p-gossipsub.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
from js-libp2p-gossipsub.
This issue or pull request has been automatically been closed due to inactivity.
from js-libp2p-gossipsub.
Related Issues (20)
- Missed Iwant messages from Lodestar to Nimbus HOT 2
- Export Metrics
- Unbundle metrics with 2 labels
- TypeError when setting direct peers in @chainsafe/libp2p-gossipsub with new libp2p peerStore structure HOT 1
- No recepient after message sent HOT 3
- Unregister protocol on gossipsub.stop
- Do not select backoff peers to graft HOT 1
- Track backoff times in connected peers
- No fanout peers HOT 2
- feat: Support WebRTC Browser-to-Browser HOT 7
- example doesn't work in the browser (insufficent peers) HOT 3
- vuln prototype pollution in dependency protobufjs HOT 2
- GossipSub treats Stream reset as Peer Disconnect HOT 2
- Metrics usage examples - browser client HOT 7
- Make `PublishError.InsufficientPeers` a bit more self-explanatory?
- 11.0.0 not working with bug : CodeError: logger not set HOT 1
- Memory leak in streamsOutbound HOT 2
- new found discovered peers not added to peers HOT 3
- Message delivery not working if publisher is sending message to early after connect
- Track publish time after messages are sent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-libp2p-gossipsub.