I have two node. One have a public ip and I call it public node. The other is behind a nat device and is called private node.
The two nodes have the same config file: dht mode is set ModeAuto, AutoRelay and Relay is set true.
When I use dht.findpeer to find the peer addr of the public node, it usually returns quickly with the correct address.
But when I want to find the peer addr of the private node, it use a long time and returns “routing: not found error”. To confirm relay is working, I print addr on the private node.
That says relay is working on the private node.
Problem also happened when I set the public node’s listenAddr to “127.0.0.1:4005”
So, I have 2 questions:
why they have different behavior? As far as I know, peer addr is queried through dht and nodes without a pubic ip can also join dht. But why they can’t be find?
why listenAddr can also affect the result?