You are not logged in.
Pages: 1
Hey guys, I've been using rtorrent recently. The only thing I missed was DHT to get more peers when seeds were low.
Fortunately I discovered a patch on rtorrent's trac website that adds DHT capability to rtorrent. I've tested it and it's been working well for me.
It's quite a substantial patch, written by Josef Drexler. It's available with description here: http://tk.ttdpatch.net/~jdrexler/dht/.
It appears that Josef updates the patch quite regularly, it applies cleanly to recent rtorrent svn versions.
The patch contains patches for both rtorrent, and the libtorrent library, so it needs to be split as we build those separately on arch.
If anyone wants to use rtorrent with DHT, just make packages from the following PKGBUILDs:
edit: I've edited this post to address the problems fwojciec had. I've now added the complete working PKGBUILDs.
The easiest solution to compile problems is to use revision 992 of libtorrent and revision 995 of rtorrent which is what the PKGBUILDs below do, so they should work no problem.
I believe I found the original PKGBUILDs elsewhere on the forum, apparently contributed by swogs, and just modified them to apply the DHT patch.
If you're curious, the sed lines grab the needed part of the patch for each PKGBUILD.
libtorrent PKGBUILD:
# Contributor: swogs <hugin0>
pkgname=libtorrent-svn
pkgver=992
pkgrel=1
pkgdesc=""
arch=('i686')
url="http://libtorrent.rakshasa.no/"
depends=('libsigc++2.0' 'openssl')
makedepends=('subversion')
conflicts=('libtorrent')
provides=('libtorrent')
source=(http://tk.ttdpatch.net/~jdrexler/dht/dht.diff)
md5sums=(9f6195e58846e3284aac6be135f6910d)
_svntrunk=svn://rakshasa.no/libtorrent/trunk/libtorrent
_svnmod=libtorrent
build() {
cd $startdir/src
svn co $_svntrunk -r $pkgver
sed -n '/Index: libtorrent/,$p' dht.diff | patch -Np0 || return 1 # Apply DHT patch
cd $_svnmod
./autogen.sh
msg "SVN checkout done or server timeout"
msg "Starting make..."
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg/ install
}
# vim:syntax=sh
rtorrent PKGBUILD:
# Contributor: swogs <hugin0>
pkgname=rtorrent-svn
pkgver=995
pkgrel=1
pkgdesc=""
arch=('i686')
url="http://libtorrent.rakshasa.no/"
depends=('libtorrent-svn' 'curl')
makedepends=('subversion')
conflicts=('rtorrent')
provides=('rtorrent')
source=('dhtrt.diff')
md5sums=('b85fb1533070c437a117eb577102a7c6')
_svntrunk=svn://rakshasa.no/libtorrent/trunk/rtorrent
_svnmod=rtorrent
build() {
cd $startdir/src
svn co $_svntrunk -r $pkgver
patch -Np0 -i dhtrt.diff || return 1 # DHT patch
cd $_svnmod
./autogen.sh
msg "SVN checkout done or server timeout"
msg "Starting make..."
./configure --prefix=/usr
make || return 1
make DESTDIR=$startdir/pkg/ install
}
# vim:syntax=sh
The modified PKGBUILDs will generate packages with DHT support. One thing you can consider doing is
to eliminate the md5sums so the PKGBUILD will still work if Josef updates the patch. Right now, if the patch is changed
the package will fail to build since the checksum won't match.
Also, although the patch works on rtorrent-svn version 995, it only works on libtorrent-svn version 992.
So use makepkg to build the libtorrent PKGBUILD; versionpkg will try to build version 995 and fail.
After installing the packages, add this to your ~/.rtorrent.rc:
# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = auto
# UDP port to use for DHT.
#
dht_port = 6881
I have DHT set to auto, and changed the dht_port to coincide with my forwarded ports.
There are explanations of how DHT works with rtorrent in the link to the patch I provided above.
When you start up rtorrent you'll see a message like this at the bottom:
(19:23:50) Starting DHT server on port 30010
and periodically under active torrents:
Tracker[2:2]: Connecting to dht:// [Announcing: 5/8 nodes replied]
Okay, so hope someone finds this useful, let me know if there are (any more) problems.
Last edited by veek (2007-10-28 16:27:27)
Offline
OK, I've managed to get it to work... but not without some problems...
1) there is no rtorrent (svn) or libtorrent (svn) on AUR - I've managed to find some PKGBUILDs by searching the forums though...
2) revision 992 of rtorrent wouldn't compile for me, so I've tried a number of different revisions and 995 worked OK
In the end everything works as it should - so thanks
Offline
Hey fwojciec, thanks for pointing out those issues.
I forgot I didn't find the original PKGBUILDs in AUR, and as you discovered they were on the forum.
In addition, I forgot that I had to make a patch (besides the DHT patch) to get revision 992 of rtorrent to compile.
The patch solved some issues with includes related to sigc++.
In any case, rtorrent 995 builds no problem.
I've updated my original post to include the entire PKGBUILDs for both libtorrent and rtorrent. They should both build no problem.
Sorry to make you do all that unnecessary work
Last edited by veek (2007-10-28 16:30:09)
Offline
Pages: 1