Skip to content

Commit

Permalink
feat: add leveldb spec, from go-ipfs-config
Browse files Browse the repository at this point in the history
  • Loading branch information
xrypto.c committed Oct 21, 2024
1 parent 5a32936 commit 3ae857a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,26 @@ func badgerSpec() map[string]interface{} {
"syncWrites": false,
"truncate": true,
},
"crust": "http://127.0.0.1:12222/api/v0",
}
}

func leveldbSpec() map[string]interface{} {
return map[string]interface{}{
"type": "mount",
"mounts": []interface{}{
map[string]interface{}{
"mountpoint": "/",
"type": "measure",
"prefix": "leveldb.datastore",
"child": map[string]interface{}{
"type": "levelds",
"path": "datastore",
"compression": "none",
},
},
},
"crust": "http://127.0.0.1:12222/api/v0",
}
}

Expand Down Expand Up @@ -188,6 +208,7 @@ func flatfsSpec() map[string]interface{} {
},
},
},
"crust": "http://127.0.0.1:12222/api/v0",
}
}

Expand Down
9 changes: 9 additions & 0 deletions config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ NOTE: This profile may only be applied when first initializing node at IPFS_PATH
return nil
},
},
"leveldb": {
Description: `Only use leveldb`,

InitOnly: true,
Transform: func(c *Config) error {
c.Datastore.Spec = leveldbSpec()
return nil
},
},
"lowpower": {
Description: `Reduces daemon overhead on the system. May affect node
functionality - performance of content discovery and data
Expand Down

0 comments on commit 3ae857a

Please sign in to comment.