document zebrad enviroment variables

This commit is contained in:
Alfredo Garcia 2020-07-28 15:17:50 -03:00 committed by Henry de Valence
parent ef0b200b82
commit 6297a7cd19
1 changed files with 27 additions and 0 deletions

View File

@ -24,6 +24,33 @@ use std::path::PathBuf;
pub const CONFIG_FILE: &str = "zebrad.toml";
/// Zebrad Subcommands
///
/// All subcommands support the following enviroment variables:
/// - `ZEBRAD_CACHE_DIR`: The directory to store zebra data just as state, blocks, wallet, etc.
/// - `ZEBRAD_LOG`: Manipulate the log level. Regex is supported.
/// ## Examples:
///
/// Use a custom data directory:
/// ```
/// export ZEBRAD_CACHE_DIR="/my/zebra_data_dir"
/// zebrad start
/// ```
///
/// Output all info messages:
///
/// ```
/// export ZEBRAD_LOG="info"
/// zebrad start
/// ```
///
/// Output block_verify with trace level and above every 1000 blocks:
///
/// ```
/// export ZEBRAD_LOG="[block_verify{height=Some\(BlockHeight\(.*000\)\)}]=trace"
/// zebrad start
/// ```
///
/// Note: Log options are processed in this order: verbose flag, command stdout, enviroment variable, config file.
#[derive(Command, Debug, Options, Runnable)]
pub enum ZebradCmd {
/// The `generate` subcommand