Missing public multiaddresses in peerstore (docker)

This sounds like this issue Peerstore persistence.

I think:

  • The cluster peers are not aware of their external IP
  • Therefore they are not announcing it during identify()
  • Therefore it is not part of the peerstore of the other peer
  • Therefore it is not saved on shutdown.

The thing is Identify() will only start advertising one of those addresses when it has seen at least 4 connections in the last hour (which is the signal that such address is actually a public one). Of course, the thousands of nodes in the ipfs network trigger such condition pretty easily and your ipfs nodes show the public IP, but having only 2 cluster peers this never happens.

I’ll open an issue to reduce the threshold. The workaround is to write your public addresses manually in the peerstore for the moment. If they change, I recommend using /dns4//… form if possible.