diff options
-rw-r--r-- | doc/Makefile.am | 1 | ||||
-rw-r--r-- | doc/chapters/installation.texi | 105 | ||||
-rw-r--r-- | doc/gnunet-c-tutorial.texi | 17 | ||||
-rw-r--r-- | doc/tutorial-examples/013.1.c | 3 | ||||
-rw-r--r-- | doc/tutorial-examples/016.c | 3 |
5 files changed, 92 insertions, 37 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index feb0f0715..74b1300b4 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am | |||
@@ -90,6 +90,7 @@ gnunet_tutorial_examples = \ | |||
90 | 011.c \ | 90 | 011.c \ |
91 | 012.c \ | 91 | 012.c \ |
92 | 013.c \ | 92 | 013.c \ |
93 | 013.1.c \ | ||
93 | 014.c \ | 94 | 014.c \ |
94 | 015.c \ | 95 | 015.c \ |
95 | 016.c \ | 96 | 016.c \ |
diff --git a/doc/chapters/installation.texi b/doc/chapters/installation.texi index 1fbe20892..60861402a 100644 --- a/doc/chapters/installation.texi +++ b/doc/chapters/installation.texi | |||
@@ -1,13 +1,13 @@ | |||
1 | @node GNUnet Installation Handbook | 1 | @node GNUnet Installation Handbook |
2 | @chapter GNUnet Installation Handbook | 2 | @chapter GNUnet Installation Handbook |
3 | 3 | ||
4 | This handbook describes how to install (build setup, compilation) and setup | 4 | This handbook describes how to install (build setup, compilation) and |
5 | (configuration, start) GNUnet 0.10.x. After following these instructions you | 5 | setup (configuration, start) GNUnet 0.10.x. After following these |
6 | should be able to install and then start user-interfaces to interact with the | 6 | instructions you should be able to install and then start user-interfaces |
7 | network. | 7 | to interact with the network. |
8 | 8 | ||
9 | This manual is far from complete, and we welcome informed contributions, be it | 9 | This manual is far from complete, and we welcome informed contributions, |
10 | in the form of new chapters or insightful comments. | 10 | be it in the form of new chapters or insightful comments. |
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
@@ -30,7 +30,8 @@ in the form of new chapters or insightful comments. | |||
30 | @section Dependencies | 30 | @section Dependencies |
31 | @c %**end of header | 31 | @c %**end of header |
32 | 32 | ||
33 | This document lists the various known dependencies for GNUnet 0.10.x. | 33 | This section lists the various known dependencies for |
34 | GNUnet @value{EDITION}. | ||
34 | Suggestions for missing dependencies or wrong version numbers are welcome. | 35 | Suggestions for missing dependencies or wrong version numbers are welcome. |
35 | 36 | ||
36 | 37 | ||
@@ -38,6 +39,7 @@ Suggestions for missing dependencies or wrong version numbers are welcome. | |||
38 | @menu | 39 | @menu |
39 | * External dependencies:: | 40 | * External dependencies:: |
40 | * Fixing libgnurl build issues:: | 41 | * Fixing libgnurl build issues:: |
42 | * Optional dependencies:: | ||
41 | * Internal dependencies:: | 43 | * Internal dependencies:: |
42 | @end menu | 44 | @end menu |
43 | 45 | ||
@@ -48,38 +50,47 @@ Suggestions for missing dependencies or wrong version numbers are welcome. | |||
48 | These packages must be installed before a typical GNUnet installation | 50 | These packages must be installed before a typical GNUnet installation |
49 | can be performed: | 51 | can be performed: |
50 | 52 | ||
51 | @table @asis | 53 | @itemize @bullet |
52 | @item GNU libmicrohttpd 0.9.30 or higher | 54 | @item GNU libmicrohttpd 0.9.30 or higher@footnote{We recommend to build it |
55 | with a GnuTLS version that was configured with libunbound ("DANE support")} | ||
53 | @item GNU libextractor 1.0 or higher | 56 | @item GNU libextractor 1.0 or higher |
54 | @item GNU libtool 2.2 or higher | 57 | @item GNU libtool 2.2 or higher |
55 | @item GNU libunistring 0.9.1.1 or higher | 58 | @item GNU libunistring 0.9.1.1 or higher |
56 | @item GNU libidn 1.0.0 or higher | 59 | @item GNU libidn 1.0.0 or higher |
57 | @item @uref{https://gnupg.org/software/libgcrypt/index.html, GNU libgcrypt} @uref{https://gnupg.org/ftp/gcrypt/libgcrypt/, 1.6.0} or higher | 60 | @item @uref{https://gnupg.org/software/libgcrypt/, GNU libgcrypt} |
58 | @item @uref{https://gnutls.org/, GnuTLS} @uref{https://www.gnupg.org/ftp/gcrypt/gnutls/v3.2/, 3.2.7} or higher @footnote{compile with libunbound for DANE support; GnuTLS also requires GNU nettle 2.7 (update: GnuTLS 3.2.7 appears NOT to work against GNU nettle > 2.7, due to some API updatings done by nettle. Thus it should be compiled against nettle 2.7 and, in case you get some error on the reference to `rpl_strerror' being undefined, follow the instructions on @uref{http://lists.gnupg.org/pipermail/gnutls-devel/2013-November/006588.html, this} post (and the link inside it)).} | 61 | @uref{https://gnupg.org/ftp/gcrypt/libgcrypt/, 1.6.0} or higher |
59 | @item @uref{https://gnunet.org/gnurl, gnURL} libgnurl 7.34.0 or higher @footnote{must be compiled after @code{GnuTLS}} | 62 | @item @uref{https://gnutls.org/, GnuTLS}@footnote{We recommend to use a |
63 | GnuTLS version that was configured with libunbound ("DANE support")} | ||
64 | @uref{https://www.gnupg.org/ftp/gcrypt/gnutls/v3.2/, 3.2.7} or higher | ||
65 | @footnote{We recommend to compile with libunbound for DANE support; | ||
66 | GnuTLS also requires GNU nettle 2.7 (update: GnuTLS 3.2.7 appears NOT | ||
67 | to work against GNU nettle > 2.7, due to some API updatings done by | ||
68 | nettle. Thus it should be compiled against nettle 2.7 | ||
69 | and, in case you get some error on the reference to `rpl_strerror' being | ||
70 | undefined, follow the instructions on | ||
71 | @uref{http://lists.gnupg.org/pipermail/gnutls-devel/2013-November/006588.html, this} | ||
72 | post (and the link inside it)).} | ||
73 | @item @uref{https://gnunet.org/gnurl, gnURL} libgnurl 7.34.0 or | ||
74 | higher@footnote{must be compiled after @code{GnuTLS}} | ||
60 | @item libglpk 4.45 or higher | 75 | @item libglpk 4.45 or higher |
61 | @item @uref{http://www.openssl.org/, OpenSSL} (binary) 1.0 or higher | 76 | @item @uref{http://www.openssl.org/, OpenSSL} (binary) 1.0 or higher |
62 | @item TeX Live 2012 or higher, optional (for gnunet-bcd) | 77 | @item TeX Live 2012 or higher, optional (for gnunet-bcd) |
63 | @item Texinfo 5.2 or higher (for documentation) | 78 | @item Texinfo 5.2 or higher (for documentation) |
64 | @item libpulse 2.0 or higher, optional (for gnunet-conversation) | 79 | @item libsqlite 3.8.0 or higher @footnote{(note that the code will |
65 | @item libopus 1.0.1 or higher, optional (for gnunet-conversation) | 80 | compile and often work with lower version numbers, but you may get subtle |
66 | @item libogg 1.3.0 or higher, optional (for gnunet-conversation) | 81 | bugs with respect to quota management in certain rare cases); |
67 | @item certool (binary) optional @footnote{for convenient installation of the GNS proxy (available as part of Debian's libnss3-tools)} | 82 | alternatively, MySQL or Postgres can also be installed, but those |
68 | @item python-zbar 0.10 or higher, optional (for gnunet-qr) | 83 | databases will require more complex configurations (not |
69 | @item libsqlite 3.8.0 or higher @footnote{(note that the code will compile and often work with lower version numbers, but you may get subtle bugs with respect to quota management in certain rare cases); alternatively, MySQL or Postgres can also be installed, but those databases will require more complex configurations (not recommended for first-time users)} | 84 | recommended for first-time users)} |
70 | @item zlib any version we tested worked | 85 | @item zlib |
71 | @item Gtk+ 3.0 or higher, optional (for gnunet-gtk) | 86 | @end itemize |
72 | @item libgladeui must match Gtk+ version, optional (for gnunet-gtk) | ||
73 | @item libqrencode 3.0 or higher, optional (for gnunet-namestore-gtk) | ||
74 | @end table | ||
75 | |||
76 | 87 | ||
77 | @node Fixing libgnurl build issues | 88 | @node Fixing libgnurl build issues |
78 | @subsection Fixing libgnurl build issues | 89 | @subsection Fixing libgnurl build issues |
79 | 90 | ||
80 | If you have to compile libgnurl from source since the version included in your | 91 | If you have to compile libgnurl from source since the version included in |
81 | distribution is to old you perhaps get an error message while running the | 92 | your distribution is to old you perhaps get an error message while |
82 | @file{configure} script: | 93 | running the @file{configure} script: |
83 | 94 | ||
84 | @example | 95 | @example |
85 | $ configure | 96 | $ configure |
@@ -90,13 +101,32 @@ checking for 16-bit curl_off_t data type... unknown | |||
90 | configure: error: cannot find data type for curl_off_t. | 101 | configure: error: cannot find data type for curl_off_t. |
91 | @end example | 102 | @end example |
92 | 103 | ||
104 | @noindent | ||
93 | Solution: | 105 | Solution: |
94 | 106 | ||
95 | Before running the configure script, set: | 107 | Before running the configure script, set: |
96 | 108 | ||
97 | @code{CFLAGS="-I. -I$BUILD_ROOT/include" } | 109 | @example |
110 | CFLAGS="-I. -I$BUILD_ROOT/include" | ||
111 | @end example | ||
112 | |||
113 | @node Optional dependencies | ||
114 | @subsection Optional dependencies | ||
98 | 115 | ||
116 | These applications must be installed for various experimental or otherwise | ||
117 | optional features such as @code{gnunet-conversation}, @code{gnunet-gtk}. | ||
99 | 118 | ||
119 | @itemize @bullet | ||
120 | @item libpulse 2.0 or higher, optional (for gnunet-conversation) | ||
121 | @item libopus 1.0.1 or higher, optional (for gnunet-conversation) | ||
122 | @item libogg 1.3.0 or higher, optional (for gnunet-conversation) | ||
123 | @item certool (binary) optional @footnote{for convenient installation of | ||
124 | the GNS proxy (available as part of Debian's libnss3-tools)} | ||
125 | @item python-zbar 0.10 or higher, optional (for gnunet-qr) | ||
126 | @item Gtk+ 3.0 or higher, optional (for gnunet-gtk) | ||
127 | @item libgladeui must match Gtk+ version, optional (for gnunet-gtk) | ||
128 | @item libqrencode 3.0 or higher, optional (for gnunet-namestore-gtk) | ||
129 | @end itemize | ||
100 | 130 | ||
101 | @node Internal dependencies | 131 | @node Internal dependencies |
102 | @subsection Internal dependencies | 132 | @subsection Internal dependencies |
@@ -1627,13 +1657,22 @@ GNUnet uses the portable POSIX thread library for multi-threading..@ | |||
1627 | 1657 | ||
1628 | 1658 | ||
1629 | @item | 1659 | @item |
1630 | Save @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/libpthreadGC2.a, libpthreadGC2.a} (x86) or @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2.a} (x64) as libpthread.a into the lib directory (c:\mingw\mingw\lib\libpthread.a) | 1660 | Save @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86 |
1661 | /libpthreadGC2.a, libpthreadGC2.a} (x86) or @uref{ftp://sources.redhat.c | ||
1662 | om/pub/pthreads-win32/dll-latest/lib/x64/libpthreadGC2.a, libpthreadGC2. | ||
1663 | a} (x64) as libpthread.a into the lib directory (c:\mingw\mingw\lib\libpt | ||
1664 | hread.a) | ||
1631 | 1665 | ||
1632 | @item | 1666 | @item |
1633 | Save @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86/pthreadGC2.dll, pthreadGC2.dll} (x86) or @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} (x64) into the MinGW bin directory (c:\mingw\mingw\bin) | 1667 | Save @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/x86 |
1668 | /pthreadGC2.dll, pthreadGC2.dll} (x86) or @uref{ftp://sources.redhat.c | ||
1669 | om/pub/pthreads-win32/dll-latest/lib/x64/pthreadGC2.dll, libpthreadGC2.a} | ||
1670 | (x64) into the MinGW bin directory (c:\mingw\mingw\bin) | ||
1634 | 1671 | ||
1635 | @item | 1672 | @item |
1636 | Download all header files from @uref{ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/, include/} to the include directory (c:\mingw\mingw\include) | 1673 | Download all header files from @uref{ftp://sources.redhat.com/pub/pthread |
1674 | s-win32/dll-latest/include/, include/} to the @file{include} directory | ||
1675 | (c:\mingw\mingw\include) | ||
1637 | @end itemize | 1676 | @end itemize |
1638 | 1677 | ||
1639 | 1678 | ||
@@ -1643,7 +1682,9 @@ Download all header files from @uref{ftp://sources.redhat.com/pub/pthreads-win32 | |||
1643 | @ | 1682 | @ |
1644 | GNUnet uses the GNU Multiple Precision library for special cryptographic operations.@ | 1683 | GNUnet uses the GNU Multiple Precision library for special cryptographic operations.@ |
1645 | @ | 1684 | @ |
1646 | Get the GMP binary package from the @uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and unpack it to the MinGW directory (c:\mingw\mingw) | 1685 | Get the GMP binary package from the |
1686 | @uref{http://sourceforge.net/projects/mingwrep/, MinGW repository} and | ||
1687 | unpack it to the MinGW directory (c:\mingw\mingw) | ||
1647 | 1688 | ||
1648 | @item | 1689 | @item |
1649 | @strong{GNU Gettext}@ | 1690 | @strong{GNU Gettext}@ |
diff --git a/doc/gnunet-c-tutorial.texi b/doc/gnunet-c-tutorial.texi index 4949e2cce..87ae71e1e 100644 --- a/doc/gnunet-c-tutorial.texi +++ b/doc/gnunet-c-tutorial.texi | |||
@@ -200,6 +200,7 @@ $ wget https://ftp.gnu.org/gnu/gnunet/gnunet-@value{VERSION}.tar.gz.sig | |||
200 | $ gpg --verify-files gnunet-@value{VERSION}.tar.gz.sig | 200 | $ gpg --verify-files gnunet-@value{VERSION}.tar.gz.sig |
201 | @end example | 201 | @end example |
202 | 202 | ||
203 | @noindent | ||
203 | If this command fails because you do not have the required public key, | 204 | If this command fails because you do not have the required public key, |
204 | then you need to run this command to import it: | 205 | then you need to run this command to import it: |
205 | 206 | ||
@@ -455,6 +456,7 @@ $ mkdir ~/gnunet1/ | |||
455 | $ touch peer1.conf | 456 | $ touch peer1.conf |
456 | @end example | 457 | @end example |
457 | 458 | ||
459 | @noindent | ||
458 | Now add the following lines to @file{peer1.conf} to use this directory. | 460 | Now add the following lines to @file{peer1.conf} to use this directory. |
459 | For simplified usage we want to prevent the peer to connect to the GNUnet | 461 | For simplified usage we want to prevent the peer to connect to the GNUnet |
460 | network since this could lead to confusing output. This modifications | 462 | network since this could lead to confusing output. This modifications |
@@ -1004,10 +1006,12 @@ to actually process the message. Fixed size messages are fully | |||
1004 | checked by the MQ-logic, and thus only need to provide the handler | 1006 | checked by the MQ-logic, and thus only need to provide the handler |
1005 | to process the message. Note that the prefixes @code{check\_} | 1007 | to process the message. Note that the prefixes @code{check\_} |
1006 | and @code{handle\_} are mandatory. | 1008 | and @code{handle\_} are mandatory. |
1009 | |||
1007 | @example | 1010 | @example |
1008 | @verbatiminclude tutorial-examples/006.c | 1011 | @verbatiminclude tutorial-examples/006.c |
1009 | @end example | 1012 | @end example |
1010 | 1013 | ||
1014 | @noindent | ||
1011 | Exercise: Expand your helper function to receive a response message | 1015 | Exercise: Expand your helper function to receive a response message |
1012 | (for example, containing just the @code{struct GNUnet MessageHeader} | 1016 | (for example, containing just the @code{struct GNUnet MessageHeader} |
1013 | without any payload). Upon receiving the service's response, you | 1017 | without any payload). Upon receiving the service's response, you |
@@ -1183,10 +1187,12 @@ disconnection, CORE notifies the service that the peer disconnected. | |||
1183 | After this notification no more messages will be received from the | 1187 | After this notification no more messages will be received from the |
1184 | peer and the service is no longer allowed to send messages to the peer. | 1188 | peer and the service is no longer allowed to send messages to the peer. |
1185 | The disconnect callback looks like the following: | 1189 | The disconnect callback looks like the following: |
1190 | |||
1186 | @example | 1191 | @example |
1187 | @verbatiminclude tutorial-examples/011.c | 1192 | @verbatiminclude tutorial-examples/011.c |
1188 | @end example | 1193 | @end example |
1189 | 1194 | ||
1195 | @noindent | ||
1190 | Exercise: Fix your service to handle peer disconnects. | 1196 | Exercise: Fix your service to handle peer disconnects. |
1191 | 1197 | ||
1192 | @node Storing peer-specific data using the PEERSTORE service | 1198 | @node Storing peer-specific data using the PEERSTORE service |
@@ -1243,22 +1249,23 @@ guarantee that the record is successfully stored, only that it was | |||
1243 | received by the service. | 1249 | received by the service. |
1244 | 1250 | ||
1245 | The @code{GNUNET_PEERSTORE_store} function returns a handle to the store | 1251 | The @code{GNUNET_PEERSTORE_store} function returns a handle to the store |
1246 | operation. This handle can be used to cancel the store operation only before | 1252 | operation. This handle can be used to cancel the store operation only |
1247 | the continuation function is called: | 1253 | before the continuation function is called: |
1248 | 1254 | ||
1249 | @example | 1255 | @example |
1250 | void | 1256 | @verbatiminclude tutorial-examples/013.1.c |
1251 | GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc); | ||
1252 | @end example | 1257 | @end example |
1253 | 1258 | ||
1254 | @node Retrieving records | 1259 | @node Retrieving records |
1255 | @subsection Retrieving records | 1260 | @subsection Retrieving records |
1256 | 1261 | ||
1257 | To retrieve stored records, use the following function: | 1262 | To retrieve stored records, use the following function: |
1263 | |||
1258 | @example | 1264 | @example |
1259 | @verbatiminclude tutorial-examples/014.c | 1265 | @verbatiminclude tutorial-examples/014.c |
1260 | @end example | 1266 | @end example |
1261 | 1267 | ||
1268 | @noindent | ||
1262 | The values of @code{peer} and @code{key} can be @code{NULL}. This | 1269 | The values of @code{peer} and @code{key} can be @code{NULL}. This |
1263 | allows the iteration over values stored under any of the following | 1270 | allows the iteration over values stored under any of the following |
1264 | key combinations: | 1271 | key combinations: |
@@ -1323,10 +1330,12 @@ The DHT allows to store data so other peers in the P2P network can | |||
1323 | access it and retrieve data stored by any peers in the network. | 1330 | access it and retrieve data stored by any peers in the network. |
1324 | This section will explain how to use the DHT. Of course, the first | 1331 | This section will explain how to use the DHT. Of course, the first |
1325 | thing to do is to connect to the DHT service: | 1332 | thing to do is to connect to the DHT service: |
1333 | |||
1326 | @example | 1334 | @example |
1327 | @verbatiminclude tutorial-examples/018.c | 1335 | @verbatiminclude tutorial-examples/018.c |
1328 | @end example | 1336 | @end example |
1329 | 1337 | ||
1338 | @noindent | ||
1330 | The second parameter indicates how many requests in parallel to expect. | 1339 | The second parameter indicates how many requests in parallel to expect. |
1331 | It is not a hard limit, but a good approximation will make the DHT more | 1340 | It is not a hard limit, but a good approximation will make the DHT more |
1332 | efficient. | 1341 | efficient. |
diff --git a/doc/tutorial-examples/013.1.c b/doc/tutorial-examples/013.1.c new file mode 100644 index 000000000..fa5212868 --- /dev/null +++ b/doc/tutorial-examples/013.1.c | |||
@@ -0,0 +1,3 @@ | |||
1 | void | ||
2 | GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext | ||
3 | *sc); | ||
diff --git a/doc/tutorial-examples/016.c b/doc/tutorial-examples/016.c index d8db4b3b8..d169da16d 100644 --- a/doc/tutorial-examples/016.c +++ b/doc/tutorial-examples/016.c | |||
@@ -1,3 +1,4 @@ | |||
1 | void | 1 | void |
2 | GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext *wc); | 2 | GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext |
3 | *wc); | ||
3 | 4 | ||