-
Notifications
You must be signed in to change notification settings - Fork 16
pubsub between docker containers does not work #58
Comments
I think this is because the containers respond to an MDNS query from each other with addresses that include That is, if I manually filter out all loopback addresses from this list of multiaddrs when |
I guess it's not verifying the remote peer id after connection, which probably explains why using |
A workaround for this is to configure unique swarm ports for every IPFS instance under the Docker daemon. E.g. Container A uses:
Container B uses:
..etc. Doesn't scale very well, obviously. |
@achingbrain I believe I know the issue. Can you do a test: run If only localhost/local interfaces appear, than it is normal that connection can't be established given that the IP packets will be routed to the instance itself. You should have the equivalent of a different IP pair |
I think libp2p/js-libp2p#202 (comment) would help resolve/prevent this issue. This would enable us to more easily avoid announcing local addresses, so we don't accidentally dial ourself, and prevent the need to manually set the address. |
If you run the example you'll have two containers - Here echo_1 | My peer id QmQXnULD5usLVTsgnCYGCRqtbVcsJBEWcjY7voPpt8nBdT
echo_2 | My peer id QmNTneAkkct2PMzJR73gARRPtKjVsBZEHa3wBkX6xCCo5h
echo_1 | Topic peers:
echo_1 | None
echo_1 | Swarm peers:
echo_1 | ...
echo_1 | QmNTneAkkct2PMzJR73gARRPtKjVsBZEHa3wBkX6xCCo5h
echo_1 | Swarm addrs:
echo_1 | ...
echo_1 | QmNTneAkkct2PMzJR73gARRPtKjVsBZEHa3wBkX6xCCo5h
echo_1 | /ip4/127.0.0.1/tcp/4002
echo_1 | /ip4/172.27.0.3/tcp/4002 So |
Closing due to staleness |
I've created a repo that demos the problem: https://github.com/achingbrain/docker-ipfs-pubsub
When run with docker-compose as per the instructions in the README, two containers are created that connect to each other as swarm peers, subscribe to the same topic and start sending messages, but do not see each other in the topic peer list, nor do they receive the messages sent by the other.
Any ideas?
The text was updated successfully, but these errors were encountered: