Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
30 stars 8 forks source link

Avoid connecting to same IP #262

Open Sword-Smith opened 1 day ago

Sword-Smith commented 1 day ago

Currently, we only check for duplicated connections by considering socket (IP + port + protocol (IPv4 vs IPv6)) and instance ID. We should, furthermore, also avoid making multiple connections to the same IP.

Sword-Smith commented 18 hours ago

However, this could prevent users from running multiple nodes from the same NAT'ed IPv4. Maybe this is a bad idea? Do you have a pronounced opinion, @dan-da?

Sword-Smith commented 17 hours ago

I decided to implement peer discovery such that new IPs are favored, but if there are no other options, we connect to peers with repeated nodes.

dan-da commented 9 hours ago

However, this could prevent users from running multiple nodes from the same NAT'ed IPv4. Maybe this is a bad idea? Do you have a pronounced opinion, @dan-da?

there are many reasons why a user might want to run nodes on the same machine. Many of those involve dev/testing/simulation, etc. Even a non-developer may want to run a local net for practicing payment flows before sending to the real network, for learning/teaching, or for their own reasons.

In short, whatever we implement, there should be config option(s) that allow for such scenarios. I don't have a strong opinion about the default of such setting(s).