Logo Decentralized Social Network

Development Environment

To start working with Moera, you need at least three components. You don’t need to build and install all of them — you may use those that are publicly available until you plan to make changes to the code. These components are:

  1. Naming service. By default, naming-dev.moera.org is used. For development, build and run moera-naming (see README.md for details).
  2. Node. You may get one from moera.blog provider. For development, build and run moera-node (see README.md for details).
  3. Client. By default, web.moera.org client is used. For development, build and run moera-client-react (see README.md for details).

For local installation of naming and node servers, you need to have Java 17+ and PostgreSQL 9.6+ installed. In all major Linux distributions, you can install them from the main package repository. For development, you can use one PostgreSQL instance for both node and naming servers.

If you install several components on the same host, note to choose different port numbers for them. By default, they are 8080, 8081 and 3000 for naming, node and client respectively.

Secure context (HTTPS)

Some browser APIs require a secure context (HTTPS). For example, those working with the clipboard. For this purpose, you may configure your local development environment to serve the client over HTTPS as described below.

If the client is served over HTTPS, modern browsers do not allow fetching unencrypted content by HTTP (see mixed active content). It means that Moera nodes must also be served over HTTPS; otherwise the browser will not allow the client to access nodes. It also will not be possible to access a naming server by HTTP.

The simplest way to serve the client over HTTPS is to use a self-signed certificate. mkcert11 is a great tool for this purpose. If you did not use it before, install it and run mkcert -install to create the root certificate authority (CA) in your system trust store. After that, run mkcert localhost to create a certificate for localhost, or use any other domain name you want.

To enable HTTPS in the client, create .ssl/ directory in the client root and copy the certificate and key files to it. run script will detect this directory automatically and enable the HTTPS configuration.

For the node, you will need to add the following settings to application-dev.yml:

server:
  ssl:
     enabled: true
     certificate: "file:.ssl/localhost.pem"
     certificate-private-key: "file:.ssl/localhost-key.pem"