Readit News logoReadit News
atomashpolskiy · 8 years ago
There are many great BitTorrent clients out there, yet I've made my own and willing to share and attract collaborators!
atomashpolskiy · 8 years ago
Guys, I've added a code screenshot above the gif, is it better now?
yodsanklai · 8 years ago
Just curious, how many hours do you think you've spent on this project?
atomashpolskiy · 8 years ago
I'd say something in the range of 500-1000 hours.
niroze · 8 years ago
thank you!
jph · 8 years ago
Thank you, your work is terrific! Good docs, good code, and I especially like the ability to create custom code to write to alternative storage.
atomashpolskiy · 8 years ago
Thanks!! Yeah, I was pursuing such design that would allow to replace/customize most of the parts, including the internals. As a bonus, it makes it easier to continue working on the library as the codebase grows (now nearing 25K lines of code)
gigatexal · 8 years ago
Man this looks slick, going to give it a shot. Love the ability to be able to download a magnet link from the CLI and not worry about what some fancy GUI is doing in the background cuz I am paranoid.
atomashpolskiy · 8 years ago
Thank you! Make sure to install http://www.oracle.com/technetwork/java/javase/downloads/jce8... to allow 160-bit cryptography and use -e flag to be completely safe!

I also have a simple shell script locally, that wraps the java command, so I have to just type `btmagnet AF0D9AA01A9AE123A73802CFA58CCAF355EB19F8` to download to a pre-determined location (hardcoded in the script). I wonder if I should share it on the CLI README page

sarnowski · 8 years ago
> Make sure to install http://www.oracle.com/technetwork/java/javase/downloads/jce8.... to allow 160-bit cryptography

Or don't use the Oracle proprietary distribution but the OpenJDK of your operating system which normally doesn't exclude proper crypto algorithms.

(be aware that the JDKs downgrade silently if certain libraries are missing in your host)

gigatexal · 8 years ago
do it! that'd be my use case more or less.
rena-anju · 8 years ago
What things that makes you paranoid can a "fancy GUI" do in the background that an application with a CLI cannot also do in the background?
gigatexal · 8 years ago
There’s less code for me to review in this project than say in utorrent or another application.
pmatev · 8 years ago
Credit to OP, this looks like a really solid project. The CLI aspect of it reminds me of peerflix (https://github.com/mafintosh/peerflix), which I've been using for a while and am pretty happy with (no affiliation, promise)
lotyrin · 8 years ago
I use rtorrent for exactly this.
hobarrera · 8 years ago
Sounds like deluge (deluged) would have suited you fine.
zitterbewegung · 8 years ago
It looks great but the top GIF makes it seem like you are offering a command line BT client. If I were you I would have it slowly scroll through the code of the client in the GIF or put a few frames of code of the client and or some compiling and then show the current top GIF.
atomashpolskiy · 8 years ago
Oh, I didn't expect this :) Sounds good, but I'm not sure I have patience do this right, it's such a pain to record gifs - I always misspell or misclick something, and by take #47 go completely nuts
deft · 8 years ago
Try using asciinema. It records your terminal session and works so well. Of course typos and such are still an issue...
zitterbewegung · 8 years ago
How about put a picture of source code above it then?
yodsanklai · 8 years ago
Nice work. I'm wondering, how would you test/benchmark such an application. Besides manual testing on a variety of torrents, how would you do regression test there? same question for benchmarking. How to compare this work with another client?
atomashpolskiy · 8 years ago
I have several hundred unit tests and also a bunch of integration tests. While UTs usually test API of individual classes, each of the ITs creates a swarm of local peers and launches a torrenting session with certain conditions: seeders to leechers ratio, downloading from .torrent file vs using a magnet link, PEX enabled/disabled, encrypted vs raw message streams, etc.

Benchmarks (like in libtorrent) is something I'm looking forward to, but the project is still in the early stage -- there's a lot to be done with regards to optimization, i.e. switching to using NIO selectors, adding a caching layer, etc. That's a lot of work, and that's why I'm looking for collaborators, before investing more time into performance-tuning.

silotis · 8 years ago
I would advise against implementing a custom cache for piece data. Caching file data in-app is counterproductive because it wastes memory duplicating data which the OS already holds in its page cache. Instead memory mapped I/O should be preferred.
djhworld · 8 years ago
Really like the approach around using Guice as a central point for hooking your own code into the system.

Will look forward to reading through the code later!

atomashpolskiy · 8 years ago
Thanks! God bless IoC, it saves my ass each time I make some silly design choice
styfle · 8 years ago
I'm curious, it looks like the screenshot shows the author is using a Mac. But Mac OS hasn't shipped with Java in several years. So why Java? Is it simply familiarity, or are there other reasons?
atomashpolskiy · 8 years ago
A mix of both, actually. I've been using uTorrent for years until 2016, when I've decided to switch to some new OS X release. After installing the system update, the old, ad-free version of uTorrent has stopped working. The new version seemed a bloated mess to me, so I've tried a few other clients, but was left unsatisfied. Finally, in despair I've decided to write my own client with simplistic command-line UI, with emphasis on streaming movies. The sheer amount of new information in BEPs was enough for me to decide to take the easiest route and use the language, that I'm most familiar with.
styfle · 8 years ago
Thanks for the reply (it seems my question caused an uproar here, oops).

I definitely like the idea. My question was more aimed to understand if Java has some desirable features for writing a torrent client maybe as part of the SDK or other 3rd party libs. I didn't even look at your source code yet :P

Java stood out to me because I don't think I've seen other CLIs written in Java.

jrs95 · 8 years ago
This is a library for development. If you wanted to ship a client based on this, you could do that and package it with the Java runtime.
pvg · 8 years ago
Most OS's don't ship with a C compiler, go, python 3, rust, arc, etc, what does that have to do with anything?
weberc2 · 8 years ago
You're conflating developer tools with a language runtime. Every popular OS ships with everything necessary to run a C, Go, or Rust binary. Python 3 and Java both require a separate runtime to be installed, but I will say that every Java CLI I've used has had terrible startup performance.
soperj · 8 years ago
Technically _most_ ship with a C compiler and a python compiler since pretty well every linux distribution & bsd distribution has those. But that really doesn't have anything to do with which language you should use.
segmondy · 8 years ago
Amazing work, how long did it take to build? Where you working on it full-time or part-time?
atomashpolskiy · 8 years ago
Thank you! Calendar year, in the evenings and on weekends, with sprints of several weeks and a month or two of rest/AFK after each sprint to keep sanity (I have a full-time job, a wife and a 3 year old kid). Happy that I had the persistence to keep working on the project
segmondy · 8 years ago
Very impressive! Thanks for sharing, it's encouraging to me and I hope to others to know that with proper time management we can put out amazing work.