Peanut About


  • Introduction
  • Installation
  • Options
  • Usage
  • Problems


This is version 0.0.4 of PeaGnut, a unix gnutella client which is designed to be portable and run as a daemon, allowing proxy support within the current Gnutella protocol. As is the case with most Free Software projects, it was started by me to scratch a particular itch I had, and kept going because I saw that it could be very useful to many people.
PeaGnut is licensed under the GNU General Public License (GPL). If you are not familiar with this, please see the files LICENSE and COPYING in the root distribution directory. You are not free to distribute this software in any way you want, or to use it in other software projects unconditionally. For more information see
Gnutella is a peer-to-peer internet file sharing protocol. It is designed to allow people to share their files. It does not have a single point of failure (unlike other utilities such as Napster), and as the protocol is freely available as well as many free clients, it can never be shut down. It is _not_ designed to distribute copyrighted material, including MP3s. Do _not_ do this. It is illegal, and you could go to prison for it. It is designed to allow free and easy distribution of files which you are allowed to distribute. However the gnutella protocol and all gnutella clients are just tools, and it is possible tomisuse any tool. I accept no reponsibility for anything which is done using this program, or on any gnutella network. If you believe that someone is distributing something to which you hold the copyright, without permission, contact them - do not contact me, it is nothing to do with me.
As of now, only a subset of the gnutella protocol is supported. It passes PINGsand PONGs, QUERYs and QUERYHITs and ignores everything else. Obviously this is not particularly useful, and this is only meant as a development release. It is most certainly _not_ a stable release, and should not be used in critical situations.
Output is to the syslog if selected during configure, otherwise to standard error. At the moment it generates a lot of debugging information (at least one log line for every packet received), most of which could probably be discarded. As this is a development release all debugging information is shown, and can not be turned off. This will be changed in a future release.
The program expects there to be a file called 'hostlist' in the working directory when it is run. This contains a list of hosts (in the form host:port)to which to connect.

And finally thanks to John Hennessy for encouraging me to do this, and for giving out to me until the code was actually half readable, as well as coming up with the name for it and everything.


Installation is as standard. Untar the distribution file (X.X.X is the version of peagnut you are installing), in the directory /usr/local/src or a different directory if you prefer :

tar xzf peagnut-X.X.X.tar.gz (if you are using gnu tar)
or gzip -cd peagnut-X.X.X | tar xf - (if you are not)

This will create the directory peagnut-X.X.X. Enter this directory and run configure --help to get a list of available options :

cd peagnut-X.X.X
./configure --help

A discussion of some of the options is in section 3 below. Run configure again with the options you require (or just run configure to accept the defaults) :

./configure --with-XXX --without-XXX etc. (to specify options)
./configure (to use defaults)

Next run make to build the distribution. GNU make should be used if available, other make programs may also work :


If this completes successfully, next run make install to install the distribution to the location you specified when you configured it, or /usr/local by default :

make install

This completes the installation.


Currently available useful options to configure are : [=default] Standard configure options

--help : Print usage information and all available options.

--prefix=[/usr/local] : This specifies where to install the program. Subdirectories of this (eg. /usr/local/bin for executable files) will be used.

Program-specific configure options

--with-syslog [no] : Output status and debugging information to the system log (syslogd) if available. This will generate large amounts of information, and should be used with caution as the system log can contain important information, which may be difficult to determine from the large amounts of data this option will produce. Default is to log to stderr.

--with-efence [no] : Use Electric Fence, a memory debugging library written by Bruce Perens. This will slow down the program and substantially increase its size in memory, but is very useful for tracking down memory-related bugs. For developers only.

--with-strict [no] : Use (gcc) option --ansi, to warn about non-ansi compatible code. At the moment this will just generate lots of warnings about implicit declarations.

--with-release [no] : Compile for release, with optimisations, without debugging. At this stage this is probably not that useful as debugging will almost certainly be required.


Run the program 'peagnut'. It will immediately fork and return. It expects there to be a file called 'hostlist' in the working directory, containing a list of hosts to which to connect, in the form host:port, seperated by a newline. It will log to either the syslog (if requested during configure) or to stderr.
Sending the program a SIGINT or SIGKILL will cause it to terminate.


See the file BUGS for known bugs. Also see the current list of open bugs.