#testing #process #environment #utility #integration #run #connected #instance

electrsd

Utility to run a regtest electrs process, useful in integration testing environment

10 breaking releases

0.11.0 Sep 21, 2021
0.9.0 Aug 5, 2021
0.8.0 Jul 26, 2021

#96 in Testing

Download history 6/week @ 2021-06-30 232/week @ 2021-07-07 664/week @ 2021-07-14 986/week @ 2021-07-21 1396/week @ 2021-07-28 393/week @ 2021-08-04 496/week @ 2021-08-11 578/week @ 2021-08-18 1194/week @ 2021-08-25 387/week @ 2021-09-01 566/week @ 2021-09-08 592/week @ 2021-09-15 1156/week @ 2021-09-22 534/week @ 2021-09-29 229/week @ 2021-10-06 282/week @ 2021-10-13

2,524 downloads per month
Used in bdk

MIT license

16KB
316 lines

MIT license Crates

Electrsd

Utility to run a regtest electrsd process connected to a given bitcoind instance, useful in integration testing environment.

let bitcoind = bitcoind::BitcoinD::new("/usr/local/bin/bitcoind").unwrap();
let electrsd = electrsd::ElectrsD::new("/usr/local/bin/electrsd", bitcoind).unwrap();
let header = electrsd.client.block_headers_subscribe().unwrap();
assert_eq!(header.height, 0);

Features

  • electrsd use a temporary directory as db dir
  • A free port is asked to the OS (a very low probability race condition is still possible)
  • the process is killed when the struct goes out of scope no matter how the test finishes

lib.rs:

Electrsd

Utility to run a regtest electrsd process, useful in integration testing environment

Dependencies

~9.5MB
~102K SLoC