JuangaCovas.info

La página personal de Juan Gabriel Covas

Herramientas de usuario

Herramientas del sitio


linux:howtos:amule

Cliente Linux para P2P de protocolos eD2k y Kademlia, exclusivamente en consola

– Juan Gabriel Covas - 2010

Una de las cosas más frikis que sigo haciendo es usar el viejo “emule” para algunas descargas P2P, pero desde Linux y el cliente “aMule” por línea de comandos. Estas son algunas de mis notas.

aMule is an eMule-like client for the eD2k and Kademlia networks.

CentOS

Preparing for compiling “aMule” from sources

# yum install gcc gcc-c++ make bison flex binutils-devel gettext-devel GeoIP-devel wxGTK-devel zlib-devel libpng-devel gd-devel libupnp-devel cryptopp-devel

Installing wxWidgets

# wget http://downloads.sourceforge.net/project/wxwindows/wxAll/2.8.10/wxWidgets-2.8.10.tar.gz?use_mirror=ovh
# tar xvzf wxWidgets-2.8.10.tar.gz
# cd wxWid*
# ./configure --enable-unicode --without-subdirs --disable-gui --disable-expat
# make
# make install
# ldconfig

Installing crypto++

# wget http://downloads.sourceforge.net/project/cryptopp/cryptopp/5.6.0/cryptopp560.zip?use_mirror=garr
# unzip...
# make
# make install
# ldconfig
# cryptest.exe v

Check for all tests passed

Installing amuled for console/terminal use only

# wget http://downloads.sourceforge.net/project/amule/aMule/2.2.6/aMule-2.2.6.tar.bz2?use_mirror=garr
# tar jxvf aMu*
# cd aM*
# ./configure --disable-monolithic --with-toolkit=base --enable-amule-daemon --enable-amulecmd --enable-optimize --disable-debug --disable-ed2k
# make
# make install

Running amuled for first time:

# amuled
amuled: error while loading shared libraries: libwx_baseu-2.8.so.0: cannot open shared object file: No such file or directory

So:

# cp /usr/local/lib/libwx_baseu_net-2.8.so.0 /usr/lib/libwx_baseu_net-2.8.so.0
# cp /usr/local/lib/libwx_baseu-2.8.so.0 /usr/lib/libwx_baseu-2.8.so.0
# amuled
amuled: OnInit - starting timer
Initialising aMuled 2.2.6 using  v2.8.10
Checking if there is an instance already running...
No other instances are running.

ERROR: Info  --- This is the first time you run aMule 2.2.6 ---
[...]
ListenSocket: Ok.
Loading temp files from /root/.aMule/Temp.

All PartFiles Loaded.
HTTP download thread started
No shareable files found in directory: /root/.aMule/Incoming

ERROR: aMule daemon cannot be used when external connections are disabled. To enable External Connections, use either a normal aMule, start amuled with the option --ec-config or set the key"AcceptExternalConnections" to 1 in the file ~/.aMule/amule.conf

Now, exiting main app...
aMule OnExit: Terminating core.
aMule shutdown completed.

Changing amule.conf

Set your nick:

Nick=xxx

Set max upload speed (KB/s)

MaxUpload=128 

Change ports:

Port=9800
UDPPort=9801

Set your real IP address:

Address=66.x.165.x

Change MaxConnections (wxWidgets allows 1024 only)

MaxConnections=1023

Do not remove apparently dead servers, to avoid removing all servers from list:

RemoveDeadServer=0
Serverlist=1

For 10 mbit server:

DownloadCapacity=1024
UploadCapacity=768
MessagesFromFriendsOnly=1
NewVersionCheck=0
KadNodesUrl=http://xxx.net/nodes.dat
Ed2kServersUrl=http://peerates.net/servers.php
AcceptExternalConnections=1
ECAddress=66.xxx.165.44
ECPort=9866
ECPassword=XXX

Creating init script

# nano -w /etc/rc.d/init.d/amuled
#!/bin/sh
# aMule - script shell pour l'arret/demarrage du service

# description: amule p2p download service
# chkconfig: 345 97 03

# Source function library.
. /etc/rc.d/init.d/functions

USER=root       #A user who already ran amule once to configure it.

RETVAL=0

case "$1" in
start)
  echo -n "Starting amule daemon: "
  daemon --user=$USER amuled -f
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amule

  ;;
stop)
  echo -n "Stopping amule daemon: "
  killproc amuled
  RETVAL=$?
  rm -f /var/lock/subsys/amule && rm -f /var/lock/amule
  echo

  ;;
status)
  status amuled
  RETVAL=$?
  ;;
restart|force-reload)
  $0 stop
  $0 start
  amuled stop
  amuled start
  RETVAL=$?
  ;;
*)
  printf "Usage: %q {start|stop|status|restart|force-reload}\n" "$0" >&2
  exit 1
  ;;
esac

exit $RETVAL

Creating amulecmd script to access amuled

# nano amulecmd.sh
#!/bin/sh

amulecmd -v -h xxx.150.183.18 -p 9866 --password=xxx
# chmod 755 amulecmd.sh

Creating “amuleshowdl” script to view nicely formatted download status

# nano amuleshowdl.sh
#!/bin/sh

amulecmd -v -h 207.150.183.18 -p 9866 --password=dqifbvgasaD0iesoo -c "show dl" | \
grep '.' | \
sed "1,/Succeeded/d" | \
sed -n "N;s/^ > .*[0-9A-F]\{32\} \(.*\)\n >.*\[\(.*%\)\].*]\(.*\)/\2 \1\3/p" | \
sort -n
# chmod 755 amuleshowdl.sh

OPENING PORTS

9800
9801
9866

NODES

nodes.dat

Using amulecmd:

# ./amulecmd.sh
This is amulecmd 2.2.6

Creating client...
Succeeded! Connection established to aMule 2.2.6

---------------------------------------
|          aMule text client          |
---------------------------------------

Use 'Help' for command list

aMulecmd$ status

 > eD2k: Connected to XXX [83.xxx.191.161:4500] with HighID
 > Kad: Connected (ok)
 > Download:    222.77 kB/s
 > Upload:      768.01 kB/s
 > Clients in queue:    1034
 > Total sources:       2410

aMulecmd$ connect

aMulecmd$ status

[Status should now show “now connecting”]

aMulecmd$ set bwlimit up 64

 > Operation was successful.
 > Bandwidth limits: Up: 64 kB/s, Down: 0 kB/s.

aMulecmd$ show ul

aMulecmd$ show dl
linux/howtos/amule.txt · Última modificación: 10/07/2020 17:38 por Juanga Covas