Skip to main content

Crate halfin

Crate halfin 

Source
Expand description

§Halfin

A bitcoin node running utility for integration testing.

§Supported Implementations and Versions

ImplementationVersionFeature Flag
bitcoindv30.2bitcoind_30_2
utreexodv0.5.0utreexod_0_5_0

§Example

use halfin::bitcoind::BitcoinD;
use halfin::utreexod::UtreexoD;

let bitcoind = BitcoinD::new().unwrap();
bitcoind.generate(10).unwrap();
assert_eq!(bitcoind.get_height().unwrap(), 10);

let utreexod = UtreexoD::new().unwrap();
utreexod.generate(10).unwrap();
assert_eq!(utreexod.get_height().unwrap(), 10);

Re-exports§

pub use bitcoind::BitcoinD;
pub use utreexod::UtreexoD;

Modules§

bitcoind
BitcoinD
utreexod
UtreexoD

Enums§

DataDir
Owns a node’s working directory, either as a temporary or a persistent path.
Error

Constants§

NODE_BUILDING_MAX_RETRIES
The maximum number of attempts at instantiating a BitcoinD/UtreexoD.
POLL_INTERVAL
The Duration between polls for wait_for_height.
WAIT_TIMEOUT
The timeout Duration for wait_for_height.

Traits§

Node
Common interface across all node implementations (BitcoinD/UtreexoD).

Functions§

get_available_port
Ask the OS for an available port, immediately unbind and return it.
wait_for_height
Poll a Node until its chain height reaches height, then return.
wait_for_height_with_timeout
Poll a Node until its chain height reaches height, then return.