Struct avalanchego::config::Config
source · [−]pub struct Config {Show 53 fields
pub config_file: Option<String>,
pub genesis: Option<String>,
pub network_id: u32,
pub db_type: String,
pub db_dir: String,
pub log_dir: String,
pub log_level: 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 staking_enabled: Option<bool>,
pub staking_port: u32,
pub staking_tls_key_file: Option<String>,
pub staking_tls_cert_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 whitelisted_subnets: Option<String>,
pub chain_config_dir: String,
pub subnet_config_dir: Option<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 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 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>,
}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.7.10/config/flags.go ref. https://serde.rs/container-attrs.html
Fields
config_file: Option<String>File path to persist all fields below.
genesis: 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 4, “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: Stringdb_dir: StringDatabase 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_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.
staking_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.
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>whitelisted_subnets: Option<String>A list of whitelisted subnet IDs (comma-separated).
chain_config_dir: StringChain configuration directory for all chains. ref. https://github.com/ava-labs/avalanchego/blob/v1.7.6/config/flags.go#L25-L44
subnet_config_dir: Option<String>state_sync_ids: Option<String>A comma seperated 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>Continous profile flags
profile_continuous_enabled: Option<bool>profile_continuous_freq: Option<String>profile_continuous_max_files: Option<u32>throttler_inbound_at_large_alloc_size: Option<u64>throttler_inbound_validator_alloc_size: Option<u64>throttler_inbound_node_max_at_large_bytes: 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>Implementations
sourceimpl Config
impl Config
pub fn default() -> Self
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.
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
sourceimpl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Config
impl StructuralEq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T in a tonic::Request
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more