py-ipv8
py-ipv8 copied to clipboard
Document DHTCommunity
The DHTCommunity
(and its subclass the DHTDiscoveryCommunity
) have very useful functionality to store data and to connect to peers based on their public key. This functionality allows IPv8 to serve as both a distributed file system and allows programmers to both create neighborhood persistence and superpeer networks.
We may want to leave IPv8-as-a-file-system functionality out of the documentation to avoid competing with Tribler's solution. However, it would be useful to give an example of storing known peers on custom Community.unload()
and attempting to reconnect when initializing (i.e., neighborhood persistence). This one example would also cover "find-your-friend"/superpeer functionality.
This tutorial could build off of the Network
snapshotting used in the TriblerTunnelCommunity
(see https://github.com/Tribler/tribler/blob/76ed927339a73d7b3c8464e8a4b43cf8a520e2d2/src/tribler/core/components/tunnel/community/tunnel_community.py#L134-L161).