aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/gnunet-c-tutorial.pdfbin389563 -> 391250 bytes
-rw-r--r--doc/gnunet-c-tutorial.tex75
2 files changed, 43 insertions, 32 deletions
diff --git a/doc/gnunet-c-tutorial.pdf b/doc/gnunet-c-tutorial.pdf
index 03ceed9b6..a8a98ce0c 100644
--- a/doc/gnunet-c-tutorial.pdf
+++ b/doc/gnunet-c-tutorial.pdf
Binary files differ
diff --git a/doc/gnunet-c-tutorial.tex b/doc/gnunet-c-tutorial.tex
index 70981b138..51da22db4 100644
--- a/doc/gnunet-c-tutorial.tex
+++ b/doc/gnunet-c-tutorial.tex
@@ -35,7 +35,7 @@ Christian Grothoff $\qquad$ Bart Polot $\qquad$ Matthias Wachs
35 35
36\today 36\today
37\end{center} 37\end{center}
38This tutorials explains how to install GNUnet on a GNU/Linux system ond gives an introduction how 38This tutorials explains how to install GNUnet on a GNU/Linux system and gives an introduction how
39GNUnet can be used to develop a Peer-to-Peer application. Detailed installation instructions for 39GNUnet can be used to develop a Peer-to-Peer application. Detailed installation instructions for
40various operating systems and a detailed list of all dependencies can found on our website at 40various operating systems and a detailed list of all dependencies can found on our website at
41\url{https://gnunet.org/installation}. 41\url{https://gnunet.org/installation}.
@@ -74,7 +74,7 @@ $ gpg --verify gnunet-0.9.5a.tar.gz.sig gnunet-0.9.5a.tar.gz
74After successfully verifying the integrity you can extract the tarball using 74After successfully verifying the integrity you can extract the tarball using
75\begin{lstlisting} 75\begin{lstlisting}
76$ tar xvzf gnunet-0.9.5a.tar.gz 76$ tar xvzf gnunet-0.9.5a.tar.gz
77$ mv gnunet-0.9.5a gnunet # we will use the directory "gnunet" in the reminder of this document 77$ mv gnunet-0.9.5a gnunet # we will use the directory "gnunet" in the remainder of this document
78$ cd gnunet 78$ cd gnunet
79\end{lstlisting} 79\end{lstlisting}
80 80
@@ -107,19 +107,27 @@ The remainder of this tutorial assumes that you have SVN HEAD checked out.
107 107
108\subsection{Compiling and Installing GNUnet} 108\subsection{Compiling and Installing GNUnet}
109 109
110First, you need to install the latest {\tt 110First, you need to install at least {\tt
111 libgnupgerror}\footnote{\url{ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.11.tar.bz2}} 111 libgnupgerror} version 1.12\footnote{\url{ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2}}and {\tt libgcrypt} version 1.6\footnote{\url{ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.0.tar.bz2}}.
112and {\tt libgcrypt} version from Git. The current GNUnet code uses
113ECC functions not available in any released version of libgcrypt.
114 112
115\lstset{language=bash} 113\lstset{language=bash}
116\begin{lstlisting} 114\begin{lstlisting}
117$ git clone git://git.gnupg.org/libgcrypt.git 115$ wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.bz2
118$ cd libgcrypt 116$ tar xf libgpg-error-1.12.tar.bz2
119$ ./autogen.sh 117$ cd libgpg-error-1.12
120$ ./configure 118$ ./configure
121$ sudo make install 119$ sudo make install
122$ sudo ldconfig 120$ cd ..
121\end{lstlisting}
122
123\lstset{language=bash}
124\begin{lstlisting}
125$ wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.0.tar.bz2
126$ tar xf libgcrypt-1.6.0.tar.bz2
127$ cd libgcrypt-1.6.0
128$ ./configure
129$ sudo make install
130$ cd ..
123\end{lstlisting} 131\end{lstlisting}
124 132
125\label{sub:install} 133\label{sub:install}
@@ -238,10 +246,10 @@ $ touch peer1.conf
238Now add the following lines to peer1.conf to use this directory. For simplified usage we want to prevent 246Now add the following lines to peer1.conf to use this directory. For simplified usage we want to prevent
239the peer to connect to the GNUnet network since this could lead to confusing output. This modifications will replace the default settings: 247the peer to connect to the GNUnet network since this could lead to confusing output. This modifications will replace the default settings:
240\begin{lstlisting} 248\begin{lstlisting}
241$ [PATHS] 249[PATHS]
242$ SERVICEHOME = ~/gnunet1/ # Use this directory to store GNUnet data 250GNUNET_HOME = ~/gnunet1/ # Use this directory to store GNUnet data
243$ [hostlist] 251[hostlist]
244$ SERVERS = # prevent bootstrapping 252SERVERS = # prevent bootstrapping
245\end{lstlisting} 253\end{lstlisting}
246 254
247\subsection{Start a peer} 255\subsection{Start a peer}
@@ -285,7 +293,7 @@ Now open a separate terminal and change again to the \lstinline|gnunet/src/dht|
285\begin{lstlisting} 293\begin{lstlisting}
286$ cd ~/gnunet/src/dht 294$ cd ~/gnunet/src/dht
287$ ./gnunet-dht-put -c ~/peer1.conf -k KEY -d VALUE # put VALUE under KEY in the DHT 295$ ./gnunet-dht-put -c ~/peer1.conf -k KEY -d VALUE # put VALUE under KEY in the DHT
288$ ./gnunet/src/dht/gnunet-dht-get ~/peer1.conf -k KEY # get key KEY from the DHT 296$ ./gnunet/src/dht/gnunet-dht-get -c ~/peer1.conf -k KEY # get key KEY from the DHT
289$ gnunet-statistics -c ~/peer1.conf # print statistics about current GNUnet state 297$ gnunet-statistics -c ~/peer1.conf # print statistics about current GNUnet state
290$ gnunet-statistics -c ~/peer1.conf -s dht # print statistics about DHT service 298$ gnunet-statistics -c ~/peer1.conf -s dht # print statistics about DHT service
291\end{lstlisting} 299\end{lstlisting}
@@ -694,7 +702,8 @@ memcpy(&msg[1], &payload, payload_size);
694 702
695\exercise{Define a message struct that includes a 32-bit 703\exercise{Define a message struct that includes a 32-bit
696unsigned integer in addition to the standard GNUnet MessageHeader. 704unsigned integer in addition to the standard GNUnet MessageHeader.
697Add a C struct and define a fresh protocol number for your message.} 705Add a C struct and define a fresh protocol number for your message.
706(Protocol numbers in gnunet-ext are defined in \lstinline|gnunet-ext/src/include/gnunet_protocols_ext.h|)}
698 707
699 708
700\subsubsection{Sending Requests to the Service} 709\subsubsection{Sending Requests to the Service}
@@ -1098,10 +1107,10 @@ dht_handle = GNUNET_DHT_connect (cfg, parallel_requests);
1098\end{lstlisting} 1107\end{lstlisting}
1099The second parameter indicates how many requests in parallel to expect. 1108The second parameter indicates how many requests in parallel to expect.
1100It is not a hard limit, but a good approximation will make the DHT more 1109It is not a hard limit, but a good approximation will make the DHT more
1101efficiently. 1110efficient.
1102 1111
1103\subsection{Storing data in the DHT} 1112\subsection{Storing data in the DHT}
1104Since the DHT is a dynamic environment (peers join a leave frequently) 1113Since the DHT is a dynamic environment (peers join and leave frequently)
1105the data that we put in the DHT does not stay there indefinitely. It is 1114the data that we put in the DHT does not stay there indefinitely. It is
1106important to ``refresh'' the data periodically by simply storing it again, 1115important to ``refresh'' the data periodically by simply storing it again,
1107in order to make sure other peers can access it. 1116in order to make sure other peers can access it.
@@ -1302,22 +1311,24 @@ libgnunet_plugin_block_SERVICE_done (void *cls)
1302\subsubsection{Integration of the plugin with the build system} 1311\subsubsection{Integration of the plugin with the build system}
1303 1312
1304In order to compile the plugin, the {\tt Makefile.am} file for the 1313In order to compile the plugin, the {\tt Makefile.am} file for the
1305service should contain a rule similar to this: 1314service \texttt{SERVICE} should contain a rule similar to this:
1306 1315
1307\lstset{language=make} 1316\lstset{language=make}
1308\begin{lstlisting} 1317\begin{lstlisting}
1309plugin_LTLIBRARIES = \ 1318 plugindir = $(libdir)/gnunet
1310 libgnunet_plugin_block_SERVICE.la 1319
1311libgnunet_plugin_block_SERVICE_la_SOURCES = \ 1320 plugin_LTLIBRARIES = \
1312 plugin_block_SERVICE.c 1321 libgnunet_plugin_block_ext.la
1313libgnunet_plugin_block_SERVICE_la_LIBADD = \ 1322 libgnunet_plugin_block_ext_la_SOURCES = \
1314 $(top_builddir)/src/hello/libgnunethello.la \ 1323 plugin_block_ext.c
1315 $(top_builddir)/src/block/libgnunetblock.la \ 1324 libgnunet_plugin_block_ext_la_LIBADD = \
1316 $(top_builddir)/src/util/libgnunetutil.la 1325 $(prefix)/lib/libgnunethello.la \
1317libgnunet_plugin_block_SERVICE_la_LDFLAGS = \ 1326 $(prefix)/lib/libgnunetblock.la \
1318 $(GN_PLUGIN_LDFLAGS) 1327 $(prefix)/lib/libgnunetutil.la
1319libgnunet_plugin_block_SERVICE_la_DEPENDENCIES = \ 1328 libgnunet_plugin_block_ext_la_LDFLAGS = \
1320 $(top_builddir)/src/block/libgnunetblock.la 1329 $(GN_PLUGIN_LDFLAGS)
1330 libgnunet_plugin_block_ext_la_DEPENDENCIES = \
1331 $(prefix)/lib/libgnunetblock.la
1321\end{lstlisting} 1332\end{lstlisting}
1322% $ 1333% $
1323 1334