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
7a401afb
Commit
7a401afb
authored
6 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[enh] Gather LevelDB data into a new `data/` dir
parent
b4f82f2c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/system/directory.ts
+4
-2
4 additions, 2 deletions
app/lib/system/directory.ts
server.ts
+2
-1
2 additions, 1 deletion
server.ts
with
6 additions
and
3 deletions
app/lib/system/directory.ts
+
4
−
2
View file @
7a401afb
...
@@ -118,7 +118,7 @@ export const MemFS = (initialTree:{ [folder:string]: { [file:string]: string }}
...
@@ -118,7 +118,7 @@ export const MemFS = (initialTree:{ [folder:string]: { [file:string]: string }}
export
const
Directory
=
{
export
const
Directory
=
{
DATA_FILES
:
[
'
mindex.db
'
,
'
c_mindex.db
'
,
'
iindex.db
'
,
'
cindex.db
'
,
'
sindex.db
'
,
'
wallet.db
'
,
'
dividend.db
'
,
'
txs.db
'
,
'
peers.db
'
],
DATA_FILES
:
[
'
mindex.db
'
,
'
c_mindex.db
'
,
'
iindex.db
'
,
'
cindex.db
'
,
'
sindex.db
'
,
'
wallet.db
'
,
'
dividend.db
'
,
'
txs.db
'
,
'
peers.db
'
],
DATA_DIRS
:
[
'
level_dividend
'
,
'
level_bindex
'
,
'
level_blockchain
'
,
'
level_sindex
'
,
'
level_cindex
'
,
'
level_iindex
'
,
'
level_mindex
'
,
'
level_wallet
'
],
DATA_DIRS
:
[
'
data
'
],
INSTANCE_NAME
:
getDomain
(
opts
.
mdb
),
INSTANCE_NAME
:
getDomain
(
opts
.
mdb
),
INSTANCE_HOME
:
getHomePath
(
opts
.
mdb
,
opts
.
home
),
INSTANCE_HOME
:
getHomePath
(
opts
.
mdb
,
opts
.
home
),
...
@@ -145,7 +145,9 @@ export const Directory = {
...
@@ -145,7 +145,9 @@ export const Directory = {
return
LevelDBDriver
.
newMemoryInstance
()
return
LevelDBDriver
.
newMemoryInstance
()
}
}
// Or file
// Or file
const
levelDBPath
=
path
.
join
(
home
||
Directory
.
INSTANCE_HOME
,
dbName
)
const
levelDbRootPath
=
path
.
join
(
home
,
'
data
'
,
'
leveldb
'
)
await
RealFS
().
fsMakeDirectory
(
levelDbRootPath
)
const
levelDBPath
=
path
.
join
(
levelDbRootPath
,
dbName
)
return
LevelDBDriver
.
newFileInstance
(
levelDBPath
)
return
LevelDBDriver
.
newFileInstance
(
levelDBPath
)
},
},
...
...
This diff is collapsed.
Click to expand it.
server.ts
+
2
−
1
View file @
7a401afb
...
@@ -453,7 +453,8 @@ export class Server extends stream.Duplex implements HookableServer {
...
@@ -453,7 +453,8 @@ export class Server extends stream.Duplex implements HookableServer {
await
this
.
dal
.
cleanCaches
();
await
this
.
dal
.
cleanCaches
();
this
.
dal
.
wotb
.
resetWoT
();
this
.
dal
.
wotb
.
resetWoT
();
const
files
=
[
'
stats
'
,
'
cores
'
,
'
current
'
,
Directory
.
DUNITER_DB_NAME
,
Directory
.
DUNITER_DB_NAME
+
'
.db
'
,
Directory
.
DUNITER_DB_NAME
+
'
.log
'
];
const
files
=
[
'
stats
'
,
'
cores
'
,
'
current
'
,
Directory
.
DUNITER_DB_NAME
,
Directory
.
DUNITER_DB_NAME
+
'
.db
'
,
Directory
.
DUNITER_DB_NAME
+
'
.log
'
];
const
dirs
=
[
'
loki
'
,
'
blocks
'
,
'
ud_history
'
,
'
branches
'
,
'
certs
'
,
'
txs
'
,
'
cores
'
,
'
sources
'
,
'
links
'
,
'
ms
'
,
'
identities
'
,
'
peers
'
,
'
indicators
'
,
'
leveldb
'
];
const
dirs
=
[
'
loki
'
,
'
blocks
'
,
'
ud_history
'
,
'
branches
'
,
'
certs
'
,
'
txs
'
,
'
cores
'
,
'
sources
'
,
'
links
'
,
'
ms
'
,
'
identities
'
,
'
peers
'
,
'
indicators
'
,
'
leveldb
'
]
.
concat
(
Directory
.
DATA_DIRS
)
return
this
.
resetFiles
(
files
,
dirs
);
return
this
.
resetFiles
(
files
,
dirs
);
}
}
...
...
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