Struct sn_node::Config [−][src]
pub struct Config {}Show fields
pub wallet_id: Option<String>, pub max_capacity: Option<u64>, pub root_dir: Option<PathBuf>, pub verbose: u64, pub completions: Option<String>, pub log_dir: Option<PathBuf>, pub update: bool, pub update_only: bool, pub clear_data: bool, pub first: Option<SocketAddr>, pub local_addr: Option<SocketAddr>, pub public_addr: Option<SocketAddr>, pub skip_igd: bool, pub hard_coded_contacts: HashSet<SocketAddr>, pub max_msg_size_allowed: Option<u32>, pub idle_timeout_msec: Option<u64>, pub keep_alive_interval_msec: Option<u32>, pub bootstrap_cache_dir: Option<String>, 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 ChunkStores 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: u64
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
clear_data: bool
Delete all data from a previous node running on the same PC
first: Option<SocketAddr>
If the node is the first node on the network, the local address to be used should be passed.
To use a random port number, use 0. If this argument is passed --local-ip
and --local-port
is not requried, however if they are passed, they should match the value provided here.
local_addr: Option<SocketAddr>
Local address to be used for the node. This field is mandatory if manual port forwarding is being used.
Otherwise, the value is fetched from --first
(for genesis) and obtained by connecting to the
bootstrap node otherwise.
public_addr: Option<SocketAddr>
External address of the node. This field can be used to specify the external socket address when
manual port forwarding is used. If this field is provided, either --first
or --local-addr
must
be provided
skip_igd: bool
This flag can be used to skip port forwarding using IGD. This is used when running a network on LAN or when a node is connected to the internect directly without a router. Eg. Digital Ocean droplets.
hard_coded_contacts: HashSet<SocketAddr>
Hard Coded contacts
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.
bootstrap_cache_dir: Option<String>
Directory in which the bootstrap cache will be stored. If none is supplied, the platform specific default cache directory is used.
upnp_lease_duration: Option<u32>
Duration of a UPnP port mapping.
network_config: NetworkConfig
Implementations
impl Config
[src]
impl Config
[src]pub fn new() -> Result<Self, Error>
[src]
pub fn new() -> Result<Self, Error>
[src]Returns a new Config
instance. Tries to read from the default node config file location,
and overrides values with any equivalent command line args.
pub fn wallet_id(&self) -> Option<&String>
[src]
pub fn wallet_id(&self) -> Option<&String>
[src]The address to be credited when this node farms SafeCoin.
pub fn max_capacity(&self) -> u64
[src]
pub fn max_capacity(&self) -> u64
[src]Upper limit in bytes for allowed network storage on this node.
pub fn root_dir(&self) -> Result<PathBuf>
[src]
pub fn root_dir(&self) -> Result<PathBuf>
[src]Root directory for ChunkStore
s 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).
pub fn set_root_dir<P: Into<PathBuf>>(&mut self, path: P)
[src]
pub fn set_root_dir<P: Into<PathBuf>>(&mut self, path: P)
[src]Set the root directory for ChunkStore
s and cached state.
pub fn set_log_dir<P: Into<PathBuf>>(&mut self, path: P)
[src]
pub fn set_log_dir<P: Into<PathBuf>>(&mut self, path: P)
[src]Set the directory to write the logs.
pub fn network_config(&self) -> &NetworkConfig
[src]
pub fn network_config(&self) -> &NetworkConfig
[src]Network configuration options.
pub fn set_network_config(&mut self, config: NetworkConfig)
[src]
pub fn set_network_config(&mut self, config: NetworkConfig)
[src]Set network configuration options.
pub fn completions(&self) -> &Option<String>
[src]
pub fn completions(&self) -> &Option<String>
[src]Get the completions option
pub fn update_only(&self) -> bool
[src]
pub fn update_only(&self) -> bool
[src]Attempt to self-update without starting the node process
pub fn listen_on_loopback(&mut self)
[src]
pub fn listen_on_loopback(&mut self)
[src]Set the Quic-P2P ip
configuration to 127.0.0.1.
pub fn write_to_disk(&self) -> Result<()>
[src]
pub fn write_to_disk(&self) -> Result<()>
[src]Writes the config file to disk
Trait Implementations
impl<'de> Deserialize<'de> for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl StructOpt for Config
[src]
impl StructOpt for Config
[src]fn from_clap(matches: &ArgMatches<'_>) -> Self
[src]
fn from_clap(matches: &ArgMatches<'_>) -> Self
[src]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
fn from_args() -> Self
[src]
fn from_args() -> Self
[src]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
fn from_args_safe() -> Result<Self, Error>
[src]
fn from_args_safe() -> Result<Self, Error>
[src]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
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]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
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
[src]Gets the struct from any iterator such as a Vec
of your making. Read more
impl StructOptInternal for Config
[src]
impl StructOptInternal for Config
[src]fn augment_clap<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b>
[src]
fn is_subcommand() -> bool
[src]
fn from_subcommand(_sub: (&'b str, Option<&'b ArgMatches<'a>>)) -> Option<Self>
[src]
impl Eq for Config
[src]
impl StructuralEq for Config
[src]
impl StructuralPartialEq for Config
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,