Struct iota_client::builder::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
Builder to construct client instance with sensible default values
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn with_primary_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_primary_node( self, url: &str, jwt: Option<String>, basic_auth_name_pwd: Option<(&str, &str)> ) -> Result<Self>
Adds an IOTA node by its URL to be used as primary node, with optional jwt and or basic authentication
sourcepub fn with_primary_pow_node(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_primary_pow_node( self, url: &str, jwt: Option<String>, basic_auth_name_pwd: Option<(&str, &str)> ) -> Result<Self>
Adds an IOTA node by its URL to be used as primary PoW node (for remote PoW), with optional jwt and or basic authentication
sourcepub fn with_permanode(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_permanode( self, url: &str, jwt: Option<String>, basic_auth_name_pwd: Option<(&str, &str)> ) -> Result<Self>
Adds a permanode by its URL, with optional jwt and or basic authentication
sourcepub fn with_node_auth(
self,
url: &str,
jwt: Option<String>,
basic_auth_name_pwd: Option<(&str, &str)>
) -> Result<Self>
pub fn with_node_auth( self, url: &str, jwt: Option<String>, basic_auth_name_pwd: Option<(&str, &str)> ) -> Result<Self>
Adds an IOTA node by its URL with optional jwt and or basic authentication
sourcepub fn with_nodes(self, urls: &[&str]) -> Result<Self>
pub fn with_nodes(self, urls: &[&str]) -> Result<Self>
Adds a list of IOTA nodes by their URLs.
sourcepub fn with_node_sync_interval(self, node_sync_interval: Duration) -> Self
pub fn with_node_sync_interval(self, node_sync_interval: Duration) -> Self
Set the node sync interval
sourcepub fn with_node_sync_disabled(self) -> Self
pub fn with_node_sync_disabled(self) -> Self
Disables the node syncing process. Every node will be considered healthy and ready to use.
sourcepub fn with_offline_mode(self) -> Self
pub fn with_offline_mode(self) -> Self
Allows creating the client without nodes for offline address generation or signing
sourcepub async fn with_node_pool_urls(
self,
node_pool_urls: &[String]
) -> Result<Self>
pub async fn with_node_pool_urls( self, node_pool_urls: &[String] ) -> Result<Self>
Get node list from the node_pool_urls
sourcepub fn with_quorum(self, quorum: bool) -> Self
pub fn with_quorum(self, quorum: bool) -> Self
Set if quroum should be used or not
sourcepub fn with_quorum_size(self, quorum_size: usize) -> Self
pub fn with_quorum_size(self, quorum_size: usize) -> Self
Set amount of nodes which should be used for quorum
sourcepub fn with_quorum_threshold(self, threshold: usize) -> Self
pub fn with_quorum_threshold(self, threshold: usize) -> Self
Set quorum_threshold
sourcepub fn with_network(self, network: &str) -> Self
pub fn with_network(self, network: &str) -> Self
Selects the type of network to get default nodes for it, only “testnet” is supported at the moment.
Nodes that don’t belong to this network are ignored. The &str must match a part or all of the networkId returned
in the nodeinfo from a node. For example, if the networkId is "private-tangle"
, "tangle"
can be used.
Default nodes are only used when no other nodes are provided.
sourcepub fn with_local_pow(self, local: bool) -> Self
pub fn with_local_pow(self, local: bool) -> Self
Sets whether the PoW should be done locally or remotely.
sourcepub fn with_fallback_to_local_pow(self, fallback_to_local_pow: bool) -> Self
pub fn with_fallback_to_local_pow(self, fallback_to_local_pow: bool) -> Self
Sets whether the PoW should be done locally in case a node doesn’t support remote PoW.
sourcepub fn with_tips_interval(self, tips_interval: u64) -> Self
pub fn with_tips_interval(self, tips_interval: u64) -> Self
Sets after how many seconds new tips will be requested during PoW
sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Sets the default request timeout.
sourcepub fn with_api_timeout(self, api: Api, timeout: Duration) -> Self
pub fn with_api_timeout(self, api: Api, timeout: Duration) -> Self
Sets the request timeout for a specific API usage.
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more