Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BEP 14: LSD / local peer discovery #248

Open
djkazic opened this issue Apr 19, 2018 · 19 comments
Open

Implement BEP 14: LSD / local peer discovery #248

djkazic opened this issue Apr 19, 2018 · 19 comments

Comments

@djkazic
Copy link

djkazic commented Apr 19, 2018

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

@elgatito
Copy link
Contributor

@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?!

@djkazic
Copy link
Author

djkazic commented Apr 20, 2018

@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.

@elgatito
Copy link
Contributor

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

@anacrolix
Copy link
Owner

Yes, please post a PR.

@pataquets
Copy link
Contributor

@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.

@anacrolix
Copy link
Owner

Note that this is BEP 14 per #329 (comment).

@anacrolix anacrolix changed the title LSD / local peer discovery Implement BEP 14: LSD / local peer discovery Aug 22, 2019
@anacrolix
Copy link
Owner

Any update @djkazic ?

@pataquets
Copy link
Contributor

pataquets commented Mar 28, 2020

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

@dd4e
Copy link

dd4e commented Apr 4, 2020

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.

@anacrolix
Copy link
Owner

@dd4e I can assist with the integration.

@dd4e
Copy link

dd4e commented May 10, 2020

@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

@anacrolix
Copy link
Owner

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.

@MetalRex101
Copy link

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

@anacrolix
Copy link
Owner

@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.

@pataquets
Copy link
Contributor

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

@anacrolix
Copy link
Owner

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.

@VuzzyM
Copy link

VuzzyM commented Aug 14, 2021

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

@anacrolix
Copy link
Owner

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

@pataquets
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants