pub struct Config {Show 27 fields
pub disable_dns_seeds: bool,
pub data_dir: Option<String>,
pub assume_valid: Option<String>,
pub wallet_xpub: Option<Vec<String>>,
pub wallet_descriptor: Option<Vec<String>>,
pub config_file: Option<String>,
pub proxy: Option<String>,
pub network: Network,
pub cfilters: bool,
pub filters_start_height: Option<i32>,
pub zmq_address: Option<String>,
pub connect: Option<String>,
pub json_rpc_address: Option<String>,
pub log_to_stdout: bool,
pub log_to_file: bool,
pub assume_utreexo: bool,
pub debug: bool,
pub user_agent: String,
pub assumeutreexo_value: Option<AssumeUtreexoValue>,
pub electrum_address: Option<String>,
pub enable_electrum_tls: bool,
pub electrum_address_tls: Option<String>,
pub tls_key_path: Option<String>,
pub tls_cert_path: Option<String>,
pub generate_cert: bool,
pub allow_v1_fallback: bool,
pub backfill: bool,
}Expand description
General configuration for the floresta daemon.
Those configs should be passed in by anyone that wants to start a floresta instance. Some of these are also exposed through the config file.
Fields§
§disable_dns_seeds: boolWhether we should disable dns seeds
data_dir: Option<String>Where we should place our data
This directory must be readable and writable by our process. We’ll use this dir to store both chain and wallet data, so this should be kept in a non-volatile medium. We are not particularly aggressive in disk usage, so we don’t need a fast disk to work.
If not set, it defaults to $HOME/.floresta
assume_valid: Option<String>We consider blocks prior to this one to have a valid signature
This is an optimization mirrored from Core, where blocks before this one are considered to have valid signatures. The idea here is that if a block is buried under a lot of PoW, it’s very unlikely that it is invalid. We still validate everything else and build the accumulator until this point (unless running on PoW-fraud proof or assumeutreexo mode) so there’s still some work to do.
wallet_xpub: Option<Vec<String>>A vector of xpubs to cache
This is a list of SLIP-132-encoded extended public key that we should add to our Watch-only wallet. A descriptor may be only passed one time, if you call florestad with an already cached address, that will be a no-op. After a xpub is cached, we derive multiple addresses from it and try to find transactions involving it.
wallet_descriptor: Option<Vec<String>>An output descriptor to cache
This should be a list of output descriptors that we should add to our watch-only wallet. This works just like wallet_xpub, but with a descriptor.
config_file: Option<String>Where should we read from a config file
This is a toml-encoded file with floresta’s configs. For a sample of how this file looks like, see config.toml.sample inside floresta’s codebase.
If a setting is modified by the config file and this config struct, the following logic is used: - For vectors, we use the combination of both vectors - for mutually exclusive options, this struct has precedence over the config file
proxy: Option<String>A proxy that we should use to connect with others
This should be a socks5 proxy, like Tor’s socks. If provided, all our outgoing connections will be made through this one, except dns seed connections.
network: NetworkThe network we are running in, it may be one of: bitcoin, signet, regtest or testnet.
cfilters: boolWhether we should build and store compact block filters
Those filters are used for rescanning our wallet for historical transactions. If you don’t have this on, the only way to find historical transactions is to download all blocks, which is very inefficient and resource/time consuming. But keep in mind that filters will take up disk space.
filters_start_height: Option<i32>If we are using block filters, we may not need to download the whole chain of filters, as our wallets may not have been created at the beginning of the chain. With this option, we can make a rough estimate of the block height we need to start downloading filters.
If the value is negative, it’s relative to the current tip. For example, if the current tip is at height 1000, and we set this value to -100, we will start downloading filters from height 900.
zmq_address: Option<String>zmq-server only.The address to listen to for our ZMQ server
We have an (optional) ZMQ server, that pushes new blocks over a PUSH/PULL ZMQ queue, this is the address that we’ll listen for incoming connections.
connect: Option<String>§json_rpc_address: Option<String>json-rpc only.The address our json-rpc should listen to
log_to_stdout: boolWhether we should write logs to stdout.
log_to_file: boolWhether we should log to a fs file
assume_utreexo: boolWhether we should use assume utreexo
debug: boolWhether we should post debug information to the console
user_agent: StringThe user agent that we will advertise to our peers
assumeutreexo_value: Option<AssumeUtreexoValue>The value to use for assumeutreexo
electrum_address: Option<String>Address the Electrum Server will listen to.
enable_electrum_tls: boolWhether to enable the Electrum TLS server.
electrum_address_tls: Option<String>Address the Electrum TLS Server will listen to.
tls_key_path: Option<String>TLS private key path (defaults to {data_dir}/tls/key.pem).
It must be PKCS#8-encoded. You can use openssl to generate it:
openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:2048tls_cert_path: Option<String>TLS certificate path (defaults to {data_dir}/tls/cert.pem).
It must be PKCS#8-encoded. You can use openssl to generate it from a PKCS#8-encoded private key:
openssl req -x509 -new -key key.pem -out cert.pem -days 365 -subj "/CN=localhost"generate_cert: boolWhether to create self signed certificate for tls_key_path and tls_cert_path.
allow_v1_fallback: boolWhether to allow fallback to v1 transport if v2 connection fails.
backfill: boolWhehter we should backfill
If we assumeutreexo or use pow fraud proofs, you have the option to download and validate the blocks that were skipped. This will take a long time, but will run on the background and won’t affect the node’s operation. You may notice that this will take a lot of CPU and bandwidth to run.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more