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: u32

Network 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: String

Database directory, must be a valid path in remote host machine.

log_dir: String

Logging 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: u32

HTTP 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: u32

Staking 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: String

Chain 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

Returns true if the configuration is mainnet.

Returns true if the configuration is a custom network thus requires a custom genesis file.

Converts to string with JSON encoder.

Saves the current configuration to disk and overwrites the file.

Validates the configuration.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Wrap the input message T in a tonic::Request

Should always be Self

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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