pub struct Builder { /* private fields */ }Expand description
A builder for an Node instance, allowing to set some configuration and module choices from
the getgo.
Defaults
- Wallet entropy is sourced from a
keys_seedfile located underConfig::storage_dir_path - Chain data is sourced from the Esplora endpoint
https://blockstream.info/api - Gossip data is sourced via the peer-to-peer network
Implementations§
source§impl Builder
impl Builder
sourcepub fn from_config(config: Config) -> Self
pub fn from_config(config: Config) -> Self
Creates a new builder instance from an Config.
sourcepub fn set_entropy_seed_path(&self, seed_path: String)
pub fn set_entropy_seed_path(&self, seed_path: String)
Configures the Node instance to source its wallet entropy from a seed file on disk.
If the given file does not exist a new random seed file will be generated and stored at the given location.
sourcepub fn set_entropy_seed_bytes(&self, seed_bytes: Vec<u8>)
pub fn set_entropy_seed_bytes(&self, seed_bytes: Vec<u8>)
Configures the Node instance to source its wallet entropy from the given 64 seed bytes.
Note: Panics if the length of the given seed_bytes differs from 64.
sourcepub fn set_entropy_bip39_mnemonic(
&self,
mnemonic: Mnemonic,
passphrase: Option<String>
)
pub fn set_entropy_bip39_mnemonic( &self, mnemonic: Mnemonic, passphrase: Option<String> )
sourcepub fn set_esplora_server(&self, esplora_server_url: String)
pub fn set_esplora_server(&self, esplora_server_url: String)
Configures the Node instance to source its chain data from the given Esplora server.
sourcepub fn set_gossip_source_p2p(&self)
pub fn set_gossip_source_p2p(&self)
Configures the Node instance to source its gossip data from the Lightning peer-to-peer
network.
sourcepub fn set_gossip_source_rgs(&self, rgs_server_url: String)
pub fn set_gossip_source_rgs(&self, rgs_server_url: String)
Configures the Node instance to source its gossip data from the given RapidGossipSync
server.
sourcepub fn set_storage_dir_path(&self, storage_dir_path: String)
pub fn set_storage_dir_path(&self, storage_dir_path: String)
Sets the used storage directory path.
sourcepub fn set_network(&self, network: Network)
pub fn set_network(&self, network: Network)
Sets the Bitcoin network used.
sourcepub fn set_listening_address(&self, listening_address: NetAddress)
pub fn set_listening_address(&self, listening_address: NetAddress)
Sets the IP address and TCP port on which Node will listen for incoming network connections.
sourcepub fn set_log_level(&self, level: LogLevel)
pub fn set_log_level(&self, level: LogLevel)
Sets the level at which Node will log messages.
sourcepub fn build(&self) -> Arc<Node<SqliteStore>>
pub fn build(&self) -> Arc<Node<SqliteStore>>
Builds a Node instance with a SqliteStore backend and according to the options
previously configured.
sourcepub fn build_with_fs_store(&self) -> Arc<Node<FilesystemStore>>
pub fn build_with_fs_store(&self) -> Arc<Node<FilesystemStore>>
Builds a Node instance with a FilesystemStore backend and according to the options
previously configured.