dat-node icon indicating copy to clipboard operation
dat-node copied to clipboard

"ratio limit" for users with restricted upload bandwidth

Open bradwbradw opened this issue 4 years ago • 3 comments

I am reporting:

  • [ ] a bug or unexpected behavior
  • [ ] general feedback
  • [x] feature request
  • [ ] security issue

For a user with high upload bandwidth costs, if they are creating a large file (for example, an hour long piece of audio) it would be nice if it was possible to set a ratio limit, kind of like in a bittorrent client. I see here (https://github.com/datproject/dat-node#network-options) that you can set upload to true or false, but maybe it makes sense if the library could accept another option ratio-limit that stops uploading once the data uploaded becomes 100% (or whatever the value is). This way, the user doesn't incur upload bandwidth costs and other peers take over the burden of serving the file once the entirety is available in the swarm.

bradwbradw avatar Sep 04 '19 20:09 bradwbradw

Good idea. I think we'll need to implement a nicer API for detecting progress first.

I think this will be complicated by the "latest" flag being set where we'd need to figure out which chunks of the latest files are uploaded where.

Do you think you'd be interested in devoting some time to figuring this out?

RangerMauve avatar Sep 04 '19 21:09 RangerMauve

Hey @RangerMauve , I could potentially dip my toe in to start with, but i'd need more back and forth to get enough direction in order to make real progress. I've proposed dat architecure for a possible community radio project. If we decide to go the P2P route there would be more drive to have this feature working.

bradwbradw avatar Sep 04 '19 21:09 bradwbradw

I'd be more than happy to work through it with you. 💜😁

A good starting point would be to read up on how dat works to get a feel for the low level parts and the filesystem.

From there, it'd be good to read up on the replication logic to see how we interact with peers.

From there we'll need to look into how we can use the data we get from peers to relate to upload ratio.

RangerMauve avatar Sep 04 '19 21:09 RangerMauve