1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
|
{% extends "common/base.j2" %}
{% block body_content %}
<article class="container">
<!--<article> -->
<div class="container">
<div class="row">
<div class="container">
<header>
<h1 class="text-center">{{ _("How to use GNUnet - in a nutshell") }}</h1>
</header>
</div>
</div>
</div>
<section>
<p>
This document is just a brief intro on what can be done with GNUnet. Find much more in our <a ref="https://docs.gnunet.org/">handbook / reference manual</a>, e.g. in the section <a href="https://docs.gnunet.org/#toc-Using-GNUnet-1">"using GNUnet"</a>.
</p>
</section>
<section>
<h3>{{ _("Make sure your GNUnet installation works...") }}</h3>
<p>After installing and starting GNUnet you should make sure that your peer is connecting
to the P2P-network. By typing gnunet-core you should see something like this:
</p>
<p>
<code>
$ gnunet-core <br>
Tue Oct 30 19:58:48 2018: connection established DSTJ (timeout in 293 s)<br>
Tue Oct 30 19:58:48 2018: connection established A4MK (timeout in 292 s)<br>
Tue Oct 30 19:58:48 2018: connection established 7WRD (timeout in 299 s)<br>
Tue Oct 30 19:58:48 2018: connection established 5WBG (timeout in 299 s)<br>
</code>
</p>
</section>
<section>
<h4>{{ _("... and play around with it.") }}</h4>
<p>
So let's try out some of GNUnet's use cases. Please mind that some should be done in a particular order, one after another:
</p>
<ul>
<li>filesharing</li>
<li>A simple chat using CADET</li>
<li>Another simple chat using a nim client</i>
<li>Name resolution using GNS on the command line</li>
<li>Name resolution using GNS with a browser (do it on the command line first)</li>
<li>Serving a website using VPN (do name resolution with a browser first)</li>
</ul>
</section>
<section>
<h4>{{ _("Filesharing") }}</h4>
<p>
Let's publish a file in the GNUnet filesharing network. We use the keywords
("commons" and "state") so other people will be able to search for the file.
</p>
<p>
We can choose any file and describe it with meaningful keywords (using the
`-k` command line option).
</p>
<p>
<code>
$ gnunet-publish -k commons -k state ostrom.pdf<br>
Publishing `/home/myself/ostrom.pdf' done.<br>
URI is `gnunet://fs/chk/M57SXDJ72EWS25CT6307KKJ8K0GCNSPTAZ649NA1NS10MJB4A1GZ9EN4Y02KST9VA5BHE8B335RPXQVBWVZ587Y83WQ7J3DHMBX30Q8.DHNGBN4CB2DBX1QRZ1R0B1Q18WTEAK4R94S9D57C9JMJJ3H7SSQDCV4D1218C4S2VP085AMQQSMG18FCP6NQMZQZJ91XR5NBX7YF0V0.42197237'.
</code>
</p>
<p>
Finding the file by keyword works with `gnunet-search`.
</p>
<p>
<code>
$ gnunet-search commons<br>
#1:<br>
gnunet-download -o "ostrom.pdf" gnunet://fs/chk/M57SXDJ72EWS25CT6307KKJ8K0GCNSPTAZ649NA1NS10MJB4A1GZ9EN4Y02KST9VA5BHE8B335RPXQVBWVZ587Y83WQ7J3DHMBX30Q8.DHNGBN4CB2DBX1QRZ1R0B1Q18WTEAK4R94S9D57C9JMJJ3H7SSQDCV4D1218C4S2VP085AMQQSMG18FCP6NQMZQZJ91XR5NBX7YF0V0.42197237
</code>
</p>
<p>
It gives us the command line call to download the file (and store it as
ostrom.pdf)!
</p>
<p>
Please also refer to the chapter on <a href="=> https://docs.gnunet.org/#File_002dsharing
">filesharing in the handbook</a>.
</section>
<section>
<h4>{{ _("CADET (and Chat)") }}</h4>
<p>
We can use the `gnunet-cadet` command line tool to open a port and from
another machine connect to this port and chat or transfer data. First we need
our *peer ID* of the GNUnet peer opening the port.
</p>
<p>
<code>
$ gnunet-peerinfo -s<br>
I am peer `P4T5GHS1PCZ06R82D3KW8Z8J1113BQZWAWGYHTZ8G1ZXMWXQGAVG'.
</code>
</p>
<p>
Now we open the port (it can be any string!):
</p>
<p>
<code>
$ gnunet-cadet -o my-secret-port
</code>
</p>
<p>On the other machine we can connect using the peer ID and the port and start chatting!</p>
<p>
<code>
$ gnunet-cadet P4T5GHS1PCZ06R82D3KW8Z8J1113BQZWAWGYHTZ8G1ZXMWXQGAVG my-secret-port
</code>
</p>
<p>
If you are interested into CADET in detail, please have a look in the <a href="https://docs.gnunet.org/#CADET-Subsystem">chapter "Cadet-Subsystem" in our handbook</a>.
</p>
</section>
<section>
<h4>{{ _("Chatting with a (simple) client") }}</h4>
<p>
To chat a tiny bit prettier, we need to install and compile additional software.
If you join the chat mentioned below and no one is there, feel free to ping on
IRC/freenode #gnunet and ask if someone can join to test with you! (But we are
trying to be there as often as possible).
</p>
<p>
<code>
$ git clone https://gnunet.org/git/gnunet-nim.git<br>
$ cd gnunet-nim/examples<br>
$ nim c groupchat.nim<br>
</code>
<p>
<p>
Fine! We can now try to enter a chat server running on another GNUnet node.
</p>
<p>
<code>
$LD_LIBRARY_PATH=/path/to/gnunetlibs ./groupchat --config=/path/to/gnunet.conf --server=YV6G9EP9K3X41BM3FJ3D29BDZR6358XNZ6KDZVV7DFW729YB0KCG --port=welcome --nick=YOURNICK
</code>
<p>
<p>
You should now see something like this:
</p>
<p>
<code>
> 2018-10-30 19:50:10 Welcome 8Q2T! participants: @[]<br>
Hello GNUnet!<br>
2018-10-30 19:52:53 [8Q2T] Hello GNUnet!<br>
</code>
<p>
<p>
Here we have typed "Hello gnunet!" to standard in which is then written out to standard out after having been sent back from GNUnet.
</p>
</section>
<section>
<h4>{{ _("Name resolution using GNS on the command line") }}</h4>
<p>GNS is the GNU name service, a fully decentralized alternatice to DNS. We'll publish an IP address in a GNS record try to resolve it on the command line. First we need an identity which is the
equivalent to a zone in DNS. We'll call it "myself" and create it using the
`gnunet-identity` command line tool. Instead of "myself" you can surely use your
nick or any other name. </p>
<p>
<code>
$ gnunet-identity -C myself
</code>
</p>
<p>We can check if it worked using the same tool. We expect the name of our identity and the corresponding public key to be displayed.</p>
<p>
<code>
$ gnunet-identity -d<br>
myself - HWTYD3P5D77JVFNVMZ1M5T10V4SZYNMY3PCGQCSVENKD6ZCRKPMG
</code>
</p>
<p>
Now we add a public `A` record to our zone. It has the name "ccc", a value
of "195.54.164.39" and it expires after one day.
</p>
<p>
<code>
$ gnunet-namestore -z myself -a -e "1 d" -p -t A -n ccc -V 195.54.164.39
</code>
</p>
<p>Now we can query that record using the command line tool `gnunet-gns`.</p>
<p>
<code>
$ gnunet-gns -t A -u ccc.myself<br>
ccc.myself:<br>
Got `A' record: 195.54.164.39
</code>
</p>
<p>
So it worked! But only resolving our own records is boring. So we
can give our identity (the public key of it to be precise) to
someone else so they can try to resolve our records, too. The
other person (Bob) has to add it to his namestore like this:
</p>
<p>
<code>
$ gnunet-namestore -z myself -a -e never -p -t PKEY -n alice -V HWTYD3P5D77JVFNVMZ1M5T10V4SZYNMY3PCGQCSVENKD6ZCRKPMG
</code>
</p>
<p>
Our identity in Bobs namestore is a public record (-p) and never
expires (-e never). Now Bob (let's assume he has called his
identity myself, too) should be able to resolve our "ccc" record,
too!
</p>
<p>
<code>
$ gnunet-gns -t A -u ccc.alice.myself<br>
ccc.alice.myself:<br>
Got `A' record: 195.54.164.39
</code>
</p>
<p>
It can continue like this. A friend of Bob would be able to
resolve our records too because Bob published our identity in a
public record. Bobs friend would simply use "ccc.alice.bob.myself"
to resolve our "ccc" record.
</p>
<p>
See the <a href="https://docs.gnunet.org/#First-steps-_002d-Using-the-GNU-Name-System">chapter "Using the GNU Name System" in our handbook</a> for a more detailed documentation.
</p>
</section>
<section>
<h4>{{ _("Name resolution using GNS with a browser") }}</h4>
<p>
In the previous use case "Name resolution using GNS on the command line" we got an idea
about what GNS is about, but now let's use it with a browser, to make it actually useful. Currently Firefox and Chromium are known to work.
</p>
<p>
Many websites enforce HTTPS and thus provide certificates for
their hostnames (and not our GNS names). Browsers don't like wrong
hostnames in certificates and will present error messages. So GNUnet
has to trick them by generating own certificates for our GNS
names. This means we need to create our own certificate authority
and tell our browser about it. Luckily there's a script for it:
</p>
<p>
<code>
$ gnunet-gns-proxy-setup-ca
</code>
</p>
<p>After executing this script the Browser has to be restarted.</p>
<p>
GNUnet provides a proxy service (gnunet-gns-proxy) that the
browser can send DNS and HTTP traffic to. It will try to resolve
names with GNS first and forward the rest of the DNS traffic to
the system's DNS resolver. It will also take care of the HTTP
traffic, so the browser gets valid certificates and the web server
will not be confused by our GNS hostnames. Our GNS namestore
doesn't know about any DNS hostnames yet, so we have to store
them, too. For our "ccc" A record, we have to store a LEHO (legacy
hostname) record, too. It must contain the website's original DNS
hostname:
</p>
<p>
<code>
$ gnunet-namestore -z myself -a -e "1 d" -p -t LEHO -n ccc -V www.ccc.de
</code>
</p>
<p>Now let's start gnunet-gns-proxy.</p>
<p>
<code>
$ /usr/lib/gnunet/libexec/gnunet-gns-proxy
</code>
</p>
<p>
Our browser has to be configured so it uses our proxy. In Firefox
we have to set these options under "about:config":
</p>
<p>
<code>
network.proxy.socks: localhost<br>
network.proxy.socks_port: 7777<br>
network.proxy.socks_remote_dns true<br>
network.proxy.type: 1
</code>
</p>
<p>
To tell Chromium to use the proxy, it has to be started with the
"--proxy-server" command line option:
</p>
<p>
<code>
$ chromium --proxy-server="socks5://127.0.0.1:7777"
</code>
</p>
<p>
Now we should be able to resolve our GNS names in the browser! We
just have to type "https://ccc.myself" into the address bar. If
our friend Bob prepared his system, too, he can resolve our record
by typing "ccc.alice.myself".
</p>
<p>
See the <a href="https://docs.gnunet.org/#Integration-with-Browsers">chapter on Integration with Browsers in our handbook</a> for a more detailed description.
</p>
</section>
<section>
<h4>{{ _("VPN") }}</h4>
<p>
TBD, see <a href="https://docs.gnunet.org/#Configuring-the-GNUnet-VPN">chapter "Configuring the GNUnet VPN" in the handbook.</a>
</p>
</section>
<section>
<h4>{{ _("Conversation") }}</h4>
<p>
TBD, see <a href="hhttps://docs.gnunet.org/#First-steps-_002d-Using-GNUnet-Conversation">chapter "Using GNUnet Conversation" in the handbook.</a>
</p>
</section>
</article>
{% endblock body_content %}
|