Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-config
Commits
5c03f616
Commit
5c03f616
authored
Sep 24, 2020
by
gammazero
Committed by
Andrew Gillis
Oct 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add badger2 profile and config spec
parent
0b259059
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
init.go
init.go
+13
-0
profile.go
profile.go
+23
-2
No files found.
init.go
View file @
5c03f616
...
@@ -142,6 +142,19 @@ func badgerSpec() map[string]interface{} {
...
@@ -142,6 +142,19 @@ func badgerSpec() map[string]interface{} {
}
}
}
}
func
badger2Spec
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
"type"
:
"measure"
,
"prefix"
:
"badger2.datastore"
,
"child"
:
map
[
string
]
interface
{}{
"type"
:
"badger2ds"
,
"path"
:
"badger2ds"
,
"syncWrites"
:
false
,
"truncate"
:
true
,
},
}
}
func
flatfsSpec
()
map
[
string
]
interface
{}
{
func
flatfsSpec
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
return
map
[
string
]
interface
{}{
"type"
:
"mount"
,
"type"
:
"mount"
,
...
...
profile.go
View file @
5c03f616
...
@@ -130,7 +130,7 @@ This profile may only be applied when first initializing the node.
...
@@ -130,7 +130,7 @@ This profile may only be applied when first initializing the node.
This is the most battle-tested and reliable datastore, but it's significantly
This is the most battle-tested and reliable datastore, but it's significantly
slower than the badger datastore. You should use this datastore if:
slower than the badger datastore. You should use this datastore if:
* You need a very simple and very reliable datastore
you and
trust your
* You need a very simple and very reliable datastore
and you
trust your
filesystem. This datastore stores each block as a separate file in the
filesystem. This datastore stores each block as a separate file in the
underlying filesystem so it's unlikely to loose data unless there's an issue
underlying filesystem so it's unlikely to loose data unless there's an issue
with the underlying file system.
with the underlying file system.
...
@@ -152,7 +152,7 @@ This profile may only be applied when first initializing the node.
...
@@ -152,7 +152,7 @@ This profile may only be applied when first initializing the node.
"badgerds"
:
{
"badgerds"
:
{
Description
:
`Configures the node to use the badger datastore.
Description
:
`Configures the node to use the badger datastore.
This is
the faste
st datastore. Use this datastore if performance, especially
This is
a fa
st datastore. Use this datastore if performance, especially
when adding many gigabytes of files, is critical. However:
when adding many gigabytes of files, is critical. However:
* This datastore will not properly reclaim space when your datastore is
* This datastore will not properly reclaim space when your datastore is
...
@@ -170,6 +170,27 @@ This profile may only be applied when first initializing the node.`,
...
@@ -170,6 +170,27 @@ This profile may only be applied when first initializing the node.`,
return
nil
return
nil
},
},
},
},
"badger2ds"
:
{
Description
:
`Configures the node to use the badger2 datastore.
This is the fastest datastore. Use this datastore if performance, especially
when adding many gigabytes of files, is critical. However:
* This datastore will not properly reclaim space when your datastore is
smaller than several gigabytes. If you run IPFS with '--enable-gc' (you have
enabled block-level garbage collection), you plan on storing very little data in
your IPFS node, and disk usage is more critical than performance, consider using
flatfs.
* This datastore uses up to several gigabytes of memory.
This profile may only be applied when first initializing the node.`
,
InitOnly
:
true
,
Transform
:
func
(
c
*
Config
)
error
{
c
.
Datastore
.
Spec
=
badger2Spec
()
return
nil
},
},
"lowpower"
:
{
"lowpower"
:
{
Description
:
`Reduces daemon overhead on the system. May affect node
Description
:
`Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data
functionality - performance of content discovery and data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment