0.49.1
Chrome (most likely more):
PubSub
ipfs id and repo unique on browserwindow1
connect to remote webrtc-star (my own) on :80 from browserwindow1
let ipfsEmptyConfig = {
repo: 'anon-repo-'+uuidv4(),
config: {
Addresses: {
Swarm: [ "/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star" ]
API: '',
Gateway: ''
},
EXPERIMENTAL: {
pubsub: true
}
}};
let node = await ipfs.create(ipfsEmptyConfig);
first browser gets 10 swarm peers
after peers are connected subscribe to topic
wait 5 seconds to 15 minutes...
ipfs id and repo unique on browserwindow2
connect to remote webrtc-star (my own) on :80 from browserwindow2
second browser gets 11 swarm peers (10+browserwindow1)
after peers are connected subscribe to same topic as browserwindow1
node.swarm.peers() includes browserwindow1 that is subscribed to the same topic but node.pubsub.peers() ends up empty.
Logically messages are not seen by the other party, but messages sent from the same tab are received in the pubsub subscription on that tab as new message, the windows/tabs stay disconnected.
When stay connected and subscribe and try 2 minutes later, they are still swarm peers but not pubsub peers.
It's wild because I tested what I thought worked like this a few weeks ago and the instances had no problem finding each other. Is there possibly a limitation to the length of a topic name? or special characters? mine can be 128 characters+ and include "-" and hex.
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
Finally, remember to use https://discuss.ipfs.io if you just need general support.
There's no practical limit on topic name length or content AFAIK - could you post a more complete example please? Specifically how you are setting up the pubsub subscription & sending/receiving messages?
It's fairly simple, really. The subscription is done according to the manual, I wait until the swarm peers are connected and then:
node.pubsub.subscribe("test-----topic", async(message) => {
console.log('New message!',message);
});
^^ This actually catches my own messages (as I would expect to receive messages from other peers as well) in the same window/tab sent from:
node.pubsub.publish("test-----topic", msgData);
And if I do node.pubsub.ls() I get the topic(s) I'm subscribed to on both windows/tabs/machines.
But node.pubsub.peers() keeps giving me an empty array even though window2 can see window1 as swarm peer.
No errors, just no pubsub peers.
An example for an actual topic name would be:
lounge-----7b22637276223a22502d353231222c22657874223a747275652c226b65795f6f7073223a5b22766572696679225d2c226b7479223a224543222c2278223a224141327378696b6e42323076444b735f53764b527961656438556f545a4a4846333161595f495164386a3544306f4b2d716a7654707a5f38474a51715f4a7355387a5f30455f5972546274624a757a5562533143366f6576222c2279223a22416539357373547a537933424f76736a4471545473316c586f4b4a33347451324d4147466c7075534b4e467834446d73723343325952706937777256615f504679736565573331783152475965656b706976644d6f4f6363227d-----30820222300d06092a864886f70d01010105000382020f003082020a0282020100bd0465a51c61fc4cf67d008da33758ee48c46ff059b6eedc010d8100fcb92abf2c2b2ebeaaac034b06ffb6637a65859c247f73c0dad6bdaacb2d3a31bad577e368686d7c94862472367dfdccc59d80582fccb361eb7e6292f7413cc3c4ca95b576ccb5d5b5a88dfe55e7e2d39b0553c59ff1af7ede07f58286f0c6ab37fd4a6218511a8fe550d6da59fbe6e597ca51392c8c92a9dffdc05a657165a4b765cc6fa7d230a70683244edde1405ab87ad0940a79775e13b5cc8aec75694a2bec25b0a25161dbf734d1ebaa17350062230485d964a51dcbba0d7317875056e96d2120167f68a36224471318e1c15cf243f216184a5ab5d93d734f79de6967ca9f63fc85aa723db42467dc7bf6c4d24ca75577b83cbdd83145f376e3ac7f5c45851d7d37b2c9dcaa09aa91c359ad87c304105fc5277fb1f920d1e5f90ea27cdf973b57d175bf24628f4bb39fb8077c5dbffc8b7d72e9b7c4a99233bb3b227146cb003ee29c361fff0ecd06bdb4a686ac09b8756084b96100c89eac86f05e2ec43bd9d7b5b01af544b2f711bd188392724fe2401b171eebb8812ca7ad514e142651e6778ca024c8778ceb915006ccd8685ae696894d67368f7c04ef804019258a1bbe73014c5003edbc4e05e8f8ba8d1a61083f250d612558adb5bede3d38999d752b0fbeb0ba6598562ee15cb594f6409b4272351f7d1f41e92ef647bb67983fe4279f0203010001-----rep
So for now I just opted to downgrade to ^0.46 because it works with that version without any changes. Would be great to get some feedback on when this will be fixed! =)
I could not replicate this so far. @StationedInTheField do you have any code that I can test/debug available? If you could provide me a small code example that I could install and run in both browsers would be super helpful. Or a branch in ngx-electron with instructions to test if?
Another thing I noticed, are you doing node.pubsub.peers() or node.pubsub.peers(topic)?
With the topic of course.
Give me two days, then I'll have finished 0.9.1 (a very light and the first actually usable version, the prior versions didn't allow custom channel trees, of my messenger)
It works in the browser, so that's probably the best way to see where it's failing, probably easiest to just import that into stackblitz from the repo then. All it takes to break it is to change the ipfs version in the package.json from 0.46.1 to a later one.
@StationedInTheField sure, let me know when it is ready!
@vasco-santos I just released it: https://github.com/QuestNetwork/quest-messenger-js
Unfortunately I couldn't get any gateways to pin it, so it's only available as a live demo from: https://35.208.30.22/ipfs/QmYDKkaCtwAG1obMezLS1RgNmke5CxjrtdRU4fdpgzMuP4/
I cannot access the demo link. I am installing from github to try it locally now.
Can you just point me where is the pubsub related code and the flows that I should do in the web app once I start it?
I suspect that you had some version issue when you opened this issue thanks to the package-lock. Perhaps libp2p-pubsub version was not in line with what it should be 馃 I tried to understand how to test using your project locally, but I could not do it without instructions.
I just pushed the example I tried out last week: https://github.com/vasco-santos/ipfs-browser-pubsub-example
I tried with 0.49.1 and also with the newest release 0.50.0 (with the new gossipsub 1.1) and everything seems to work (I used your topic example). Can you try my example / retry this in your project cleaning the package-locl
It's propagated now and available at: https://gateway.pinata.cloud/ipfs/QmYDKkaCtwAG1obMezLS1RgNmke5CxjrtdRU4fdpgzMuP4/
(works on Android phones too, just a little slow to create channels)
I tried my project on a fresh Ubuntu machine and building worked without issues, I gave instructions in https://github.com/QuestNetwork/quest-messenger-js#development - npm run inst removes the package-lock.json
pubsub is located at https://github.com/QuestNetwork/quest-pubsub-js and the package.json in the messenger points at the npm package
I will try your example
Yep using your example I was able to update the current development branch (0.9.2) to 0.50.1, it works fine and peers with other messengers running 0.9.1 with version 0.46.1 of ipfs
Thanks!
No problem, happy to help. Is it possible if you test 0.49.1 again?
I just want to guarantee we don't have any issue in that version as we still have users in that version
Works! Don't hesitate to point people in my direction who might be interested in helping me build the Matrix equivalent for IPFS with lots of advanced features (I have a background in image recognition and neural language processing and among other things I'm planning to add native suggestions to the messenger)
Thanks again!
Don't hesitate to point people in my direction who might be interested in helping me build the Matrix equivalent for IPFS with lots of advanced features (I have a background in image recognition and neural language processing and among other things I'm planning to add native suggestions to the messenger)
Got it 馃憣
Works!
Closing this issue as the issue is solved 馃槃