Table des matières
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
Configuring the proof of work parameters
The PoW prefix, cpu usage, and number of workers can be configured with these environment variables:
DUNITER_POW_CPU(decimal number between 0 and 1)
Configuring the network
2.0.x there are two APIs (Application Programming Interface) allowing your node to communicate with other programs.
- 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.
- 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:
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:
You can define a remote path:
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
GVA is still disabled by default, to enable it:
Each parameter value can be defined by the environment variable of the parameter name in uppercase prefixed by
|parameter||env var name||type||default value|