Table des matières

  1. Configuring the cryptographic keypair
  2. Configuring the proof of work parameters
  3. Configuring the network
    1. The APIs
    2. Configuring WS2P Public
      1. Configure a WS2P endpoint
      2. WS2P preferred and privileged nodes
    3. Configuring GVA

Title: Configure Duniter server variant with environment variables Order: 9 Date: 2021-05-07 Slug: configurer Authors: elois

Configure Duniter (server variant) with environment variables

This tutorial shows how to configure duniter by setting environment variables. It is also possible to configure duniter on command line.

Configuring the cryptographic keypair

All duniter nodes have a cryptographic keypair, which they use to sign the information they transmit over the network. There are two types of duniter nodes:

1. member nodes: If the node's keypair corresponds to a member identity, then the node is a "member" node, and will automatically take part in the calculation of the blocks.

2. Mirror nodes: If the node's keypair does not match a member identity, then the node is "mirror" type, it will not be able to write a block, but will still be useful for network resilience and for responding to client requests.

By default this keypair is random, so the duniter node is a mirror node.

To modify the keypair of the node, you must create a keypair in a file and indicate the path to this file with the environment variable DUNITER_KEYFILE.

Configuring the proof of work parameters

The PoW prefix, cpu usage, and number of workers can be configured with these environment variables:

Configuring the network

The APIs

In version 2.0.x there are two APIs (Application Programming Interface) allowing your node to communicate with other programs.

  1. WS2P (WebSocketToPeer): this API is dedicated to inter-node communication, i.e. between your duniter node and other nodes of the same currency. WS2P is enabled by default on your duniter node.
  2. GVA (Graphql Verification Api): this API is dedicated to the communication with client software (Ğecko, Tikka, ğcli, etc), it can also be used by any external program wishing to request the network (a website that would like to check the presence of a blockchain transaction for example). GVA is disabled by default on your duniter node.

Configuring WS2P Public

This mode is disabled by default, in order for it to work you must configure a WS2P endpoint that other duniter nodes will be able to use to reach you.

First enable the public WS2P mode:

DUNITER_WS2P_PUBLIC="true"

Configure a WS2P endpoint

For WS2P Public to work you must configure a WS2P endpoint that other duniter nodes will be able to use to reach you.

If you use a reverse proxy, you must define "remote" host and port:

DUNITER_WS2P_REMOTE_HOST="mydomaine.tld"
DUNITER_WS2P_REMOTE_PORT="443"

You can define a remote path:

DUNITER_WS2P_REMOTE_PATH="/ws2p"

If you not use a reverse proxy, you can expose duniter directly

DUNITER_WS2P_HOST="<your public IP>"
DUNITER_WS2P_PORT="your opened port"

WS2P preferred and privileged nodes

See dedicated page

Configuring GVA

GVA is still disabled by default, to enable it:

DUNITER_GVA_ENABLED="true"

Each parameter value can be defined by the environment variable of the parameter name in uppercase prefixed by DUNITER_GVA_.

parameterenv var nametypedefault value
enabledDUNITER_GVA_ENABLEDbooleanfalse
ip4DUNITER_GVA_IP4IPv40.0.0.0
ip6DUNITER_GVA_IP6IPv6::
portDUNITER_GVA_PORTnumber30901
pathDUNITER_GVA_PATHstring"gva"
remoteHostDUNITER_GVA_REMOTE_HOSTstringip4 [ip6]
remotePortDUNITER_GVA_REMOTE_PORTstringport
remotePathDUNITER_GVA_REMOTE_PATHstring"gva"
subscriptionsPathDUNITER_GVA_SUBSCRIPTIONS_PATHstring"gva-sub"
remoteSubscriptionsPathDUNITER_GVA_REMOTE_SUBSCRIPTIONS_PATHstring"gva-sub"
remoteTlsDUNITER_GVA_REMOTE_TLSbooleanfalse
whitelistDUNITER_GVA_WHITELISTIP[]["127.0.0.1", "::1"]