Expand description
§ElectrsD: spawn and interact with an electrs process
A utility crate for spinning up electrs processes connected to a local
BitcoinD process in regtest, useful for integration testing Electrum
consumers against a Bitcoin regtest chain.
§Quick Start
use halfin::bitcoind::BitcoinD;
use halfin::electrsd::ElectrsD;
use halfin::electrsd::wait_for_electrs_to_catch_up;
let bitcoind = BitcoinD::new().unwrap();
bitcoind.generate(10).unwrap();
let electrs = ElectrsD::new(&bitcoind).unwrap();
wait_for_electrs_to_catch_up(&electrs, &bitcoind).unwrap();§Directory Handling
By default each ElectrsD instance uses a temporary directory that is
cleaned up when the instance is dropped. Pass a staticdir in
ElectrsDConf to keep data between runs.
Structs§
- ElectrsD
- A running
electrsregtest indexer. - ElectrsD
Conf - Configuration for an
ElectrsDinstance.
Constants§
- ELECTRS_
INDEXING_ TIMEOUT - The default timeout for
ElectrsDindexing helpers.
Functions§
- get_
electrs_ path - Return the path to the downloaded
electrsbinary. - wait_
for_ electrs_ mempool_ tx - Poll
ElectrsDuntiltxidappears as an unconfirmed transaction forscript_pubkey. - wait_
for_ electrs_ mempool_ tx_ with_ timeout - Poll
ElectrsDuntiltxidappears as an unconfirmed transaction forscript_pubkeywith a customtimeout. - wait_
for_ electrs_ tip - Poll
ElectrsDuntil its Electrum header tip reachesexpected_height. - wait_
for_ electrs_ tip_ with_ timeout - Poll
ElectrsDuntil its Electrum header tip reachesexpected_heightwith a customtimeout. - wait_
for_ electrs_ to_ catch_ up - Poll
ElectrsDuntil its Electrum header tip matchesBitcoinD’s tip. - wait_
for_ electrs_ to_ catch_ up_ with_ timeout - Poll
ElectrsDuntil its Electrum header tip matchesBitcoinD’s tip with a customtimeout.