massa_models/config/
mod.rs

1//! Main node configuration and all that stuff is here
2//!
3//! # Introduction
4//!
5//! This module is mainly used to define the default values used through
6//! the project in all *Configuration* objects.
7//!
8//! The name "constant" is a used for some hard-coded default values. It shouldn't
9//! be used as it as a constant. When you need one of these values, you better
10//! use the `cfg` parameter in your worker.
11//!
12//! The only place where it's safe to use it is in files named `settings.rs`
13//! or `config.rs`
14//!
15//! # test-exports or default
16//!
17//! You have access to the constants (in test or in normal mode) with the
18//! following imports. When you have a doubt for the import, use the auto
19//! dispatcher `use massa_models::constants::*;`
20//!
21//! ```ignore
22//! // Classic import automatically root to `test-exports` or `default`
23//! // depending on the compilation context.
24//! use massa_models::constants::*;
25//!
26//! // Force to import the nominal constants
27//! use massa_models::constants::default::*;
28//!
29//! // Force to import the test-exports constants
30//! use massa_models::constants::default_test-exports::*;
31//! ```
32//!
33//! # Note about rooting
34//! ```md
35//! |T|S| not(T) or S | T and not(S)
36//! |0|0| 1           | 0
37//! |1|0| 0           | 1
38//! |0|1| 1           | 0
39//! |1|1| 1           | 0
40//! ```
41//!
42//! `#[cfg(any(not(feature = "test-exports"), feature = "sandbox"))]`
43//! On `cargo run --release` or `cargo run --features sandbox`
44//!
45//! #`[cfg(all(feature = "test-exports", not(feature = "sandbox")))]`
46//! On `cargo run` or `cargo test`
47//!
48
49// **************************************************************
50// Note:
51// We can force the access to one of defined value (test or not)
52// with `use massa_config::exported_constants::CONST_VALUE`
53// Nevertheless the design is more like using `massa_config::CONST_VALUE`
54// and defining in `Cargo.toml` if we are test-exports or not
55// ```toml
56// [dependencies]
57//     massa_config = { path = "../massa-config" }
58// [dev-dependencies]
59//     massa_config = { path = "../massa-config", features = ["test-exports"] }
60// ```
61//
62
63pub mod constants;
64pub use constants::*;
65
66mod compact_config;
67pub use compact_config::CompactConfig;
68
69// Export tool to read user setting file
70mod massa_settings;
71pub use massa_settings::build_massa_settings;
72
73mod massa_disclaimer;
74pub use massa_disclaimer::handle_disclaimer;