-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated version #1
Comments
thanks @achingbrain have added that in and it works great. |
hey @achingbrain how do I setup this so that it announces so it can work from behind a NAT? (using defaults I only see it listening: Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/12D3KooWLAteDPP7d2UQcydBScYZeydNZ4irDwGUwDt3iWzzc6qB not advertising or using a public IP |
To establish connectivity behind NAT, there are a couple of options:
|
I've made some improvements to this example - there are a few things:
~/.jsipfs
which means they'll share a peer id, so instead ensure they have their own repos and as such their own peer identitiesNumber 3 is quite important - once the subscriber peer appears in the list it means peer discovery has completed, the publisher is connected to the subscriber and the topic list has been exchanged.
If the message is sent before all this has happened it's possible the subscriber will miss it as it's not part of the topic*.
* = If you have a large enough group of peers subscribed to the topic it's possible that the subscriber will still receive the message if it has a connection to another subscriber (transitive or direct) due to the gossip part of the gossipsub protocol, but if the publisher publishes a message without any peers it won't go anywhere. There is a gossipsub setting to cause publishing to zero peers to error out, this is currently disabled in js-ipfs but it should probably be enabled to make things a bit more transparent.
The text was updated successfully, but these errors were encountered: