[−][src]Crate tari_common
Common logging and configuration utilities
The global Tari configuration file
A single configuration file (usually ~/.tari/config.toml
is used to manage settings for all Tari applications
and nodes running on a single system, whether it's a base node, validator node, or wallet.
Setting of configuration parameters is applied using the following order of precedence:
- Command-line argument
- Environment variable
config.toml
file value- Configuration default
The utilities exposed in this crate are opinionated, but flexible. In general, all data is stored in a .tari
folder under your home folder.
Example - Loading and deserializing the global config file
let config = default_config(); let config = GlobalConfig::convert_from(config).unwrap(); assert_eq!(config.network, Network::MainNet); assert_eq!(config.blocking_threads, 4);
Modules
dir_utils | |
protobuf_build |
Macros
log_if_error | Log an error if an |
log_if_error_fmt | See log_if_error!. |
Structs
ConfigBootstrap | A minimal parsed configuration object that's used to bootstrap the main Configuration. |
ConfigurationError | |
GlobalConfig |
Enums
CommsTransport | |
DatabaseType | |
Network | |
SocksAuthentication | |
TorControlAuthentication |
Constants
DEFAULT_CONFIG | |
DEFAULT_LOG_CONFIG |
Traits
ConfigExtractor | Extract parts of the global Config file into custom configuration objects that are more specific and localised.
The expected use case for this is to use |
Functions
bootstrap_config_from_cli | |
default_config | Generate the global Tari configuration instance. |
initialize_logging | Set up application-level logging using the Log4rs configuration file specified in |
install_configuration | |
install_default_config_file | Installs a new configuration file template, copied from |
load_configuration |