pub struct Config {Show 73 fields
pub config_file: Option<String>,
pub genesis_file: Option<String>,
pub network_id: u32,
pub db_type: String,
pub db_dir: String,
pub chain_data_dir: String,
pub log_dir: String,
pub log_level: Option<String>,
pub log_format: Option<String>,
pub log_display_level: Option<String>,
pub http_port: u32,
pub http_host: Option<String>,
pub http_tls_enabled: Option<bool>,
pub http_tls_key_file: Option<String>,
pub http_tls_cert_file: Option<String>,
pub public_ip: Option<String>,
pub sybil_protection_enabled: Option<bool>,
pub staking_port: u32,
pub staking_tls_key_file: Option<String>,
pub staking_tls_cert_file: Option<String>,
pub staking_signer_key_file: Option<String>,
pub bootstrap_ips: Option<String>,
pub bootstrap_ids: Option<String>,
pub snow_sample_size: Option<u32>,
pub snow_quorum_size: Option<u32>,
pub snow_concurrent_repolls: Option<u32>,
pub snow_max_time_processing: Option<String>,
pub snow_rogue_commit_threshold: Option<u32>,
pub snow_virtuous_commit_threshold: Option<u32>,
pub network_peer_list_gossip_frequency: Option<String>,
pub network_max_reconnect_delay: Option<String>,
pub index_enabled: Option<bool>,
pub index_allow_incomplete: Option<bool>,
pub api_admin_enabled: Option<bool>,
pub api_info_enabled: Option<bool>,
pub api_keystore_enabled: Option<bool>,
pub api_metrics_enabled: Option<bool>,
pub api_health_enabled: Option<bool>,
pub api_ipcs_enabled: Option<bool>,
pub track_subnets: Option<String>,
pub plugin_dir: String,
pub subnet_config_dir: String,
pub chain_config_dir: String,
pub state_sync_ids: Option<String>,
pub state_sync_ips: Option<String>,
pub profile_dir: Option<String>,
pub profile_continuous_enabled: Option<bool>,
pub profile_continuous_freq: Option<String>,
pub profile_continuous_max_files: Option<u32>,
pub proposervm_use_current_height: Option<bool>,
pub throttler_inbound_node_max_processing_msgs: Option<u64>,
pub throttler_inbound_bandwidth_refill_rate: Option<u64>,
pub throttler_inbound_bandwidth_max_burst_size: Option<u64>,
pub throttler_inbound_cpu_validator_alloc: Option<u64>,
pub throttler_inbound_disk_validator_alloc: Option<u64>,
pub throttler_inbound_at_large_alloc_size: Option<u64>,
pub throttler_inbound_validator_alloc_size: Option<u64>,
pub throttler_inbound_node_max_at_large_bytes: Option<u64>,
pub snow_mixed_query_num_push_vdr: Option<u64>,
pub consensus_accepted_frontier_gossip_frequency: Option<i64>,
pub consensus_app_concurrency: Option<i64>,
pub consensus_on_accept_gossip_validator_size: Option<u64>,
pub consensus_on_accept_gossip_non_validator_size: Option<u64>,
pub consensus_on_accept_gossip_peer_size: Option<u64>,
pub consensus_accepted_frontier_gossip_peer_size: Option<u64>,
pub throttler_outbound_at_large_alloc_size: Option<u64>,
pub throttler_outbound_validator_alloc_size: Option<u64>,
pub throttler_outbound_node_max_at_large_bytes: Option<u64>,
pub network_minimum_timeout: Option<String>,
pub network_require_validator_to_connect: Option<bool>,
pub network_compression_type: Option<String>,
pub tracing_enabled: Option<bool>,
pub process_context_file: Option<String>,
}avalanchego only.Expand description
Represents AvalancheGo configuration. All file paths must be valid on the remote machines. For example, you may configure cert paths on your local laptop but the actual Avalanche nodes run on the remote machines so the paths will be invalid. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/config ref. https://github.com/ava-labs/avalanchego/blob/v1.9.8/config/flags.go ref. https://github.com/ava-labs/avalanchego/blob/v1.9.8/config/keys.go ref. https://serde.rs/container-attrs.html
Fields§
§config_file: Option<String>File path to persist all fields below.
genesis_file: Option<String>Genesis file path. MUST BE NON-EMPTY for custom network.
network_id: u32Network ID. Default to custom network ID. Set it to 1 for mainnet. e.g., “mainnet” is 1, “fuji” is 5, “local” is 12345. “utils/constants/NetworkID” only accepts string for known networks. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/utils/constants#pkg-constants ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/utils/constants#NetworkName
db_type: String§db_dir: StringDatabase directory, must be a valid path in remote host machine.
chain_data_dir: StringChain data directory, must be a valid path in remote host machine.
log_dir: StringLogging directory, must be a valid path in remote host machine.
log_level: Option<String>“avalanchego” logging level. See “utils/logging/level.go”. e.g., “INFO”, “FATAL”, “DEBUG”, “VERBO”, etc..
log_format: Option<String>“avalanchego” logging format. e.g., “json”, etc..
log_display_level: Option<String>§http_port: u32HTTP port.
http_host: Option<String>HTTP host, which avalanchego defaults to 127.0.0.1. Set it to 0.0.0.0 to expose the HTTP API to all incoming traffic.
http_tls_enabled: Option<bool>§http_tls_key_file: Option<String>MUST BE a valid path in remote host machine.
http_tls_cert_file: Option<String>MUST BE a valid path in remote host machine.
public_ip: Option<String>Public IP of this node for P2P communication. If empty, try to discover with NAT.
sybil_protection_enabled: Option<bool>§staking_port: u32Staking port.
staking_tls_key_file: Option<String>MUST BE a valid path in remote host machine.
staking_tls_cert_file: Option<String>MUST BE a valid path in remote host machine.
staking_signer_key_file: Option<String>MUST BE a valid path in remote host machine. Path to the BLS key.
bootstrap_ips: Option<String>§bootstrap_ids: Option<String>§snow_sample_size: Option<u32>The sample size k, snowball.Parameters.K. If zero, use the default value set via avalanche node code.
snow_quorum_size: Option<u32>The quorum size α, snowball.Parameters.Alpha. If zero, use the default value set via avalanche node code.
snow_concurrent_repolls: Option<u32>§snow_max_time_processing: Option<String>§snow_rogue_commit_threshold: Option<u32>§snow_virtuous_commit_threshold: Option<u32>§network_peer_list_gossip_frequency: Option<String>§network_max_reconnect_delay: Option<String>§index_enabled: Option<bool>§index_allow_incomplete: Option<bool>§api_admin_enabled: Option<bool>§api_info_enabled: Option<bool>§api_keystore_enabled: Option<bool>§api_metrics_enabled: Option<bool>§api_health_enabled: Option<bool>§api_ipcs_enabled: Option<bool>§track_subnets: Option<String>A list of whitelisted/tracked subnet IDs (comma-separated). From avalanchego v1.9.7, it’s renamed to “track-subnets”. ref. https://github.com/ava-labs/avalanchego/blob/v1.9.8/config/keys.go
plugin_dir: StringPlugin directory. Default to “/data/avalanche-plugins”.
subnet_config_dir: StringSubnet configuration directory (e.g., /data/avalanche-configs/subnets/C.json). If a subnet id is 2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt, the config file for this subnet is located at {subnet-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt.json.
chain_config_dir: StringChain configuration directory (e.g., /data/avalanche-configs/chains/C/config.json). If a Subnet’s chain id is 2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt, the config file for this chain is located at {chain-config-dir}/2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt/config.json.
state_sync_ids: Option<String>A comma separated string of explicit nodeID and IPs to contact for starting state sync. Useful for testing. NOTE: Actual state data will be downloaded from nodes specified in the C-Chain config, or the entire network if no list specified there.
state_sync_ips: Option<String>§profile_dir: Option<String>Continuous profile flags
profile_continuous_enabled: Option<bool>§profile_continuous_freq: Option<String>§profile_continuous_max_files: Option<u32>§proposervm_use_current_height: Option<bool>§throttler_inbound_node_max_processing_msgs: Option<u64>§throttler_inbound_bandwidth_refill_rate: Option<u64>§throttler_inbound_bandwidth_max_burst_size: Option<u64>§throttler_inbound_cpu_validator_alloc: Option<u64>§throttler_inbound_disk_validator_alloc: Option<u64>§throttler_inbound_at_large_alloc_size: Option<u64>§throttler_inbound_validator_alloc_size: Option<u64>§throttler_inbound_node_max_at_large_bytes: Option<u64>§snow_mixed_query_num_push_vdr: Option<u64>§consensus_accepted_frontier_gossip_frequency: Option<i64>§consensus_app_concurrency: Option<i64>§consensus_on_accept_gossip_validator_size: Option<u64>§consensus_on_accept_gossip_non_validator_size: Option<u64>§consensus_on_accept_gossip_peer_size: Option<u64>§consensus_accepted_frontier_gossip_peer_size: Option<u64>§throttler_outbound_at_large_alloc_size: Option<u64>§throttler_outbound_validator_alloc_size: Option<u64>§throttler_outbound_node_max_at_large_bytes: Option<u64>§network_minimum_timeout: Option<String>§network_require_validator_to_connect: Option<bool>§network_compression_type: Option<String>§tracing_enabled: Option<bool>§process_context_file: Option<String>Implementations§
Source§impl Config
impl Config
Sourcepub fn default_main() -> Self
pub fn default_main() -> Self
The defaults do not match with the ones in avalanchego, as this is for avalanche-ops based deployments.
Sourcepub fn default_fuji() -> Self
pub fn default_fuji() -> Self
The defaults do not match with the ones in avalanchego, as this is for avalanche-ops based deployments.
Sourcepub fn default_custom() -> Self
pub fn default_custom() -> Self
The defaults do not match with the ones in avalanchego, as this is for avalanche-ops based deployments.
Sourcepub fn is_mainnet(&self) -> bool
pub fn is_mainnet(&self) -> bool
Returns true if the configuration is mainnet.
Sourcepub fn is_custom_network(&self) -> bool
pub fn is_custom_network(&self) -> bool
Returns true if the configuration is a custom network thus requires a custom genesis file.
pub fn add_track_subnets(&mut self, ids: Option<String>)
Sourcepub fn encode_json(&self) -> Result<String>
pub fn encode_json(&self) -> Result<String>
Converts to string with JSON encoder.
Sourcepub fn sync(&self, file_path: Option<String>) -> Result<()>
pub fn sync(&self, file_path: Option<String>) -> Result<()>
Saves the current configuration to disk and overwrites the file.
pub fn load(file_path: &str) -> Result<Self>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Requestimpl<T> JsonSchemaMaybe for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.