1

I'm new to the BitTorrent protocols, so please be gentle.

From what I understand, torrents are supposed to announce to the DHT every 15 minutes, and by default, this is what libtorrent does. But what if I don't get any peers after the very first announcement? Do I have to wait 15 minutes till libtorrent gets its next chance to get a list of peers?

To avoid having to wait, I configured libtorrent to announce to the DHT every 3 seconds using:

session.set_settings({'dht_announce_interval': 3})

With this method, I successfully obtained a list of peers within 10 seconds. Is this the proper way to get peers quickly? If not, what's the proper way to get peers quickly from the DHT? Is this abuse?

Flux
  • 9,805
  • 5
  • 46
  • 92

1 Answers1

1

Once you have your first batch of peers from the DHT or a tracker a secondary peer source called peer exchange (PEX) will kick in and will provide a frequently updated view available peers. This makes it unnecessary to set a low interval on the primary sources.

the8472
  • 40,999
  • 5
  • 70
  • 122
  • So I should only announce regularly (e.g. every 3 seconds) until I get my first set of peers, then afterwards, I can set a longer interval (e.g. 900 seconds). Right? – Flux Jan 16 '20 at 22:43
  • no, you should wait for the DHT instance to be fully initialized, perform an initial announce and then just announce at a long interval. there's no need for the 3 second spam at all. the lookup takes a few seconds and so does connecting to the sets of peers that you received from the initial lookup – the8472 Jan 18 '20 at 11:54