Making the (partial) Rust BitTorrent client more reasonable
After doing the BitTorrent CodeCrafters challenge in #rustlang (https://youtu.be/jf_ddGnum_4), I had an urge to do some re-organization to better fit what a real implementation would look like when it has to handle files, multiple peers, multiple pieces, concurrency, etc. So, that's what we did!
If you want to give the whole challenge a try, please consider using my refrral link: https://app.codecrafters.io/join?via=jonhoo
0:00:00 Recap
0:11:18 Writing what we want to end up with
0:21:28 Writing the interface outside-in
0:36:56 Grabbing peer info
0:42:44 Interacting with a single peer
0:56:10 Decoding which pieces a peer has
1:34:11 Moment of hesitation
1:39:15 Ordering pieces
1:53:11 Connecting to a pool of peers
2:05:10 Grabbing pieces one by one
2:20:09 Cooperatively download all the blocks!
3:11:23 Handling choking
3:28:06 Putting together all the pieces
3:35:29 Fixing the one bug
3:45:23 The many things that remain
Stream diff: https://github.com/jonhoo/codecrafters-bittorrent-rust/compare/b7624aea62d47833c99af1555a8d44c7d9582c60...01dce6f489ecc7e5069960614d7b12ba66bdbec8
Live version with chat: https://youtube.com/live/8sEdv0G1VIE
Other Videos By Jon Gjengset
2024-07-14 | Open Source Maintenance, 2024-07-14 |
2024-05-18 | What's New in Rust 1.72-1.78 Rustacean Station marathon |
2024-05-04 | Q&A May 2024 |
2024-04-05 | Decrusting the tokio crate |
2024-03-09 | Implementing (parts of) git from scratch in Rust |
2024-02-09 | Decrusting the tracing crate |
2024-02-06 | Jon Gjengset Live Stream |
2024-01-14 | Hardware and software [2024 edition] |
2023-12-16 | Q&A December 2023 |
2023-12-15 | Q&A Session |
2023-11-17 | Making the (partial) Rust BitTorrent client more reasonable |
2023-10-19 | Implementing (part of) a BitTorrent client in Rust |
2023-08-26 | Open Source Maintenance, 2023-08-25 |
2023-08-13 | Open Source Maintenance, 2023-08-13 |
2023-08-06 | Open Source Maintenance, 2023-08-06 |
2023-07-31 | Rust "did you know": handy cargo tools |
2023-07-28 | Decrusting the axum crate |
2023-07-15 | Q&A July 2023 |
2023-05-23 | Rust "did you know": non-generic inner functions |
2023-05-06 | Crust of Rust: std::collections |
2023-05-05 | Rust "did you know": shortcut for docs.rs permalinks |