torrent icon indicating copy to clipboard operation
torrent copied to clipboard

Implement BEP 14: LSD / local peer discovery

Open djkazic opened this issue 6 years ago • 19 comments

I have an implementation for the UDP multicast message sending. Would you consider a PR to merge it?

djkazic avatar Apr 19 '18 19:04 djkazic

@djkazic definitely create a PR. If the code is fine (and if not - you can change it in scope of a PR, until it gets better and ready to be merged) then why not?!

elgatito avatar Apr 20 '18 06:04 elgatito

@elgatito well, while it does work, it doesn't technically adhere very closely to the BEP. Mainly, that the advertisement rate is well above the recommended rate (1 per minute at most versus my 30 second poll time). This is due to the structure of this library in terms of how peers are added, and I'm not sure it would be acceptable for that reason.

It's kind of dirty to do a loop like this anyway. I wanted to also see if anyone had thought about working on this and could help me come up with a better overall solution.

djkazic avatar Apr 20 '18 12:04 djkazic

@djkazic you should start a PR to get a code review and, maybe, some help.

elgatito avatar Apr 20 '18 13:04 elgatito

Yes, please post a PR.

anacrolix avatar Apr 21 '18 01:04 anacrolix

@djkazic: Thanks for the work! I +1 what's said above. Even if the code is not perfect as it is now, posting it already adds a lot of value. Reviews will come in for sure. And even if you don't have time to polish it yourself, others can move the issue forward, so it ends up merged. Please, post whatever you have to set the ball rolling.

pataquets avatar Jan 21 '19 03:01 pataquets

Note that this is BEP 14 per https://github.com/anacrolix/torrent/issues/329#issuecomment-523795879.

anacrolix avatar Aug 22 '19 09:08 anacrolix

Any update @djkazic ?

anacrolix avatar Aug 22 '19 10:08 anacrolix

@djkazic friendly ping We'd love to have the code as is now :smile: It would be a pity that it might end lost

pataquets avatar Mar 28 '20 22:03 pataquets

Hello everyone! I want help with LSD. I understood lsd proto and I can write lsd module. But, I think, I need help with integration it to torrent library.

dd4e avatar Apr 04 '20 11:04 dd4e

@dd4e I can assist with the integration.

anacrolix avatar Apr 23 '20 04:04 anacrolix

@dd4e I can assist with the integration.

I want to agree on implementation. The main task of LSD is to send and receive infohash (ihash) value. BEP14

I see the implementation in the form of a package with the transfer and receipt of ihash via channels. Channels are passed as parameters when the structure is initialized. The Start and Stop methods start and stop the announcement.

I have some questions:

  1. Is there a data type to store ihash or use a string (or array)?
  2. Are there any comments on the implementation?

Update: also need a host and port to identify the peer

dd4e avatar May 10 '20 15:05 dd4e

I see the implementation in the form of a package with the transfer and receipt of ihash via channels. Channels are passed as parameters when the structure is initialized. The Start and Stop methods start and stop the announcement.

I think exposing channels are an anti-pattern in Go. A synchronous method to retrieve the next announce, or a callback should be fine.

  1. Is there a data type to store ihash or use a string (or array)?

https://pkg.go.dev/github.com/anacrolix/torrent#InfoHash

Update: also need a host and port to identify the peer

Do you mean the local Client? You can use any/all of the https://pkg.go.dev/github.com/anacrolix/torrent#Client.ListenAddrs.

anacrolix avatar Nov 12 '20 01:11 anacrolix

Guys, any chance LPD will be available for this library?

MetalRex101 avatar Nov 17 '20 10:11 MetalRex101

@MetalRex101 I'm hoping for a community contribution on this, as I won't use it myself. @dd4e @djkazic can you advise on the status of your implementation(s), if any? Thanks.

anacrolix avatar Nov 18 '20 00:11 anacrolix

For reference, axet/libtorrent (which happens to use this lib) already implements this. See lpd.go.

pataquets avatar May 09 '21 14:05 pataquets

That implementation looks pretty reasonable, and is appropriately detached from the torrent package. It would be a candidate for being upstreamed if there's any interest.

anacrolix avatar May 10 '21 01:05 anacrolix

@anacrolix It's been 3 years, maybe it's time for an update?

VuzzyM avatar Aug 14 '21 07:08 VuzzyM

@VuzzyM everything to know is visible from this issue. 3rd party contributions appear to be stalled.

anacrolix avatar Aug 14 '21 09:08 anacrolix

For the record, I filed an issue a month ago in @axet's repo on GitLab if anyone wants to track it. Although no obligation, obviously, neither on him nor @anacrolix (as he already stated a few comments above).

pataquets avatar Aug 14 '21 10:08 pataquets