Open vuori opened 6 years ago
Beaker doesn't make use of the bittorrent-dht and there are plans of migrating to a new implementation.
DNS-discovery is actually the more important discovery-related module to modify since it's being used more heavily. I think there's not too much to be changed there, instead of only using A
records, you'll need to add support for AAAA
records for IPv6.
If I understand the workings of the DNS discovery system correctly, it relies on the server recording the transmitting IP of the host that 's announcing a service. That would require communicating with the datprotocol.com
DNS servers over IPv6, but none of them have AAAA records. So it looks like the infrastructure would need to be fixed first before client-side changes can go anywhere?
@vuori that's correct, but less daunting than it sounds. We'd just need to update the dns-discovery module to support ipv6. @mafintosh can deploy the new server relatively quickly
@vuori , how Dat could support i2p?
I'm not familiar with i2p. If you mean IPv6, it turned out that the rabbit hole went a bit too deep for a weekend project, so the issue has been on the shelf.
@vuori I'm going to be doing some stability work on hyperswarm, I'll see if I can put in IPv6 support in my spare time.
@RangerMauve how Dat could support Tor or i2p?
@DaniellMesquita Dat can work across any transport. What you'd need to do is find some sort of peer discovery mechanism for Tor or i2p (Maybe a DHT exists for this?), open a connection to a peer, and use hyperdrive.replicate()
to create a replication stream and pipe it into the peer.
I was trying out Dat and noticed that IPv6 is not used to reach peers. This pretty seriously limits its usefulness for me, so I looked around the internals a bit. On a high level, I think the following changes would be needed in
discovery-swarm
to fix this:bittorrent-dht
for IPv4 and IPv6 on each socket (technically these could be merged, but makes the implementation a lot more complex for relatively little benefit).discovery-channel
and up). It seems that this would happen pretty much automagically due to the event architecture.On the lower levels, looks like this needs:
utp-native
. Seems like a minor change,libutp
already has support so just needs selecting the rightlibuv
functions based on the input address.bittorrent-dht
and thek-rpc
modules. A bit of work, but BEP-32 is pretty simple, and with DHT instances handling a single socket this shouldn't cause any major restructuring.dns-discovery
: no idea, not going to go there for now, would continue using the current (IPv4) socket as before.I may have some time to work on this in the near future. Does the approach sound reasonable?