Commit 03eb18ba authored by pini's avatar pini
Browse files

feat: env vars for cpu and nbCores pow parameters

DUNITER_POW_CPU
DUNITER_POW_NBCORES
parent 2ae2c87d
Pipeline #13023 passed with stages
in 23 minutes and 22 seconds
......@@ -22,6 +22,14 @@ 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:
* `DUNITER_POW_PREFIX` (integer)
* `DUNITER_POW_CPU` (decimal number between 0 and 1)
* `DUNITER_POW_NBCORES` (integer)
## Configuring the network
### The APIs
......
......@@ -485,8 +485,8 @@ function commandLineConf(program:any, conf:any = {}) {
conf = conf || {};
const cli = {
currency: program.currency,
cpu: program.cpu,
nbCores: program.nbCores,
cpu: process.env.DUNITER_POW_CPU ? parseFloat(process.env.DUNITER_POW_CPU) : program.cpu,
nbCores: process.env.DUNITER_POW_NBCORES ? parseInt(process.env.DUNITER_POW_NBCORES) : program.nbCores,
prefix: program.prefix,
server: {
port: program.port,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment