pub struct Config {Show 18 fields
pub data_dir: Option<String>,
pub assume_valid: Option<String>,
pub wallet_xpub: Option<Vec<String>>,
pub wallet_descriptor: Option<Vec<String>>,
pub rescan: Option<u32>,
pub config_file: Option<String>,
pub proxy: Option<String>,
pub network: Network,
pub cfilters: bool,
pub filters_start_height: Option<i32>,
pub connect: Option<String>,
pub json_rpc_address: Option<String>,
pub electrum_address: Option<String>,
pub log_to_stdout: bool,
pub log_to_file: bool,
pub assume_utreexo: bool,
pub debug: bool,
pub user_agent: String,
}
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§
§data_dir: Option<String>
Where we should place our data
This directory must be readable and writable by our proccess. 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 particurly 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 a optimization mirrowed from Core, where blocks before this one are considered to have valid signatures. The idea here is that if a block is burried 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>>
A output descriptor to cache
This should be a list of ouptut descriptors that we should add to our watch-only wallet. This works just like wallet_xpub, but with a descriptor.
rescan: Option<u32>
Whether we should rescan for wallet transactions
If your wallet is missing some transaction (e.g. you’ve just added a new address), you can set this value to some height, and we’ll rescan from this block to the tip.
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 precedense 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: Network
The network we are running in, it may be one of: bitcoin, signet, regtest or testnet.
cfilters: bool
Whther 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.
connect: Option<String>
§json_rpc_address: Option<String>
The address our json-rpc should listen to
electrum_address: Option<String>
The address our electrum server should listen to
log_to_stdout: bool
Whether we should write logs to the stdio
log_to_file: bool
§assume_utreexo: bool
Whether we should use assume utreexo
debug: bool
Whether we should post debug information to the console
user_agent: String
The user agent that we will advertise to our peers