I'm working on a simple project to get to know how to use DHT. Here it is: https://github.com/ashish10677/dht-implementation
This project simply runs a libp2p node and and publishes it's peer id. Other machines can run the same program using the peer id provided by the first node to connect to it.
So, basically the scenario is something like this: Suppose we have 3 machines. #Mach1 is my personal macbook air (m1), #Mach2 is a GCP VM and #Mach3 is also a GCP VM.
If I start the program in #Mach2 by providing it's public IP and port, it gives out a peer info to connect to. Using that info #Mach1 and #Mach3 are able to connect and since it is DHT, all nodes are connected to each other.
Now, if I repeat the same process but start with #Mach1, then the other two machines (which are VMs) #Mach2 and Mach3 are not able to connect to each other. I get an error:
What I can conclude is there is some issue while running a DHT server on a macbook. I have enabled port forwarding on my router but still the error persists, whereas VMs are able to connect to each other very easily. Can someone help me in resolving this issue?
Looks like the port forwarding is not working correctly. You'd need to check what's going on wrong on your router, or alternatively use hole punching to traverse the NAT.
I'm working on a simple project to get to know how to use DHT. Here it is: https://github.com/ashish10677/dht-implementation This project simply runs a libp2p node and and publishes it's peer id. Other machines can run the same program using the peer id provided by the first node to connect to it.
So, basically the scenario is something like this: Suppose we have 3 machines. #Mach1 is my personal macbook air (m1), #Mach2 is a GCP VM and #Mach3 is also a GCP VM.
If I start the program in #Mach2 by providing it's public IP and port, it gives out a peer info to connect to. Using that info #Mach1 and #Mach3 are able to connect and since it is DHT, all nodes are connected to each other.
Now, if I repeat the same process but start with #Mach1, then the other two machines (which are VMs) #Mach2 and Mach3 are not able to connect to each other. I get an error:
What I can conclude is there is some issue while running a DHT server on a macbook. I have enabled port forwarding on my router but still the error persists, whereas VMs are able to connect to each other very easily. Can someone help me in resolving this issue?
Version Information