A) renaming to --repo-kind which makes more sense in the current code
and B) without a working cacheStore (yet)

Tagging related https://github.com/status-im/nim-codex/issues/357
This commit is contained in:
c-blake 2023-03-14 18:32:15 -04:00 committed by GitHub
parent 98f6bb4ed9
commit 7cdd4f79e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 2 deletions

View File

@ -54,6 +54,7 @@ The following options are available:
--max-peers The maximum number of peers to connect to [=160].
--agent-string Node agent string which is used as identifier in network [=Codex].
-p, --api-port The REST Api port [=8080].
--repo-kind backend for main repo store (fs, sqlite) [=fs].
-q, --storage-quota The size of the total storage quota dedicated to the node [=8589934592].
-t, --block-ttl Default block timeout in seconds - 0 disables the ttl [=86400].
-c, --cache-size The size in MiB of the block cache, 0 disables the cache - might help on slow

View File

@ -158,9 +158,14 @@ proc new*(T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey):
wallet = WalletRef.new(EthPrivateKey.random())
network = BlockExcNetwork.new(switch)
repoData = case config.repoKind
of repoFS: Datastore(FSDatastore.new($config.dataDir, depth = 5)
.expect("Should create repo file data store!"))
of repoSQLite: Datastore(SQLiteDatastore.new($config.dataDir)
.expect("Should create repo SQLite data store!"))
repoStore = RepoStore.new(
repoDs = Datastore(FSDatastore.new($config.dataDir, depth = 5)
.expect("Should create repo data store!")),
repoDs = repoData,
metaDs = SQLiteDatastore.new(config.dataDir / CodexMetaNamespace)
.expect("Should create meta data store!"),
quotaMaxBytes = config.storageQuota.uint,

View File

@ -46,6 +46,10 @@ type
Json = "json"
None = "none"
RepoKind* = enum
repoFS = "fs"
repoSQLite = "sqlite"
CodexConf* = object
logLevel* {.
defaultValue: "INFO"
@ -151,6 +155,12 @@ type
name: "api-port"
abbr: "p" }: int
repoKind* {.
desc: "backend for main repo store (fs, sqlite)"
defaultValueDesc: "fs"
defaultValue: repoFS
name: "repo-kind" }: RepoKind
storageQuota* {.
desc: "The size of the total storage quota dedicated to the node"
defaultValue: DefaultQuotaBytes