Skip to content

Commit d9fee81

Browse files
authored
Remove linera-server initialize + simplify CLI options (#4111)
## Motivation * `linera-server initialize` is redundant with `linera storage initialize` * CLI arguments are duplicated in many places. * `StorageConfigNamespace` could have a simpler name ## Proposal * Remove `linera-server initialize` * Create `CommonStorageOptions` and used `#[Clap::flatten]` to share code between the different binaries. * Rename `StorageConfig` into `InnerStorageConfig` * Rename `StorageConfigNamespace` into `StorageConfig` `InnerStorageConfig` is still visible and used directly in a few places for now, but we'd like `StorageConfig` to be the real public type. NOTE: The common storage options are now prefixed with `--storage`, e.g. `--storage-cache-size`. ## Test Plan CI + `git grep linera-server` ## Release Plan - Nothing to do / These changes follow the usual release cycle.
1 parent 8e8d4ce commit d9fee81

File tree

10 files changed

+447
-494
lines changed

10 files changed

+447
-494
lines changed

CLI.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
108108

109109
###### **Options:**
110110

111-
* `--storage <STORAGE_CONFIG>` — Storage configuration for the blockchain history
112111
* `--wallet <WALLET_STATE_PATH>` — Sets the file storing the private state of user chains (an empty one will be created if missing)
113112
* `--keystore <KEYSTORE_PATH>` — Sets the file storing the keystore state
114113
* `-w`, `--with-wallet <WITH_WALLET>` — Given an ASCII alphanumeric parameter `X`, read the wallet state and the wallet storage config from the environment variables `LINERA_WALLET_{X}` and `LINERA_STORAGE_{X}` instead of `LINERA_WALLET` and `LINERA_STORAGE`
@@ -151,25 +150,26 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
151150
* `--blob-download-timeout-ms <BLOB_DOWNLOAD_TIMEOUT>` — The delay when downloading a blob, after which we try a second validator, in milliseconds
152151

153152
Default value: `1000`
154-
* `--max-concurrent-queries <MAX_CONCURRENT_QUERIES>` — The maximal number of simultaneous queries to the database
155-
* `--max-stream-queries <MAX_STREAM_QUERIES>` — The maximal number of simultaneous stream queries to the database
153+
* `--storage <STORAGE_CONFIG>` — Storage configuration for the blockchain history
154+
* `--storage-max-concurrent-queries <STORAGE_MAX_CONCURRENT_QUERIES>` — The maximal number of simultaneous queries to the database
155+
* `--storage-max-stream-queries <STORAGE_MAX_STREAM_QUERIES>` — The maximal number of simultaneous stream queries to the database
156156

157157
Default value: `10`
158-
* `--max-cache-size <MAX_CACHE_SIZE>` — The maximal memory used in the storage cache
158+
* `--storage-max-cache-size <STORAGE_MAX_CACHE_SIZE>` — The maximal memory used in the storage cache
159159

160160
Default value: `10000000`
161-
* `--max-entry-size <MAX_ENTRY_SIZE>` — The maximal size of an entry in the storage cache
161+
* `--storage-max-entry-size <STORAGE_MAX_ENTRY_SIZE>` — The maximal size of an entry in the storage cache
162162

163163
Default value: `1000000`
164-
* `--max-cache-entries <MAX_CACHE_ENTRIES>` — The maximal number of entries in the storage cache
164+
* `--storage-max-cache-entries <STORAGE_MAX_CACHE_ENTRIES>` — The maximal number of entries in the storage cache
165165

166166
Default value: `1000`
167-
* `--wasm-runtime <WASM_RUNTIME>` — The WebAssembly runtime to use
168-
* `--tokio-threads <TOKIO_THREADS>` — The number of Tokio worker threads to use
169-
* `--tokio-blocking-threads <TOKIO_BLOCKING_THREADS>` — The number of Tokio blocking threads to use
170167
* `--storage-replication-factor <STORAGE_REPLICATION_FACTOR>` — The replication factor for the keyspace
171168

172169
Default value: `1`
170+
* `--wasm-runtime <WASM_RUNTIME>` — The WebAssembly runtime to use
171+
* `--tokio-threads <TOKIO_THREADS>` — The number of Tokio worker threads to use
172+
* `--tokio-blocking-threads <TOKIO_BLOCKING_THREADS>` — The number of Tokio blocking threads to use
173173

174174

175175

docker/compose-server-init.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ while true; do
1111
exit 0
1212
elif [ $status -eq 1 ]; then
1313
echo "Database does not exist, attempting to initialize..."
14-
if ./linera-server initialize \
15-
--storage $storage \
16-
--genesis /config/genesis.json; then
14+
if ./linera storage initialize --storage $storage --genesis /config/genesis.json
15+
then
1716
echo "Initialization successful."
1817
exit 0
1918
else

docker/server-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ while true; do
1212
exit 0
1313
elif [ $status -eq 1 ]; then
1414
echo "Database does not exist, attempting to initialize..."
15-
if ./linera-server initialize \
15+
if ./linera storage initialize \
1616
--storage $storage \
1717
--genesis /config/genesis.json \
1818
--storage-replication-factor $storage_replication_factor; then

0 commit comments

Comments
 (0)