Make it clear in CLI that paritydb is experimental (#8152)

* Make it clear in CLI that paritydb is experimental

Sadly this is a breaking change for the CLI.

* Update client/cli/src/params/database_params.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2021-02-18 14:58:01 +01:00
committed by GitHub
parent 0b6fbe7315
commit b2021030cc
2 changed files with 28 additions and 10 deletions
+26 -9
View File
@@ -165,18 +165,35 @@ impl Into<sc_service::config::RpcMethods> for RpcMethods {
}
}
arg_enum! {
/// Database backend
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy)]
pub enum Database {
// Facebooks RocksDB
RocksDb,
// ParityDb. https://github.com/paritytech/parity-db/
ParityDb,
/// Database backend
#[derive(Debug, Clone, Copy)]
pub enum Database {
/// Facebooks RocksDB
RocksDb,
/// ParityDb. https://github.com/paritytech/parity-db/
ParityDb,
}
impl std::str::FromStr for Database {
type Err = String;
fn from_str(s: &str) -> Result<Self, String> {
if s.eq_ignore_ascii_case("rocksdb") {
Ok(Self::RocksDb)
} else if s.eq_ignore_ascii_case("paritydb-experimental") {
Ok(Self::ParityDb)
} else {
Err(format!("Unknwon variant `{}`, known variants: {:?}", s, Self::variants()))
}
}
}
impl Database {
/// Returns all the variants of this enum to be shown in the cli.
pub fn variants() -> &'static [&'static str] {
&["rocksdb", "paritydb-experimental"]
}
}
arg_enum! {
/// Whether off-chain workers are enabled.
@@ -29,6 +29,7 @@ pub struct DatabaseParams {
alias = "db",
value_name = "DB",
case_insensitive = true,
possible_values = &Database::variants(),
)]
pub database: Option<Database>,
@@ -38,7 +39,7 @@ pub struct DatabaseParams {
/// Enable storage chain mode
///
/// This changes the storage format for blocks bodys.
/// This changes the storage format for blocks bodies.
/// If this is enabled, each transaction is stored separately in the
/// transaction database column and is only referenced by hash
/// in the block body column.