• by sarp on 10/19/2023, 3:17:38 PM

    Hi! Sarp here, author of the Build your own BitTorrent challenge on Codecrafters.

    Some back story: After being laid off from my FAANG job, I found myself very unmotivated to go back. I started looking for interesting programming projects to revive my interest in coding. While nomading, I discovered Codecrafters on Nomadlist and really liked the push code to git and pass different stages interaction. The gamification helped me focus and projects allowed me to go deeper on software I used (SQLite, Git, Redis etc.). I even picked up a new language (Go) to do the challenges with. After completing all the challenges on the site, I ran out of things to do. This is when I decided to build a BitTorrent client which was one of the highly voted ideas on the site.

    I learned many new things by building a BitTorrent client: the BitTorrent protocol, how torrent files are structured, encoding issues, pipelining network requests, url encoding binary values, using Channels in Go etc.

    I’d love any feedback on the challenge. Also happy to answer any questions!

  • by mr-karan on 10/19/2023, 11:45:55 AM

    Jon Gjengset[1] is currently doing a livestream on the same challenge in Rust, on his YT channel[2].

    [1]: https://thesquareplanet.com/

    [2]: https://www.youtube.com/watch?v=jSTkEPPiULs

  • by throwaway4aday on 10/19/2023, 1:58:23 PM

    what's with the sign in required, is this a paid tutorial?

    Here are some free tutorials:

    JS - https://allenkim67.github.io/programming/2016/05/04/how-to-m...

    GO - https://blog.jse.li/posts/torrent/

    Python - https://markuseliasson.se/article/bittorrent-in-python/

  • by sunbum on 10/19/2023, 11:27:00 AM

    Why in the world does this want access to my github account, with 0 explanation as to why.

  • by the8472 on 10/19/2023, 12:32:41 PM

    Oddly the uploading part is missing. To be a peer, an equal, things have to flow both ways. Bittorrent wouldn't work otherwise.

  • by r3trohack3r on 10/19/2023, 5:04:27 PM

    For folks who speak JavaScript, Feross built WebTorrent which brought the protocol into a browser tab.

    The code base is delightful to read. A lot of developers are better at writing code than they are reading it. If you're wanting to flex your code-reading muscles, I haven't found many better places to start than the WebTorrent codebase. I put it up there with redis in being fun to read.

    https://github.com/webtorrent/webtorrent

  • by ikornaselur on 10/19/2023, 12:58:13 PM

    I really like this idea! I wanted to leant Erlang some time ago and a friend wanted to learn Crystal, so we set out to be able to share files between each other with completely custom clients! It was so much fun when we were able to exchange files with the base protocol and some.. Is it call BEP? Enhancements tk the protocol?

    It's probably my favourite way of learning a new language, as it's simple enough to understand and implement

  • by dizzydes on 10/19/2023, 11:42:02 AM

    As the years go on, I find there are fewer and fewer small project ideas that give me butterflies. But this is one!

    Hadn't heard of CodeCrafters before but I love how academic their challenge ideas are (eg build a DB). I'd love to see a compiler build in there too.

  • by techn00 on 10/19/2023, 11:52:09 AM

    Reminds me of building a bittorrent client in go: https://blog.jse.li/posts/torrent/

  • by batch12 on 10/19/2023, 12:27:13 PM

    Years ago, one of my previous roles was building and supporting a custom linux live OS that could be used by employees on cheap netbooks (remember those?). To distribute updates, I ended up building our own internal torrent server from scratch and used it to distribute image updates. It was a good learning exercise as one of the first times I had built software to conform to a standard and work with out of the box clients.

  • by r3trohack3r on 10/19/2023, 6:59:38 PM

    For anyone who is interested in peer-to-peer systems like this, and completes Sarp's course, I have an open interview challenge you can submit it to if you find that you want to continue building in this space as a profession:

    https://gitlab.com/webai-open/network/interview-challenge

    Take the guidelines to heart though. We evaluate you on demonstrating understanding of what you did, not that you completed the course.

    My advice for standing out would be to continue building on it past the end of the course and do something cool yourself.

  • by ducktective on 10/19/2023, 12:36:46 PM

    Does anyone know why BitTorrent-based Linux package managers has not become a thing?

  • by eimrine on 10/19/2023, 12:17:31 PM

    Is this BitTorrent course free (as beer)? I can see a neighbour course about HTTP server "free during beta".

  • by Dowwie on 10/19/2023, 1:50:33 PM

    Can anyone comment as to how far one can go before paying for the codecrafters service?

    The crowd that is interested in these kinds of experiences may also like Protohackers, which is completely free.

  • by ashcatchum on 10/19/2023, 5:26:22 PM

    Have been exploring this and it is a pretty fun way to learn some of the intrinsics of some products we use daily!

    I have also had positive interactions with Sarp so hoping this product takes off!

  • by ahoka on 10/19/2023, 1:44:57 PM

    Does this include the DHT? BT, the protocol itself is not very interesting, it's just a very bad file access protocol over HTTP without DHT, which makes it really P2P.

  • by shp0ngle on 10/19/2023, 12:27:31 PM

    Wow this looks like a course I am willing to pay for.

    And I wanted to learn Rust anyway :)

  • by gabipurcaru on 10/19/2023, 12:35:58 PM

    This is super fun! I did the same back in uni, it was an awesome project: https://github.com/bbpcr/Yomato

  • by lakomen on 10/19/2023, 2:57:41 PM

    Viewing on mobile.

    Not sure what I see. There is no content, nothing clickable. Just decode bencoded strings and integers and some comments.

    What's the point?

  • by rubiktubik on 10/21/2023, 8:27:38 PM

    I love the idea of this site but I don’t understand the pricing model. It says 30$/month but I can only pay 120$ for 3 months. It should be 90$ for 3 month. A monthly payment model would be more accessible. I do I misunderstood something?

  • by bogomipz on 10/19/2023, 3:17:37 PM

    I am curious has anyone subscribed to codecrafters.io and if so what was your impression of the service?

  • by JyB on 10/19/2023, 3:21:11 PM

    > downloading a file from a single peer

    The hard part is avoided?

  • by tetsuhamu on 10/19/2023, 1:02:50 PM

    It seems to be failing to create a repository right now

  • by wonderwonder on 10/19/2023, 12:36:42 PM

    What a fun site

  • by clubm8 on 10/19/2023, 1:51:10 PM

    I wish more folks distributed Linux ISOs via Bittorrent since it has an integrity check built into the protocol -- messing with PGP is hard and showing me an MD5 sum over a self signed certificate is... just special.