Struct safe_network::node::config_handler::Config[][src]

pub struct Config {
Show 22 fields pub wallet_id: Option<String>, pub max_capacity: Option<u64>, pub root_dir: Option<PathBuf>, pub verbose: u8, pub completions: Option<String>, pub log_dir: Option<PathBuf>, pub update: bool, pub update_only: bool, pub json_logs: bool, pub resource_logs: bool, pub clear_data: bool, pub first: bool, pub local_addr: Option<SocketAddr>, pub public_addr: Option<SocketAddr>, pub skip_auto_port_forwarding: bool, pub hard_coded_contacts: BTreeSet<SocketAddr>, pub genesis_key: Option<String>, pub max_msg_size_allowed: Option<u32>, pub idle_timeout_msec: Option<u64>, pub keep_alive_interval_msec: Option<u32>, pub upnp_lease_duration: Option<u32>, pub network_config: NetworkConfig,
}
Expand description

Node configuration

Fields

wallet_id: Option<String>

The address to be credited when this node farms SafeCoin. A hex formatted BLS public key.

max_capacity: Option<u64>

Upper limit in bytes for allowed network storage on this node.

root_dir: Option<PathBuf>

Root directory for dbs and cached state. If not set, it defaults to “root_dir” within the sn_node project data directory, located at: Linux: $HOME/.safe/node/root_dir Windows: {FOLDERID_Profile}/.safe/node/root_dir MacOS: $HOME/.safe/node/root_dir

verbose: u8

Verbose output. -v is equivalent to logging with warn, -vv to info, -vvv to debug, -vvvv to trace. This flag overrides RUST_LOG.

completions: Option<String>

dump shell completions for: [bash, fish, zsh, powershell, elvish]

log_dir: Option<PathBuf>

Send logs to a file within the specified directory

update: bool

Attempt to self-update?

update_only: bool

Attempt to self-update without starting the node process

json_logs: bool

Outputs logs in json format for easier processing

resource_logs: bool

print node resourse usage to stdout

clear_data: bool

Delete all data from a previous node running on the same PC

first: bool

Whether the node is the first on the network.

When set, you must specify either --local-addr or --public-addr to ensure the correct connection info is stored.

local_addr: Option<SocketAddr>

Local address to be used for the node.

When unspecified, the node will listen on 0.0.0.0 with a random unused port. If you’re running a local-only network, you should set this to 127.0.0.1:0 to prevent any external traffic from reaching the node (but note that the node will also be unable to connect to non-local nodes).

public_addr: Option<SocketAddr>

External address of the node, to use when writing connection info.

If unspecified, it will be queried from a peer; if there are no peers, the local-addr will be used, if specified.

skip_auto_port_forwarding: bool

This flag can be used to skip automated port forwarding using IGD. This is used when running a network on a LAN or when a node is connected to the internet directly, without a router, e.g. Digital Ocean droplets.

hard_coded_contacts: BTreeSet<SocketAddr>

Hard Coded contacts

genesis_key: Option<String>

Genesis key of the network in hex format.

max_msg_size_allowed: Option<u32>

This is the maximum message size we’ll allow the peer to send to us. Any bigger message and we’ll error out probably shutting down the connection to the peer. If none supplied we’ll default to the documented constant.

idle_timeout_msec: Option<u64>

If we hear nothing from the peer in the given interval we declare it offline to us. If none supplied we’ll default to the documented constant.

The interval is in milliseconds. A value of 0 disables this feature.

keep_alive_interval_msec: Option<u32>

Interval to send keep-alives if we are idling so that the peer does not disconnect from us declaring us offline. If none is supplied we’ll default to the documented constant.

The interval is in milliseconds. A value of 0 disables this feature.

upnp_lease_duration: Option<u32>

Duration of a UPnP port mapping.

network_config: NetworkConfig

Implementations

Returns a new Config instance. Tries to read from the default node config file location, and overrides values with any equivalent command line args.

The address to be credited when this node farms SafeCoin.

Is this the first node in a section?

Upper limit in bytes for allowed network storage on this node.

Root directory for dbs and cached state. If not set, it defaults to DEFAULT_ROOT_DIR_NAME within the project’s data directory (see Config::root_dir for the directories on each platform).

Set the root directory for dbs and cached state.

Set the directory to write the logs.

Get the log level.

Network configuration options.

Set network configuration options.

Get the completions option

Directory where to write log file/s if specified

Attempt to self-update?

Attempt to self-update without starting the node process

Writes the config file to disk

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

Serialize this value into the given Serde serializer. Read more

Returns clap::App corresponding to the struct.

Builds the struct from clap::ArgMatches. It’s guaranteed to succeed if matches originates from an App generated by StructOpt::clap called on the same type, otherwise it must panic. Read more

Builds the struct from the command line arguments (std::env::args_os). Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more

Builds the struct from the command line arguments (std::env::args_os). Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program, so calling .exit is up to you. Read more

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more

Gets the struct from any iterator such as a Vec of your making. 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

Performs the conversion.

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

Performs the conversion.

Set the foreground color generically Read more

Set the background color generically. Read more

Change the foreground color to black

Change the foreground color to black

Change the foreground color to red

Change the foreground color to red

Change the foreground color to green

Change the foreground color to green

Change the foreground color to yellow

Change the foreground color to yellow

Change the foreground color to blue

Change the foreground color to blue

Change the foreground color to magenta

Change the foreground color to magenta

Change the foreground color to purple

Change the foreground color to purple

Change the foreground color to cyan

Change the foreground color to cyan

Change the foreground color to white

Change the foreground color to white

Change the foreground color to bright black

Change the foreground color to bright black

Change the foreground color to bright red

Change the foreground color to bright red

Change the foreground color to bright green

Change the foreground color to bright green

Change the foreground color to bright yellow

Change the foreground color to bright yellow

Change the foreground color to bright blue

Change the foreground color to bright blue

Change the foreground color to bright magenta

Change the foreground color to bright magenta

Change the foreground color to bright purple

Change the foreground color to bright purple

Change the foreground color to bright cyan

Change the foreground color to bright cyan

Change the foreground color to bright white

Change the foreground color to bright white

Make the text bold

Make the text dim

Make the text italicized

Make the text italicized

Make the text blink

Make the text blink (but fast!)

Swap the foreground and background colors

Hide the text

Cross out the text

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

Sets the foreground color to an RGB value.

Sets the background color to an RGB value.

Apply a runtime-determined style

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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