Reticulum is the core service that coordinates all of the other Hubs modules (PostgREST, Dialog, etc.). To compile the Reticulum source code successfully, we will first install a number of necessary dependencies (sect. 1.1-1.3) before downloading Reticulum itself (sect. 1.4).
1.1. Configure PostgreSQL
PostgreSQL is a database management service used by Hubs. To begin, install PostgreSQL and start it:
In order for the Reticulum server to properly hook into the database locally, you must change some of the configurations for the postgres user. Switch to the postgres user and enter the psql command line:
You will be entered into the psql command line. Run the following psql commands (the semicolons are important). You will see ALTER ROLE display if you did it correctly.
postgres=# ALTER USER postgres WITH PASSWORD 'postgres';
ALTER ROLE
postgres=# ALTER USER postgres WITH SUPERUSER;
ALTER ROLE
postgres=# \q
postgres@<yourServer>$ exit
1.2. Install Erlang and Elixir
Reticulum is dependent on specific versions of Erlang and Elixir. In order to install the correct versions, we will use a software management tool called ASDF, because the usual package management software on Ubuntu (apt-get) lacks access to the versions we need. The following instructions are adapted from the ASDF website and this tutorial.
To get started, install ASDF by downloading the repo from GitHub:
Before continuing, log out of your user with the exit command and log back in to refresh your shell.
Once you've logged in again, you can use ASDF to install Erlang and Elixir as plugins. (Be sure to pay careful attention to the specified versions!) Start by installing Erlang:
The installation will take a while, during which Erlang will skip installing certain modules if you do not have the relevant services on your system. If you see warning messages about omitted modules, do not worry; it won't affect this tutorial.
The version of Elixir being installed is designed for maximum compatibility with Erlang 23.
Finally, you have to setup Erlang and Elixir for global access. Run the following:
$ asdf global erlang 23.3
$ asdf global elixir 1.12.3-otp-23
1.3. Install Coturn
One last dependency needs to be installed: Coturn. Thankfully, this one is straightforward:
$ sudo apt install coturn
With that, we are finally ready to download the Reticulum source code.
1.4. Setup Reticulum
Before beginning, create a folder in your home directory to work out of. The files for the different Hubs modules will end up here. Inside that folder, clone Reticulum from the Mozilla GitHub:
$ git clone https://github.com/mozilla/reticulum.git
$ cd reticulum
Inside the Reticulum directory you cloned from GitHub earlier, run the following:
$ mix deps.get
This installs a number of Reticulum-specific dependencies. As part of the process, it may prompt you to install one or more packages:
Respond yes to all of them. This should be the final output:
Then run the command to compile the Reticulum scripts:
$ mix ecto.create
The compilation process will take a long time, and you may see a number of warning messages about deprecated or incorrect code. You should be fine as long as you see this message at the end:
Finally, create a storage folder in the Reticulum directory:
$ mkdir -p storage/dev
Now Reticulum should be able to operate on its own! To test it, run iex -S mix phx.server from the Reticulum folder. If everything worked, you'll see output like this (you can exit by hitting Ctrl+C twice in a row):
With that done, you can proceed to part 2 of this tutorial, setting up Dialog, which can be found in #24.
Mozilla Hubs Installation Procedure
1. Reticulum
Reticulum is the core service that coordinates all of the other Hubs modules (PostgREST, Dialog, etc.). To compile the Reticulum source code successfully, we will first install a number of necessary dependencies (sect. 1.1-1.3) before downloading Reticulum itself (sect. 1.4).
1.1. Configure PostgreSQL
PostgreSQL is a database management service used by Hubs. To begin, install PostgreSQL and start it:
In order for the Reticulum server to properly hook into the database locally, you must change some of the configurations for the postgres user. Switch to the postgres user and enter the psql command line:
You will be entered into the psql command line. Run the following psql commands (the semicolons are important). You will see
ALTER ROLE
display if you did it correctly.1.2. Install Erlang and Elixir
Reticulum is dependent on specific versions of Erlang and Elixir. In order to install the correct versions, we will use a software management tool called ASDF, because the usual package management software on Ubuntu (
apt-get
) lacks access to the versions we need. The following instructions are adapted from the ASDF website and this tutorial.To get started, install ASDF by downloading the repo from GitHub:
This will place ASDF into the
.asdf
directory in your home folder.Then, to give your shell access to the ASDF commands, add the following lines to the file
~/.bashrc
(the periods are important):Before continuing, log out of your user with the
exit
command and log back in to refresh your shell.Once you've logged in again, you can use ASDF to install Erlang and Elixir as plugins. (Be sure to pay careful attention to the specified versions!) Start by installing Erlang:
The installation will take a while, during which Erlang will skip installing certain modules if you do not have the relevant services on your system. If you see warning messages about omitted modules, do not worry; it won't affect this tutorial.
After that finishes, install Elixir similarly:
The version of Elixir being installed is designed for maximum compatibility with Erlang 23.
Finally, you have to setup Erlang and Elixir for global access. Run the following:
1.3. Install Coturn
One last dependency needs to be installed: Coturn. Thankfully, this one is straightforward:
With that, we are finally ready to download the Reticulum source code.
1.4. Setup Reticulum
Before beginning, create a folder in your home directory to work out of. The files for the different Hubs modules will end up here. Inside that folder, clone Reticulum from the Mozilla GitHub:
Inside the Reticulum directory you cloned from GitHub earlier, run the following:
This installs a number of Reticulum-specific dependencies. As part of the process, it may prompt you to install one or more packages:
Respond yes to all of them. This should be the final output:
Then run the command to compile the Reticulum scripts:
The compilation process will take a long time, and you may see a number of warning messages about deprecated or incorrect code. You should be fine as long as you see this message at the end:
Finally, create a storage folder in the Reticulum directory:
Now Reticulum should be able to operate on its own! To test it, run
iex -S mix phx.server
from the Reticulum folder. If everything worked, you'll see output like this (you can exit by hitting Ctrl+C twice in a row):With that done, you can proceed to part 2 of this tutorial, setting up Dialog, which can be found in #24.