commit a5870f64086f90bd344582db1631a2d7b62adf73 Author: Vincent Batts Date: Mon Oct 1 05:19:33 2018 -0400 initial commit Signed-off-by: Vincent Batts diff --git a/README.md b/README.md new file mode 100644 index 0000000..c475d7f --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# p2p-pastebin + +An idea for easy and instant sharing of files. + + +## Overview + +bittorrent is an established protocol and there are public infrastructure +available that can be leveraged. + +Even though much of the torrent world tends to be long-living and eventually +stale content. This idea would be more for one-time, short lived content. The +`*.torrent` file is never even shared, only the magnet URI. + +Ideally this could be a native binary to wrap the whole process. +Until then, most of this workflow should be possible with `transmission-cli` utilities. + +Like: +```shell +# get today's best trackers +curl https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt + +# make the *.torrent +transmission-create -o dir.torrent -c "this is a test for creating magnets" -t "udp://62.138.0.158:6969/announce" -t "udp://185.225.17.100:1337/announce" -t "udp://51.15.4.13:1337/announce" dir/ + +# get the magnet URI to share +transmission-show -m ./dir.torrent + +# start seeding the data +transmission-cli -er -w . ./dir.torrent +``` + +Then from the other host: +```shell +transmission-cli -w . "magnet:?xt=urn:btih:5c2a54edd30dbe87765dcc85a0e5b4f6f2e8780b&dn=dir&tr=udp%3A%2F%2F62.138.0.158%3A6969%2Fannounce&tr=udp%3A%2F%2F185.225.17.100%3A1337%2Fannounce&tr=udp%3A%2F%2F51.15.4.13%3A1337%2Fannounce" +``` + +## signalling all-done + +Only particularly tricky aspect is how to signal from all the clients that have +been shared the magnet, that they are done. Or further, to expire the shared +data. One of the primitives forced by the bittorrent protocol is that the data +is effectively permenantly available as long as someone is still sharing it +(seeding). + +## libraries +There are some good client libraries in golang that cover much, but lack the +building of the torrent and then producing the magnet URI. Like +[`github.com/anacrolix/torrent`](https://github.com/anacrolix/torrent) +[[godoc]](https://godoc.org/github.com/anacrolix/torrent) has everything to +recieve the magnet string and start downloading the shared data. + +## Reference + +* [automated list of trackers](https://github.com/ngosang/trackerslist) +* [golang torrent tracker implementation](https://github.com/crosbymichael/tracker) that has bencode logic too? +* [golang client library](https://github.com/anacrolix/torrent)