Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

IPFS PubSub is woking incorrectly. #1132

Closed
downitch opened this issue Dec 6, 2017 · 11 comments
Closed

IPFS PubSub is woking incorrectly. #1132

downitch opened this issue Dec 6, 2017 · 11 comments
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) kind/support A question or request for support P2 Medium: Good to have, but can wait until someone steps up

Comments

@downitch
Copy link

downitch commented Dec 6, 2017

Hello folks!

I am developing an application, which is using IPFS to store database and as far as I know, there is only one way to inform users about changes inside IPFS – PubSub. I am using it to connect all the users to one channel, so I can broadcast messages to them.
The problem I discovered is:
I have two laptops connected to the same network, but I am unable to find each other in peer list. Am I doing something wrong? Maybe I am understanding the idea of PubSub wrong?
I am using go-ipfs and js-ipfs(0.27.0), but none of them is working for me.

@AdamStone
Copy link

Not working for me either. I just tried subscribing to a common topic between two tabs and I'm not seeing any peers in ipfs.pubsub.peers or receiving any messages published by either window.

@downitch
Copy link
Author

downitch commented Dec 7, 2017

good to know, that I am not alone with this problem. Hope the solution is about to come..

@daviddias
Copy link
Member

daviddias commented Dec 7, 2017

Did you check if your peers are connected? Which transports are you using?

@downitch
Copy link
Author

downitch commented Dec 8, 2017

Hi @diasdavid! I check my connection using
swarm peers
It says that I can see peers, after that I also use
pubsub peers
This command also shows me the list of peers connected to the same pubsub channel.
I even tried to use
ping
And it actually brings more peers to pubsub.
After pinging circa 4-6 peers I raised my list from 8 to 22, which means that it is important to ping others, but even by doing this, by pinging same peers from both laptops I still didn't achieve to connect them.

@richardschneider
Copy link
Contributor

@rmnoff Could issue #1136 help you?

@AdamStone
Copy link

AdamStone commented Dec 9, 2017

I'm using create-react-app with js-ipfs in node_modules linked to a clone of the latest master. I see 8 peers under both swarm and pubsub in both windows, but neither window is a peer of the other. Is it necessary at this stage that the two windows be mutual peers for pubsub messages to be seen? I am able to add files from one window and cat them from the other. If I inspect ipsf._libp2pNode.modules.transport I see WebSockets, WebRTCStar, WebsocketStar. However peerInfo has no multiaddrs. I'm just using default configuration, the only param passed into new IPFS is {EXPERIMENTAL: { pubsub: true }}, as in the example of ipfs-pubsub-room.

@pgte
Copy link
Contributor

pgte commented Dec 9, 2017 via email

@AdamStone
Copy link

Hm, I had made a point to use different repo paths for each window when I started trying this and it wasn't working, but at some point I removed the repo path when trying different configurations, restored it and now it works. Still not sure why it wasn't working initially, maybe just because I had been in a branch that didn't have the latest code.

@daviddias
Copy link
Member

Just released js-ipfs 0.27.3 that includes the bug fix by @richardschneider and also ships a new dist version. Can you try it and let me know if it works well for you?

@downitch
Copy link
Author

@diasdavid hello! I've upgraded my js-ipfs version and now it works great for situations, when I am having two devices connected to the same network, but when it comes to communication between two devices working in different networks, being in distance, it comes to the situation, where both devices are able to see peers in PubSub (some of them are same), but they are still unable to see each other. It happens with go-ipfs also.
Hope it will help to solve the issue :)

@daviddias daviddias added status/ready Ready to be worked kind/bug A bug in existing code (including security flaws) kind/support A question or request for support exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up labels Jan 25, 2018
@daviddias
Copy link
Member

Still haven't been able to reproduce this problem. Given that it is stated that the problem happens with js-ipfs and go-ipfs, I'm going to guess that it is something with the setup rather then the code.

I'm closing given that this has been stale for a while, but if you happen to create an effective repro case, let us know :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) kind/support A question or request for support P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

5 participants