pub struct NodeConfig {
Show 14 fields pub base: BaseConfig, pub consensus: ConsensusConfig, pub debug_interface: DebugInterfaceConfig, pub execution: ExecutionConfig, pub full_node_networks: Vec<NetworkConfig>, pub logger: LoggerConfig, pub mempool: MempoolConfig, pub metrics: DeprecatedConfig, pub json_rpc: JsonRpcConfig, pub state_sync: StateSyncConfig, pub storage: StorageConfig, pub test: Option<TestConfig>, pub validator_network: Option<NetworkConfig>, pub failpoints: Option<HashMap<String, String>>,
}
Expand description

Config pulls in configuration information from the config file. This is used to set up the nodes and configure various parameters. The config file is broken up into sections for each module so that only that module can be passed around

Fields§

§base: BaseConfig§consensus: ConsensusConfig§debug_interface: DebugInterfaceConfig§execution: ExecutionConfig§full_node_networks: Vec<NetworkConfig>§logger: LoggerConfig§mempool: MempoolConfig§metrics: DeprecatedConfig§json_rpc: JsonRpcConfig§state_sync: StateSyncConfig§storage: StorageConfig§test: Option<TestConfig>§validator_network: Option<NetworkConfig>§failpoints: Option<HashMap<String, String>>

Implementations§

source§

impl NodeConfig

source

pub fn data_dir(&self) -> &Path

source

pub fn set_data_dir(&mut self, data_dir: PathBuf)

source

pub fn load<P: AsRef<Path>>(input_path: P) -> Result<Self, Error>

Reads the config file and returns the configuration object in addition to doing some post-processing of the config Paths used in the config are either absolute or relative to the config location

source

pub fn peer_id(&self) -> Option<PeerId>

source

pub fn save<P: AsRef<Path>>(&mut self, output_path: P) -> Result<(), Error>

source

pub fn randomize_ports(&mut self)

source

pub fn random() -> Self

source

pub fn random_with_template(idx: u32, template: &Self, rng: &mut StdRng) -> Self

source

pub fn default_for_public_full_node() -> Self

source

pub fn default_for_validator() -> Self

source

pub fn default_for_validator_full_node() -> Self

Trait Implementations§

source§

impl Clone for NodeConfig

source§

fn clone(&self) -> NodeConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for NodeConfig

source§

fn default() -> NodeConfig

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for NodeConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<NodeConfig> for NodeConfig

source§

fn eq(&self, other: &NodeConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for NodeConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for NodeConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> PersistableConfig for Twhere T: Serialize + DeserializeOwned + ?Sized,

source§

fn load_config<P: AsRef<Path>>(path: P) -> Result<Self, Error>

source§

fn save_config<P: AsRef<Path>>(&self, output_file: P) -> Result<(), Error>

source§

fn parse(serialized: &str) -> Result<Self, Error>

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

§

impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,

§

fn test_only_hash(&self) -> HashValue

Generates a hash used only for tests.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,