A few comments about the XD torrent client

Discussions about i2P enabled Bittorrent clients, experience reports and issues
Post Reply
xqapjl
Posts: 30
Joined: Mon Jun 09, 2025 9:40 pm

A few comments about the XD torrent client

Post by xqapjl »

1. Useful links (I only know clearnet links for XD)
https://xd-torrent.github.io/
https://github.com/majestrate/XD/activity?ref=master

2. There seems to be a general lack of complete and up to date documentation. For example, I believe I've seen 3 variations of what the config file is supposed to be named.
Just start it (./XD) and it'll create torrents.ini and trackers.ini. Then use those.

3. It is unclear how you're supposed to stop it. CTRL+C or 'pkill XD' seems to work. I've not found a way to end it more gracefully. By that I mean that it doesn't seem to tell the trackers that it's shutting down, and it sometimes leaves the SAM session going in i2pd.

Sometimes it also brings the i2pd node down with it when shutting down. I consider this to be an i2pd bug though.

Perhaps i2pd commit 1d7c7ac fixes some of these issues.
https://github.com/PurpleI2P/i2pd/compa ... 2b0132d221

I haven't tried it with any of the other i2p routers yet.

4. When adding torrents with XD-CLI add, don't forget "" around what you're trying to add. Otherwise the command line will not work with the & character in the postman or magnet link.

5. When adding magnet links with XD-CLI add, everything after the magnet hash seems to be ignored.

6. Adding torrent files from postman links seems to mostly work fine. However, downloading a torrent file will sometimes fail. Even if it says OK. Check that it's actually added.

Code: Select all

  ./XD-CLI list | grep <infohash>
7. Don't add a magnet link or a torrent link for something that's already in progress or finished. It will restart from scratch.

8. If you want to seed something new, first copy or move the data file(s) into the downloads folder and then move the .torrent file into the downloads folder. Once it's started, you can delete the .torrent file or move it somewhere else. There will be a version of it in metadata/infohash.torrent that XD uses.

9. When torrents are completed, they are moved. Except for empty folders which remain for some reason.
Edit : You can remove them with this:

Code: Select all

find storage/downloads/ -type d -exec rmdir -p {} \; 2> /dev/null
10. Add extra parameters to the tunnel creation process on lines below i2cp.leaseSetEncType=4,0 in torrents.ini.

Code: Select all

[i2p]
i2cp.leaseSetEncType=4,0
inbound.quantity=5
outbound.quantity=5
inbound.lengthVariance=1
outbound.lengthVariance=1
address=127.0.0.1:7654
disabled=0
(inbound.quantity and outbound.quantity seems to be 5 by default for i2pd and that seems to work fine. I added them as a parameter in the config file to test if changing them works.)

11. Upload and download speeds seem to be about the same as with i2psnark. Memory usage is much lower that i2psnark. CPU usage is mostly barely noticeable (usually less than 5% for me, but I suppose it depends on your computer and how many torrents are loaded etc). Edit : The task manager I used to check this was garbage. According to ps aux and htop and top it uses a lot more CPU than 5% most of the time. Memory usage is still much lower though.

12. The ratio info seems to be useless for torrents that weren't added after the most recent start of XD. (Perhaps related to me not knowing how to close it correctly?)

13. If downloading/uploading faster than 1MB/s, the web interface will not show the decimals. Use XD-CLI list to show the decimals.

14. The WebUI requires javascript to be enabled.

15. Sometimes I get a lot of "piece missmatch" warnings. Bug? Someone intentionally sending garbage data? zeroes somehow treated as data? Unsure what they mean and if they matter.

16. If you stop a finished torrent you have to move its data from seeding to downloads before starting it again, otherwise it'll just try to redownload from scratch in the downloads directory.

17. What the options to XD-CLI seems to actually do:

Code: Select all

$ ./XD-CLI help
  usage: ./XD-CLI [help|version|list|add http://somesite.i2p/some.torrent|set-piece-window n|remove infohash|delete infohash|stop infohash|start infohash]

Code: Select all

help             : Shows the help
version          : Shows the version
list             : List all torrents and info.
add              : Add torrent or magnet.
                   Says OK even if it fails. Make sure to verify that it's actually loaded.
                   You can also download the torrent file in some other way and move it to
                   the downloads directory. Once it's loaded you can more or remove it.
set-piece-window : ??? (If someone knows then please let me know.)
remove           : Removes torrent from list.
                   It will be removed from the list but its contents and metadata files will remain.
delete           : Removes from list, deletes its data and most/some of its metadata files.
                   Does not seem to always remove <infohash>.stats and <infohash>.settings.
                   Unsure if intentional or bug.
                   No effect if done on torrent that can't be seen with 'XD-CLI list'.
stop             : Stop active torrent.
                   It will be removed from 'XD-CLI list', but its contents and metadata will remain.
                   Will start again if you restart XD.
                   Possibly bugged? Behaves the same way as remove.
start            : Doesn't seem to do anything. Presumably the stop command is supposed to change
                   its state but keep it in the list, and then the start command can start it?
18. Here is a script I made that only displays the most important parts of the output from XD-CLI info. I've only tested it in linux with bash. I don't know if it will work with past or future versions of XD.

Code: Select all

#!/bin/bash

tempfile="$(/usr/bin/mktemp --tmpdir xdstatus.XXXXXXXXXX)"

if [ ! -r "${tempfile}" ] || [ ! -w "${tempfile}" ] ; then echo "Unable to create and/or use temp file ${tempfile}" ; exit 1 ; fi

./XD-CLI list > "${tempfile}"

if [ $(cat "${tempfile}" | grep -c "] progress: 0.00$") -gt 0 ] ; then
{
    echo
    echo "No Progress"
    echo "==========="
    cat "${tempfile}" | grep "] progress: 0.00$"
} ; fi

if [ $(cat "${tempfile}" | grep "] progress: " | grep -cv "] progress: 100.00$") -gt 0 ] ; then
{
    echo
    echo "Incomplete"
    echo "=========="
    cat "${tempfile}" | egrep "] progress: |^downloading" | grep -v "progress: 100.00$" | grep -v "tx=0.00B/sec    rx=0.00B/sec" | sed "s/downloading/    downloading/g"
}; fi

if [ $(cat "${tempfile}" | grep -c "] progress: 100.00$") -gt 0 ] ; then
{
    echo
    echo "Finished"
    echo "========"
    cat "${tempfile}" | egrep "] progress: 100.00$|^seeding" | grep -v "seeding tx=0.00B/sec" | sed "s/seeding/    seeding/g"
} ; fi

echo
echo "Summary"
echo "======="
echo -n "No Progress : " ; cat "${tempfile}" | grep -c "] progress: 0.00"
echo -n "Incomplete  : " ; cat "${tempfile}" | grep "] progress: " | grep -cv "] progress: 100.00" 
echo -n "Finished    : " ; cat "${tempfile}" | grep -c "] progress: 100.00"
echo -n "Leeching    : " ; cat "${tempfile}" | grep "downloading tx=" | grep -cv "rx=0.00B/sec"
echo -n "Seeding     : " ; cat "${tempfile}" | grep "seeding tx=" | grep -cv "tx=0.00B/sec"
echo -n "Uploading   : " ; cat "${tempfile}" | egrep "downloading tx=|seeding tx=" | grep -cv "tx=0.00B/sec"
echo -n "Active      : " ; cat "${tempfile}" | egrep "downloading tx=|seeding tx=" | grep -cv "tx=0.00B/sec    rx=0.00B/sec"
echo -n "Summary     : " ; cat "${tempfile}" | grep " torrents: tx="
echo
echo "Notes"
echo "====="
echo "Leeching  : Downloading."
echo "Seeding   : Uploading finished torrent."
echo "Uploading : Uploading incomplete or finished torrent."
echo "Active    : Uploading and/or downloading."
echo "There will be some overlap. For example, torrents with 0.00% completion are listed as both no progress and incomplete."
echo

rm "${tempfile}"

exit 0
19. Some "nice to have" stuff that's available in i2psnark is not available in XD. This includes torrent creation, direct links to the postman entry for the torrent and information about what client others are using.
xqapjl
Posts: 30
Joined: Mon Jun 09, 2025 9:40 pm

Re: A few comments about the XD torrent client

Post by xqapjl »

I forgot to add that I sometimes get a lot of "closing connection due to inactivity" errors. Hundreds per second. It's at a speed that is likely to cause writing about it in the logs to slow down the program by a lot.

The same connections repeat over and over again.

So I'm guessing that closing down the connections fails and it just retries it. Or perhaps it succeeds but doesn't realize it and then tries to close a connection that's already closed? To me, it looks like a bug that it retries it so many times so quickly, whether successful or not.
xqapjl
Posts: 30
Joined: Mon Jun 09, 2025 9:40 pm

Re: A few comments about the XD torrent client

Post by xqapjl »

It doesn't seem to have any protection against adding different torrents writing to the same file(s).
provil
Posts: 49
Joined: Fri Apr 18, 2025 12:16 pm

Re: A few comments about the XD torrent client

Post by provil »

XD is one of the worst torrent clients in the history of torrent clients.

I do not know which person even suggested you to test it out. Remove that friend from your friends list.

Stick to I2PSnark if you want vanilla I2P torrenting but if you want more control or customization then you need to switch towards more mainstream clearnet torrenting clients such as qBittorrent, Tixati, BiglyBT, Deluge, Transmission etc. or Libtorrent - if you are into CLI version only.
anikey
Posts: 84
Joined: Thu Dec 07, 2023 9:22 pm

Re: A few comments about the XD torrent client

Post by anikey »

provil wrote: Mon Sep 01, 2025 2:24 pm
Stick to I2PSnark if you want vanilla I2P torrenting but if you want more control or customization then you need to switch towards more mainstream clearnet torrenting clients such as qBittorrent, Tixati, BiglyBT, Deluge, Transmission etc. or Libtorrent - if you are into CLI version only.
"Stick to I2PSnark" might not be that advice, from my point of view.

You can just use qBittorrent though. It's quite easy - switch on the I2P mode in settings (make sure to enable SAM in I2P settings).

If you want to use qBittorrent anonymously with just I2P, I advise you to create a separate qBT profile for it. (it seems like it or libtorrent has some bug about one CPU core spinning 100% if you have some clearnet torrents in an I2P-only setup)

I2Psnark is alright because it's default, but! People have observed some I2Psnark inefficiencies - if it downloads slowly (< ~20 KB/s), it is alright, but if it goes faster, it starts to download more than it actually receives (e.g. it downloaded from 100MB from a peer, while reporting that it only has ~50MB or less of the file)

Moreover, qBT (over i2pd) seems to be able to reach some quite good speeds, according to some.

So if you have been disillusioned by qBT, i suggest giving it another try (make sure to use libtorrent v2, not v1.2)
xqapjl
Posts: 30
Joined: Mon Jun 09, 2025 9:40 pm

Re: A few comments about the XD torrent client

Post by xqapjl »

provil wrote: Mon Sep 01, 2025 2:24 pm XD is one of the worst torrent clients in the history of torrent clients.

I do not know which person even suggested you to test it out. Remove that friend from your friends list.

Stick to I2PSnark if you want vanilla I2P torrenting but if you want more control or customization then you need to switch towards more mainstream clearnet torrenting clients such as qBittorrent, Tixati, BiglyBT, Deluge, Transmission etc. or Libtorrent - if you are into CLI version only.
I had some major issues with I2PSnark, which is why I decided to try other options. XD needs some workarounds, but it's not useless, and for me it currently works much better than I2PSnark even with that in mind.

XD is actually probably not that far from being really good, although it seems like the developer has mostly focused on other things, so it'll probably take some time.

With that said, this is mostly me testing it out to see what I like about it and what I don't like about it.

Btw, I thought libtorrent was just a library and not a client?
anikey wrote: Mon Sep 01, 2025 8:02 pm
provil wrote: Mon Sep 01, 2025 2:24 pm
Stick to I2PSnark if you want vanilla I2P torrenting but if you want more control or customization then you need to switch towards more mainstream clearnet torrenting clients such as qBittorrent, Tixati, BiglyBT, Deluge, Transmission etc. or Libtorrent - if you are into CLI version only.
"Stick to I2PSnark" might not be that advice, from my point of view.

You can just use qBittorrent though. It's quite easy - switch on the I2P mode in settings (make sure to enable SAM in I2P settings).

If you want to use qBittorrent anonymously with just I2P, I advise you to create a separate qBT profile for it. (it seems like it or libtorrent has some bug about one CPU core spinning 100% if you have some clearnet torrents in an I2P-only setup)

I2Psnark is alright because it's default, but! People have observed some I2Psnark inefficiencies - if it downloads slowly (< ~20 KB/s), it is alright, but if it goes faster, it starts to download more than it actually receives (e.g. it downloaded from 100MB from a peer, while reporting that it only has ~50MB or less of the file)

Moreover, qBT (over i2pd) seems to be able to reach some quite good speeds, according to some.

So if you have been disillusioned by qBT, i suggest giving it another try (make sure to use libtorrent v2, not v1.2)
qBittorrent or I2PSnark are probably the best options for most people at the moment. Personally I'd prefer something console based. If something like rtorrent worked with I2P it'd probably be pretty much perfect.
xqapjl
Posts: 30
Joined: Mon Jun 09, 2025 9:40 pm

Re: A few comments about the XD torrent client

Post by xqapjl »

I made a bash script that makes it easier to stop a torrent with XD and move it to a separate folder. Different folders depending on if the torrent is incomplete or finished.

The way it's designed you need to be starting it from where the XD-CLI link is and it must use default paths to work properly.

It doesn't actually stop it. It prints a suggestion of what to run, so you can check if that's what you actually want to do before doing it.

(The best way would be if something like this was coded into the program itself and included in the stop (or remove?) command. Perhaps with destination paths set in the config file. Unfortunately my go programming skills are non-existing, and I'm not sure if this is the kind of behavior that the developer wants.)

Code: Select all

#!/bin/bash

if [ "X${1}X" == "XX" ] ; then echo "Usage : ${0} <infohash>" ; exit 0 ; fi

tempfile="$(/usr/bin/mktemp --tmpdir xdstop.XXXXXXXXXX)"
infohash=${1}

./XD-CLI list | grep "${infohash}" > ${tempfile}

if [ "$( cat ${tempfile} | wc -l )" -ne 1 ] ; then echo "Error locating infohash ${infohash}" ; rm ${tempfile} ; exit 1 ; fi
name="$(cat ${tempfile} | grep ${infohash} | rev | cut -d " " -f 4- | rev)"
chars=$(cat storage/metadata/${infohash}.settings | cut -d : -f 3 | tr -cd '[:digit:]')
folder=$(cat storage/metadata/${infohash}.settings | cut -d : -f 4 | head -c ${chars})
completion="$( cat ${tempfile} | rev | cut -d " " -f 1 | rev )"
if [ "${completion}" == "100.00" ] ; then finished="Yes" ; else finished="No" ; fi
if [ "${completion}" == "100.00" ] ; then moveto="storage/stopped/finished" ; else moveto="storage/stopped/incomplete" ; fi

echo "Torrent    : ${name}"
echo "Location   : ${folder}/${name}"
echo "Completion : ${completion}"
echo "Finished   : ${finished}"
echo
echo "Stop Commands"
echo "-------------"
echo "mkdir -p ${moveto} storage/metadata_old && \\"
echo "./XD-CLI stop ${infohash} && \\"
echo "mv -nv '${folder}/${name}' '${moveto}/.' && \\"
echo "mv -nv 'storage/metadata/${infohash}.torrent' '${moveto}/${name}.torrent' && \\"
echo "mv -nv 'storage/metadata/${infohash}.'* 'storage/metadata_old/.'"
echo

rm "${tempfile}"

exit 0
Post Reply