Struct bdk::blockchain::EsploraBlockchain
source · [−]pub struct EsploraBlockchain { /* private fields */ }
Expand description
Structure that implements the logic to sync with Esplora
Example
See the blockchain::esplora
module for a usage example.
Implementations
sourceimpl EsploraBlockchain
impl EsploraBlockchain
sourcepub fn new(base_url: &str, stop_gap: usize) -> Self
This is supported on crate feature esplora
only.
pub fn new(base_url: &str, stop_gap: usize) -> Self
This is supported on crate feature
esplora
only.Create a new instance of the client from a base URL and the stop_gap
.
sourcepub fn with_agent(self, agent: Agent) -> Self
This is supported on crate feature esplora
only.
pub fn with_agent(self, agent: Agent) -> Self
This is supported on crate feature
esplora
only.Set the inner ureq
agent.
sourcepub fn with_concurrency(self, concurrency: u8) -> Self
This is supported on crate feature esplora
only.
pub fn with_concurrency(self, concurrency: u8) -> Self
This is supported on crate feature
esplora
only.Set the number of parallel requests the client can make.
Trait Implementations
sourceimpl Blockchain for EsploraBlockchain
This is supported on crate feature esplora
only.
impl Blockchain for EsploraBlockchain
This is supported on crate feature
esplora
only.sourcefn get_capabilities(&self) -> HashSet<Capability>
fn get_capabilities(&self) -> HashSet<Capability>
Return the set of Capability
supported by this backend
sourcefn setup<D: BatchDatabase, P: Progress>(
&self,
database: &mut D,
_progress_update: P
) -> Result<(), Error>
fn setup<D: BatchDatabase, P: Progress>(
&self,
database: &mut D,
_progress_update: P
) -> Result<(), Error>
Setup the backend and populate the internal database for the first time Read more
sourcefn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>
fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>
Fetch a transaction from the blockchain given its txid
sourcefn get_height(&self) -> Result<u32, Error>
fn get_height(&self) -> Result<u32, Error>
Return the current height
sourceimpl ConfigurableBlockchain for EsploraBlockchain
This is supported on crate feature esplora
only.
impl ConfigurableBlockchain for EsploraBlockchain
This is supported on crate feature
esplora
only.type Config = EsploraBlockchainConfig
type Config = EsploraBlockchainConfig
Type that contains the configuration
sourcefn from_config(config: &Self::Config) -> Result<Self, Error>
fn from_config(config: &Self::Config) -> Result<Self, Error>
Create a new instance given a configuration
sourceimpl Debug for EsploraBlockchain
This is supported on crate feature esplora
only.
impl Debug for EsploraBlockchain
This is supported on crate feature
esplora
only.sourceimpl From<EsploraBlockchain> for AnyBlockchain
impl From<EsploraBlockchain> for AnyBlockchain
sourcefn from(inner: EsploraBlockchain) -> Self
fn from(inner: EsploraBlockchain) -> Self
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for EsploraBlockchain
impl Send for EsploraBlockchain
impl Sync for EsploraBlockchain
impl Unpin for EsploraBlockchain
impl !UnwindSafe for EsploraBlockchain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more