Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dunixir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
teaching
dunixir
Commits
1624e9b4
Commit
1624e9b4
authored
4 years ago
by
x18zhan2
Browse files
Options
Downloads
Patches
Plain Diff
Updated constants file and created a conf file
parent
e9dd18f2
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1327
failed
4 years ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/dunixir/conf_dto.ex
+106
-0
106 additions, 0 deletions
lib/dunixir/conf_dto.ex
lib/dunixir/constants.ex
+32
-0
32 additions, 0 deletions
lib/dunixir/constants.ex
with
138 additions
and
0 deletions
lib/dunixir/conf_dto.ex
0 → 100644
+
106
−
0
View file @
1624e9b4
defmodule
ConfDTO
do
alias
Constants
.
Contract
,
as:
Contract
alias
Constants
.
PoW
,
as:
PoW
def
defaultConf
()
do
%{
currency:
nil
,
endpoints:
[],
rmEndpoints:
[],
upInterval:
3600
*
1000
,
c:
Contract
.
c
,
dt:
Contract
.
dt
,
dtReeval:
Contract
.
dtReeval
,
ud0:
Contract
.
ud0
,
stepMax:
Contract
.
stepMax
,
sigPeriod:
Contract
.
sigPeriod
,
sigReplay:
Contract
.
sigReplay
,
sigValidity:
Contract
.
sigValidity
,
msValidity:
Contract
.
msValidity
,
sigQty:
Contract
.
sigQty
,
xpercent:
Contract
.
xpercent
,
percentRot:
Contract
.
percentRot
,
powDelay:
Contract
.
powDelay
,
avgGenTime:
Contract
.
avgGenTime
,
dtDiffEval:
Contract
.
dtDiffEval
,
medianTimeBlocks:
Contract
.
medianTimeBlocks
,
httplogs:
false
,
udid2:
false
,
timeout:
3000
,
isolate:
false
,
forksize:
Contract
.
forSize
,
switchOnHeadAdvance:
Contract
.
switchOnHeadAdvance
,
nonWoTPeersLimit:
Contract
.
nonWoTPeersLimit
,
txsMempoolSize:
Contract
.
txsMempoolSize
()
}
end
def
mockConfDTO
()
do
%{
loglevel:
""
,
currency:
""
,
endpoints:
[],
rmEndpoints:
[],
rootoffset:
0
,
upInterval:
3600
*
1000
,
cpu:
PoW
.
cpu
,
nbCores:
1
,
prefix:
PoW
.
prefix
,
powSecurityRetryDelay:
0
,
powMaxHandicap:
0
,
c:
Contract
.
c
,
dt:
Contract
.
dt
,
dtReeval:
Contract
.
dtReeval
,
dtDiffEval:
0
,
ud0:
Contract
.
ud0
,
udTime0:
0
,
udReevalTime0:
0
,
stepMax:
Contract
.
stepMax
,
sigPeriod:
Contract
.
sigPeriod
,
sigReplay:
Contract
.
sigReplay
,
msPeriod:
0
,
sigValidity:
Contract
.
sigValidity
,
msValidity:
Contract
.
msValidity
,
sigQty:
Contract
.
sigQty
,
sigStock:
Contract
.
sigStock
,
xpercent:
Contract
.
xpercent
,
percentRot:
Contract
.
percentRot
,
powDelay:
Contract
.
powDelay
,
avgGenTime:
Contract
.
avgGenTime
,
medianTimeBlocks:
Contract
.
medianTimeBlocks
,
httplogs:
false
,
timeout:
3000
,
isolate:
false
,
udid2:
false
,
timeout:
3000
,
isolate:
false
,
forksize:
Contract
.
forSize
,
idtyWindow:
Contract
.
idtyWindow
,
msWindow:
Contract
.
msWindow
,
sigWindow:
Contract
.
sigWindow
,
switchOnHeadAdvance:
0
,
pair:
%{
pub:
""
,
sec:
""
},
oldPair:
nil
,
salt:
""
,
passwd:
""
,
remoteport:
0
,
remotehost:
""
,
remoteipv4:
""
,
remoteipv6:
""
,
host:
""
,
port:
0
,
ipv4:
""
,
ipv6:
""
,
dos:
nil
,
upnp:
false
,
homename:
""
,
memory:
true
,
nobma:
true
,
bmaWithCrawler:
false
,
nonWoTPeersLimit:
100
,
proxiesConf:
nil
,
powNoSecurity:
false
,
storage:
nil
,
txsMempoolSize:
nil
}
end
end
This diff is collapsed.
Click to expand it.
lib/dunixir/constants.ex
+
32
−
0
View file @
1624e9b4
...
...
@@ -11,3 +11,35 @@ defmodule Constants do
def
sigPeriod
,
do
:
10
def
sigReplay
,
do
:
10
end
defmodule
Constants
.
Contract
do
def
c
,
do
:
0.007376575
def
dt
,
do
:
30.4375
*
24
*
3600
def
dtReeval
,
do
:
30.4375
*
24
*
3600
def
ud0
,
do
:
100
def
stepMax
,
do
:
3
def
msValidity
,
do
:
3600
*
24
*
365
def
sigValidity
,
do
:
3600
*
24
*
365
def
sigPeriod
,
do
:
0
def
sigReplay
,
do
:
0
def
sigWindow
,
do
:
3600
*
24
*
7
def
sigQty
,
do
:
5
def
xpercent
,
do
:
0.9
def
percentRot
,
do
:
2
/
3
def
powDelay
,
do
:
0
def
avgGenTime
,
do
:
16
*
60
def
dtDiffEval
,
do
:
10
def
medianTimeBlocks
,
do
:
20
def
forSize
,
do
:
100
def
switchOnHeadAdvance
,
do
:
3
def
nonWoTPeersLimit
,
do
:
100
def
txsMempoolSize
,
do
:
200
def
sigStock
,
do
:
40
def
idtyWindow
,
do
:
3600
*
24
*
7
def
msWindow
,
do
:
3600
*
24
*
7
end
defmodule
Constants
.
PoW
do
def
cpu
,
do
:
0.6
def
prefix
,
do
:
1
end
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