aboutsummaryrefslogtreecommitdiff
path: root/doc/gnunet-c-tutorial.tex
diff options
context:
space:
mode:
authorCarlo von lynX <lynX@time.to.get.psyced.org>2016-08-25 15:17:32 +0000
committerCarlo von lynX <lynX@time.to.get.psyced.org>2016-08-25 15:17:32 +0000
commit30b89fe7e6111e19996e9a89a691564cef5be1d7 (patch)
tree13071f5f7a2b7222be3df92dea73aa2f887be378 /doc/gnunet-c-tutorial.tex
parentccf6004e61a5379954aed85be6ed49ab7e886a7d (diff)
downloadgnunet-30b89fe7e6111e19996e9a89a691564cef5be1d7.tar.gz
gnunet-30b89fe7e6111e19996e9a89a691564cef5be1d7.zip
-grammar & style
Diffstat (limited to 'doc/gnunet-c-tutorial.tex')
-rw-r--r--doc/gnunet-c-tutorial.tex39
1 files changed, 21 insertions, 18 deletions
diff --git a/doc/gnunet-c-tutorial.tex b/doc/gnunet-c-tutorial.tex
index ee24b0ae4..91053a150 100644
--- a/doc/gnunet-c-tutorial.tex
+++ b/doc/gnunet-c-tutorial.tex
@@ -76,7 +76,7 @@ $ gpg --verify gnunet-0.10.x.tar.gz.sig gnunet-0.10.x.tar.gz
76After successfully verifying the integrity you can extract the tarball using 76After successfully verifying the integrity you can extract the tarball using
77\begin{lstlisting} 77\begin{lstlisting}
78$ tar xvzf gnunet-0.10.x.tar.gz 78$ tar xvzf gnunet-0.10.x.tar.gz
79$ mv gnunet-0.10.x gnunet # we will use the directory "gnunet" in the remainder of this document 79$ mv gnunet-0.10.x gnunet # we will use the directory "gnunet" in the remainder of this document
80$ cd gnunet 80$ cd gnunet
81\end{lstlisting} 81\end{lstlisting}
82 82
@@ -153,7 +153,7 @@ $ make install
153 153
154After installing GNUnet you have to add your GNUnet installation to your path 154After installing GNUnet you have to add your GNUnet installation to your path
155environmental variable. In addition you have to create the \lstinline|.gnunet| 155environmental variable. In addition you have to create the \lstinline|.gnunet|
156directory in your home directory where GNUnet stores it's data and an empty 156directory in your home directory where GNUnet stores its data and an empty
157GNUnet configuration file: 157GNUnet configuration file:
158 158
159\lstset{language=bash} 159\lstset{language=bash}
@@ -181,7 +181,7 @@ $
181\end{lstlisting} 181\end{lstlisting}
182check your {\tt PATH} variable to ensure GNUnet's {\tt bin} directory is included. 182check your {\tt PATH} variable to ensure GNUnet's {\tt bin} directory is included.
183 183
184GNUnet provides tests for all of it's subcomponents. Run 184GNUnet provides tests for all of its subcomponents. Run
185\begin{lstlisting} 185\begin{lstlisting}
186$ make check 186$ make check
187\end{lstlisting} 187\end{lstlisting}
@@ -247,7 +247,7 @@ the programmer.
247\section{First Steps with GNUnet} 247\section{First Steps with GNUnet}
248 248
249\subsection{Configure your peer} 249\subsection{Configure your peer}
250First of all we need to configure your peer. Each peer is started with a configuration containing settings for GNUnet itself and it's services. This configuration is based on the default configuration shipped with GNUnet and can be modified. The default configuration is located in the {\tt \$PREFIX/share/gnunet/config.d} directory. When starting a peer, you can specify a customized configuration using the the {\tt$-c$} command line switch when starting the ARM service and all other services. When using a modified configuration the default values are loaded and only values specified in the configuration file will replace the default values. 250First of all we need to configure your peer. Each peer is started with a configuration containing settings for GNUnet itself and its services. This configuration is based on the default configuration shipped with GNUnet and can be modified. The default configuration is located in the {\tt \$PREFIX/share/gnunet/config.d} directory. When starting a peer, you can specify a customized configuration using the the {\tt$-c$} command line switch when starting the ARM service and all other services. When using a modified configuration the default values are loaded and only values specified in the configuration file will replace the default values.
251 251
252Since we want to start additional peers later, we need 252Since we want to start additional peers later, we need
253some modifications from the default configuration. We need to create a separate service home and a file containing our modifications for this peer: 253some modifications from the default configuration. We need to create a separate service home and a file containing our modifications for this peer:
@@ -262,9 +262,9 @@ network since this could lead to confusing output. This modifications
262will replace the default settings: 262will replace the default settings:
263\begin{lstlisting} 263\begin{lstlisting}
264[PATHS] 264[PATHS]
265GNUNET_HOME = ~/gnunet1/ # Use this directory to store GNUnet data 265GNUNET_HOME = ~/gnunet1/ # Use this directory to store GNUnet data
266[hostlist] 266[hostlist]
267SERVERS = # prevent bootstrapping 267SERVERS = # prevent bootstrapping
268\end{lstlisting} 268\end{lstlisting}
269 269
270\subsection{Start a peer} 270\subsection{Start a peer}
@@ -298,23 +298,23 @@ I am peer `0PA02UVRKQTS2C .. JL5Q78F6H0B1ACPV1CJI59MEQUMQCC5G'.
298In this section, we will monitor the behaviour of our peer's DHT service with respect to a 298In this section, we will monitor the behaviour of our peer's DHT service with respect to a
299specific key. First we will start GNUnet and then start the DHT service and use the DHT monitor tool 299specific key. First we will start GNUnet and then start the DHT service and use the DHT monitor tool
300to monitor the PUT and GET commands we issue ussing the \lstinline|gnunet-dht-put| and 300to monitor the PUT and GET commands we issue ussing the \lstinline|gnunet-dht-put| and
301\lstinline|gnunet-dht-get| command. Using the ``monitor'' line given below, you can observe the behavior of 301\lstinline|gnunet-dht-get| commands. Using the ``monitor'' line given below, you can observe the behavior of
302your own peer's DHT with respect to the specified KEY: 302your own peer's DHT with respect to the specified KEY:
303 303
304\lstset{language=bash} 304\lstset{language=bash}
305\begin{lstlisting} 305\begin{lstlisting}
306$ gnunet-arm -c ~/peer1.conf -s # start gnunet with all default services 306$ gnunet-arm -c ~/peer1.conf -s # start gnunet with all default services
307$ gnunet-arm -c ~/peer1.conf -i dht # start DHT service 307$ gnunet-arm -c ~/peer1.conf -i dht # start DHT service
308$ cd ~/gnunet/src/dht; 308$ cd ~/gnunet/src/dht;
309$ ./gnunet-dht-monitor -c ~/peer1.conf -k KEY 309$ ./gnunet-dht-monitor -c ~/peer1.conf -k KEY
310\end{lstlisting} 310\end{lstlisting}
311Now open a separate terminal and change again to the \lstinline|gnunet/src/dht| directory: 311Now open a separate terminal and change again to the \lstinline|gnunet/src/dht| directory:
312\begin{lstlisting} 312\begin{lstlisting}
313$ cd ~/gnunet/src/dht 313$ cd ~/gnunet/src/dht
314$ ./gnunet-dht-put -c ~/peer1.conf -k KEY -d VALUE # put VALUE under KEY in the DHT 314$ ./gnunet-dht-put -c ~/peer1.conf -k KEY -d VALUE # put VALUE under KEY in the DHT
315$ ./gnunet/src/dht/gnunet-dht-get -c ~/peer1.conf -k KEY # get key KEY from the DHT 315$ ./gnunet/src/dht/gnunet-dht-get -c ~/peer1.conf -k KEY # get key KEY from the DHT
316$ gnunet-statistics -c ~/peer1.conf # print statistics about current GNUnet state 316$ gnunet-statistics -c ~/peer1.conf # print statistics about current GNUnet state
317$ gnunet-statistics -c ~/peer1.conf -s dht # print statistics about DHT service 317$ gnunet-statistics -c ~/peer1.conf -s dht # print statistics about DHT service
318\end{lstlisting} 318\end{lstlisting}
319% $ 319% $
320\subsection{Starting Two Peers by Hand} 320\subsection{Starting Two Peers by Hand}
@@ -390,9 +390,9 @@ OPTIONS = -p
390Then change {\tt peer2.conf} and replace the ``\texttt{SERVERS}'' line in the ``\texttt{[hostlist]}'' section with 390Then change {\tt peer2.conf} and replace the ``\texttt{SERVERS}'' line in the ``\texttt{[hostlist]}'' section with
391``\texttt{http://localhost:8080/}''. Restart both peers using: 391``\texttt{http://localhost:8080/}''. Restart both peers using:
392\begin{lstlisting} 392\begin{lstlisting}
393$ gnunet-arm -c peer1.conf -e # stop first peer 393$ gnunet-arm -c peer1.conf -e # stop first peer
394$ gnunet-arm -c peer1.conf -s # start first peer 394$ gnunet-arm -c peer1.conf -s # start first peer
395$ gnunet-arm -c peer2.conf -s # start second peer 395$ gnunet-arm -c peer2.conf -s # start second peer
396\end{lstlisting} 396\end{lstlisting}
397 397
398Note that if you start your peers without changing these settings, they 398Note that if you start your peers without changing these settings, they
@@ -416,7 +416,7 @@ Check that they are connected using {\tt gnunet-core -c peer1.conf}, which shoul
416peer identity: 416peer identity:
417\begin{lstlisting} 417\begin{lstlisting}
418$ gnunet-core -c peer1.conf 418$ gnunet-core -c peer1.conf
419Peer `9TVUCS8P5A7ILLBGO6JSTSSN2B44H3D2MUIFJMLKAITC0I22UVFBFP1H8NRK2IA35VKAK16LLO0MFS7TAQ9M1KNBJ4NGCHP3JPVULDG' 419Peer `9TVUCS8P5A7ILLBGO6 [...shortened...] 1KNBJ4NGCHP3JPVULDG'
420\end{lstlisting} 420\end{lstlisting}
421 421
422\subsection{Starting Peers Using the Testbed Service} 422\subsection{Starting Peers Using the Testbed Service}
@@ -444,9 +444,12 @@ configuration file. Various available options and details about them can be
444found in the testbed default configuration file \texttt{src/testbed/testbed.conf}. 444found in the testbed default configuration file \texttt{src/testbed/testbed.conf}.
445 445
446With the testbed API, a sample test case can be structured as follows: 446With the testbed API, a sample test case can be structured as follows:
447% <lynX> Is there a way to pick a more readable font for this include?
447\lstinputlisting[language=C]{testbed_test.c} 448\lstinputlisting[language=C]{testbed_test.c}
448The source code for the above listing can be found at 449The source code for the above listing can be found at
449\url{https://gnunet.org/svn/gnunet/doc/testbed_test.c}. After installing GNUnet, the above source code can be compiled as: 450\url{https://gnunet.org/svn/gnunet/doc/testbed_test.c}
451or in the doc folder of your repository check-out.
452After installing GNUnet, the above source code can be compiled as:
450\lstset{language=bash} 453\lstset{language=bash}
451\begin{lstlisting} 454\begin{lstlisting}
452$ export CPPFLAGS="-I/path/to/gnunet/headers" 455$ export CPPFLAGS="-I/path/to/gnunet/headers"