Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
f58c7c75
Unverified
Commit
f58c7c75
authored
7 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#1198
parent
4c67e0e8
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!1220
Stable/ws2p v1.1 trymerge
,
!1208
Stable/ws2p v1.1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/cli.ts
+1
-0
1 addition, 0 deletions
app/cli.ts
app/modules/prover/index.ts
+3
-0
3 additions, 0 deletions
app/modules/prover/index.ts
app/modules/prover/lib/engine.ts
+1
-1
1 addition, 1 deletion
app/modules/prover/lib/engine.ts
index.ts
+1
-0
1 addition, 0 deletions
index.ts
with
6 additions
and
1 deletion
app/cli.ts
+
1
−
0
View file @
f58c7c75
...
@@ -42,6 +42,7 @@ export const ExecuteCommand = () => {
...
@@ -42,6 +42,7 @@ export const ExecuteCommand = () => {
.
option
(
'
--remep <endpoint>
'
,
'
With `config` command, remove given endpoint to the list of endpoints of this node
'
)
.
option
(
'
--remep <endpoint>
'
,
'
With `config` command, remove given endpoint to the list of endpoints of this node
'
)
.
option
(
'
--cpu <percent>
'
,
'
Percent of CPU usage for proof-of-work computation
'
,
parsePercent
)
.
option
(
'
--cpu <percent>
'
,
'
Percent of CPU usage for proof-of-work computation
'
,
parsePercent
)
.
option
(
'
--nb-cores <number>
'
,
'
Number of cores uses for proof-of-work computation
'
,
parseInt
)
.
option
(
'
--prefix <nodeId>
'
,
'
Prefix node id for the first character of nonce
'
,
parseInt
)
.
option
(
'
--prefix <nodeId>
'
,
'
Prefix node id for the first character of nonce
'
,
parseInt
)
.
option
(
'
-c, --currency <name>
'
,
'
Name of the currency managed by this node.
'
)
.
option
(
'
-c, --currency <name>
'
,
'
Name of the currency managed by this node.
'
)
...
...
This diff is collapsed.
Click to expand it.
app/modules/prover/index.ts
+
3
−
0
View file @
f58c7c75
...
@@ -21,6 +21,9 @@ export const ProverDependency = {
...
@@ -21,6 +21,9 @@ export const ProverDependency = {
if
(
conf
.
cpu
===
null
||
conf
.
cpu
===
undefined
)
{
if
(
conf
.
cpu
===
null
||
conf
.
cpu
===
undefined
)
{
conf
.
cpu
=
Constants
.
DEFAULT_CPU
;
conf
.
cpu
=
Constants
.
DEFAULT_CPU
;
}
}
if
(
conf
.
nbCores
===
null
||
conf
.
nbCores
===
undefined
)
{
conf
.
nbCores
=
Math
.
min
(
Constants
.
CORES_MAXIMUM_USE_IN_PARALLEL
,
require
(
'
os
'
).
cpus
().
length
)
}
if
(
conf
.
prefix
===
null
||
conf
.
prefix
===
undefined
)
{
if
(
conf
.
prefix
===
null
||
conf
.
prefix
===
undefined
)
{
conf
.
prefix
=
Constants
.
DEFAULT_PEER_ID
;
conf
.
prefix
=
Constants
.
DEFAULT_PEER_ID
;
}
}
...
...
This diff is collapsed.
Click to expand it.
app/modules/prover/lib/engine.ts
+
1
−
1
View file @
f58c7c75
...
@@ -20,7 +20,7 @@ export class PowEngine {
...
@@ -20,7 +20,7 @@ export class PowEngine {
constructor
(
private
conf
:
ConfDTO
,
logger
:
any
)
{
constructor
(
private
conf
:
ConfDTO
,
logger
:
any
)
{
// We use as much cores as available, but not more than CORES_MAXIMUM_USE_IN_PARALLEL
// We use as much cores as available, but not more than CORES_MAXIMUM_USE_IN_PARALLEL
this
.
nbWorkers
=
(
conf
&&
conf
.
nbCores
)
||
Math
.
min
(
Constants
.
CORES_MAXIMUM_USE_IN_PARALLEL
,
require
(
'
os
'
).
cpus
().
length
)
this
.
nbWorkers
=
conf
.
nbCores
this
.
cluster
=
new
PowCluster
(
this
.
nbWorkers
,
logger
)
this
.
cluster
=
new
PowCluster
(
this
.
nbWorkers
,
logger
)
this
.
id
=
this
.
cluster
.
clusterId
this
.
id
=
this
.
cluster
.
clusterId
}
}
...
...
This diff is collapsed.
Click to expand it.
index.ts
+
1
−
0
View file @
f58c7c75
...
@@ -444,6 +444,7 @@ function commandLineConf(program:any, conf:any = {}) {
...
@@ -444,6 +444,7 @@ function commandLineConf(program:any, conf:any = {}) {
const
cli
=
{
const
cli
=
{
currency
:
program
.
currency
,
currency
:
program
.
currency
,
cpu
:
program
.
cpu
,
cpu
:
program
.
cpu
,
nbCores
:
program
.
nbCores
,
prefix
:
program
.
prefix
,
prefix
:
program
.
prefix
,
server
:
{
server
:
{
port
:
program
.
port
,
port
:
program
.
port
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment