The DHT and bitswap serve different purposes:
- The DHT is used to find things (routing). That is, find peers with content, lookup the IP address of peers (map peer IDs to internet addresses), resolve IPNS records.
- Bitswap is used to actually retrieve content.
We don’t generally put “content” on the DHT as:
- Using the DHT is expensive. One generally has to establish multiple connections (expensive!) to new peers for every DHT request (as each DHT request will often be served by a different peer). Downloading a single file would likely take multiple requests.
- DHT nodes don’t get to choose what records serve. In general, we want nodes to choose what data they serve for legal/moral reasons. If we put content on the DHT, DHT nodes would end up serving arbitrary content instead of just routing information.
So, for example, when looking up a picture of your cat, a node will probably ask the DHT for any peers “providing” the picture of your cat (really, they’ll ask the DHT for any peers providing the root block in the set of blocks that make up the picture of your cat) and then they’ll bitswap with those peers to actually download the picture of your cat.
Is there a benefit (additional to bitswap sharing) to running a server for hosting DHT records then?
Yes. It helps others find content, peers, etc. faster and more reliably.
By the way, I’m intrigued about contributing where I can! I program Go so I’ll be looking for easy tickets as soon as I have a good understanding of whats going
That would be awesome! Take a look at the issues labeled “help wanted” for good places to start. Feel free to hit us up on IRC (#ipfs-dev on freenode) any time if you want to have any quick questions/want to have a more synchronous conversation.