-
Notifications
You must be signed in to change notification settings - Fork 1
Description
If I understand correctly (I've been out of the hypercore community for a bit), the new DHT is used for both NAT traversal via hole punching as well as advertising and discovering peers. Combining these two into the same protocol/service was a brilliant move!
But there are some trade-offs in the decentralized nature of a DHT that are not desirable for all use cases. In particular, I have use cases where I'd love to use the other parts of the ecosystem (P2P hosting, P2P sockets, content addressed content, etc), but need faster performance and am willing to centralize part of the system to achieve this goal.
My proposal is to add a discovery/connection protocol that's similar to the DHT, except the address of a public server is part of the address (tracker address + public key instead of just public key). The tracker will know the current location of peers with the advertised content and be able to connect me quickly.
Also, some trackers can optionally act as a cloud cache of the data itself to speed up the process even more.
This is the workflow I imagine for publishing data.
- Create a local hypercore
- Connect to a tracker with optional authentication and advertise the new hypercore.
2a. If the tracker is also configured as a data cache, it starts syncing and storing data. - Share a url that contains both the tracker's address as well as the normal public key.
Then the flow for reading this data:
- Get the address + public key from a link or something.
- Connect to the tracker asking for peers
- The tracker connects you with the advertised peer(s).
3a. If configured as a storage peer, it can also provide data directly.
I'm not sure exactly what would need changing in the protocol to allow this, but I do think that making it a clearly defined protocol could encourage commercial offerings of such trackers. It would probably be good if the tracker protocol allowed extensions for other value providing services or blockchain integration or whatever the provider wanted to integrate.