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

Scattered Samples #486

Open
InteXX opened this issue Dec 7, 2021 · 10 comments
Open

Scattered Samples #486

InteXX opened this issue Dec 7, 2021 · 10 comments

Comments

@InteXX
Copy link

InteXX commented Dec 7, 2021

The code samples are scattered about in a confusing fashion.

I'd like to suggest consolidating them under a single folder.

@alanmcgovern
Copy link
Owner

Yup - that makes sense! I'll do a little reorganise later today.

Is there anything in particular you'd like to see a sample of which isn't in the sample client?

@alanmcgovern
Copy link
Owner

I moved everything under 'samples' so it's a bit clearer now! I deleted irrelevant ones and fixed up ones I wanted to keep :) Let me know if you have any other suggestions!

@InteXX
Copy link
Author

InteXX commented Dec 10, 2021

Pardon my delay, I've got a lot going on at the moment. Thank you for the reorg—that was a quick response.

Is there anything in particular you'd like to see a sample of

That's not an easy answer, at least from my perspective. I know next to nothing about BitTorrent, let alone how to use it.

But I do understand the basic underlying concept (P2P).

I'd like to investigate the possibility of using it to deploy updates for the software that I write, with the aim of reducing or even eliminating storage fees.

With that goal in mind, MonoTorrent seems like it might be a good place to start looking. Samples toward this end would be very helpful.

Are some already present that I should dig into?

@alanmcgovern
Copy link
Owner

I'd like to investigate the possibility of using it to deploy updates for the software that I write, with the aim of reducing or even eliminating storage fees.

Yup, that is one pretty reasonable usecase. As long as you control at least one client and leave it running/seeding 24x7 then BitTorrent is a viable option.

I suspect setting up a basic tracker ( or just rely in dht) and using magnet links would be the easiest approach.

On your "seeder" machine you can use a standard torrent application, or monotorrent, to share the data. You can share a torrent magnet link with the clients using whatever mechanism you want, which those clients can use to download the .torrent metadata as well as the data itself.

This way you just need to distribute a simple URL to your clients which need updates and everything else will Just Work (give or take).

Let me know if you have any questions!

The Client sample shows how to download torrents. The streaming example loads magnet links too.

@alanmcgovern alanmcgovern reopened this Dec 22, 2021
@alanmcgovern
Copy link
Owner

I'll leave this open until you're happy you have the information you need!

@InteXX
Copy link
Author

InteXX commented Dec 22, 2021

I'll leave this open until you're happy you have the information you need

Omigosh. Thank you... but that'll take months! This is very much a for-the-distant-future investigation.

But tell me—is there a way to meter the client bandwidth? I'd like to reward customers who opt in to participating in the hosting.

@alanmcgovern
Copy link
Owner

You could set a max upload/download speed using EngineSettings or TorrentSettings. This would artificially slow down uploads/downloads, bit would be unlikely to improve the experience for people in general.

If you want to do more than just that then it's hard to know what to recommend without knowing the full details of what you'd want. I'd say it's a little outside my scope, though I'd be curious anyway! :)

@InteXX
Copy link
Author

InteXX commented Dec 30, 2021

Well, not so much throttle as meter. Keep track of it.

I'd like to reward each customer according to his individual bandwidth contribution.

@alanmcgovern
Copy link
Owner

Torrent clients (including monotorrent) regularly report upload/download amounts to the tracker. If you host a tracker, you can monitor and track this data over time.

It's also possible to uniquely identify individuals by sending each of your users a modified version of the torrent metadata. The modification is to add a unique identifier to the announce url, like ?user=some_unique_token. Torrent clients will include that part of the query string when announcing to the tracker, providing a deterministic way to track your users stats over time.

Would that work? It's a technique used by most private trackers which track upload/download ratios.

@InteXX
Copy link
Author

InteXX commented Dec 30, 2021

That sounds absolutely perfect, Alan.

Good job on this!

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

No branches or pull requests

2 participants