Struct florestad::Config

source ·
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

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Config

source§

fn default() -> Config

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

impl From<Config> for Florestad

source§

fn from(config: Config) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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