{% extends "common/base.j2" %} {% block body_content %}

{{ _("Tutorial: GNUnet on macOS 10.14 (Mojave)") }}

{{ _("Introduction") }}

Welcome to the hopefully painless GNUnet tutorial for macOS Mojave! It provides concrete instructions on how to install a current version of GNUnet. The goal is to support newcomers, either end users or developers, who want to get in touch with GNUnet for the first time. After installing GNUnet we will make sure that out new GNUnet installation is working correctly.

{{ _("Installation through homebrew") }}

{{ _("Requirements") }}

First, install homebrew and XCode. GNUnet is not yet in the official homebrew repos (we are working on it). So, you need to grab the formula from here and put it under the homebrew formula folder:

< $ cp gnunet.rb $(brew --repo homebrew/core)/Formula

Then install:

$ brew install gnunet

If you want to install GNUnet from git, execute:

$ brew install --HEAD gnunet

{{ _("Installation from source") }}

The following instructions are only really interesting for developers or if you need special build switches as you can install from git using homebrew (see above).
First, install the dependencies:

$ brew install git autoconf automake glpk gettext gnutls jansson libextractor libgcrypt libffi libidn2 libmicrohttpd libmpc libtool libunistring pkg-config unbound

Next, create a directory in your. This directory is where we store the source code later. You should keep this directory after installation because it contains Makefiles that can be used for uninstalling GNUnet again (see chapter *Uninstall GNUnet and its dependencies*).

$ mkdir ~/gnunet

{{ _("Get the source code") }}

$ cd ~
$ git clone --depth 1 https://gnunet.org/git/gnunet.git gnunet_src

{{ _("Compile and Install") }}

You have a choice between two options: build the *production version* or *development version*. If you want to start writing GNUnet applications or join the GNUnet development choose the development version (it will print more debug output and contains debug symbols that can be displayed with a debugger). Otherwise choose the production version.

{{ _("Option 1: GNUnet for production / usage") }}
$ cd ~/gnunet_src
$ ./bootstrap
$ export GNUNET_PREFIX=~/gnunet
$ ./configure --prefix=$GNUNET_PREFIX --disable-documentation

You might see configure failing telling you that it ``cannot run C compiled programs.''. In this case, you might need to open/run Xcode once and you will be prompted to install additonal packages. Then, you might have to manually install the command line tools from here https://developer.apple.com/download/more/ (you need an Apple ID for this). Install those and execute

$ open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

After configure passes, you need to add a 'gnunetdns' group using the macOS system preferences. Further, you need to add a user 'gnunet'. Then:

$ make
$ sudo make install
{{ _("Option 2: GNUnet experimental") }}

Perform the same steps as for Option 1, but add the configure flat '--enable-experimental'

{{ _("Install GNUnet plugin for name resolution") }}

Congratulations! GNUnet is now installed! Before we start it we need to create a configuration file. By default GNUnet looks in our home directory for the file `~/.gnunet/gnunet.conf`. We can start with an empty file for now:

$ touch ~/.config/gnunet.conf

Now we can start it with the command line tool `gnunet-arm` (Automatic Restart Manager).

$ gnunet-arm -s

It starts the default GNUnet services. We can list them with the `-I` option:

$ gnunet-arm -I
Running services:
ats (gnunet-service-ats)
revocation (gnunet-service-revocation)
set (gnunet-service-set)
nat (gnunet-service-nat)
transport (gnunet-service-transport)
peerstore (gnunet-service-peerstore)
hostlist (gnunet-daemon-hostlist)
identity (gnunet-service-identity)
namecache (gnunet-service-namecache)
peerinfo (gnunet-service-peerinfo)
datastore (gnunet-service-datastore)
zonemaster (gnunet-service-zonemaster)
zonemaster-monitor (gnunet-service-zonemaster-monitor)
nse (gnunet-service-nse)
cadet (gnunet-service-cadet)
dht (gnunet-service-dht)
core (gnunet-service-core)
gns (gnunet-service-gns)
statistics (gnunet-service-statistics)
topology (gnunet-daemon-topology)
fs (gnunet-service-fs)
namestore (gnunet-service-namestore)
vpn (gnunet-service-vpn)

For stopping GNUnet again we can use the `-e` option.

$ gnunet-arm -e

{{ _("Further information") }}

GNUnet has a number of services and features. Please check our documentation to learn how to use them. If you find anything odd or bugs, please let us know.

{% endblock body_content %}