19 releases
Uses new Rust 2024
| new 0.1.9 | Feb 13, 2026 |
|---|---|
| 0.1.8 | Feb 13, 2026 |
| 0.1.2 | Jan 29, 2026 |
| 0.1.0-alpha.1 | Dec 21, 2025 |
#62 in Magic Beans
Used in 11 crates
(9 directly)
555KB
18K
SLoC
brk_rpc
Thread-safe Bitcoin Core RPC client with automatic retries.
What It Enables
Query a Bitcoin Core node for blocks, transactions, mempool data, and chain state. Handles connection failures gracefully with configurable retry logic.
Key Features
- Auto-retry: Up to 1M retries with configurable delay on transient failures
- Thread-safe: Clone freely, share across threads
- Full RPC coverage: Blocks, headers, transactions, mempool, UTXO queries
- Mempool transactions: Resolves prevouts for mempool tx fee calculation
- Reorg detection:
get_closest_valid_heightfinds main chain after reorg - Sync waiting:
wait_for_synced_nodeblocks until node catches up
Core API
let client = Client::new("http://localhost:8332", Auth::CookieFile(cookie_path))?;
let height = client.get_last_height()?;
let hash = client.get_block_hash(height)?;
let block = client.get_block(&hash)?;
// Mempool
let txids = client.get_raw_mempool()?;
let entries = client.get_raw_mempool_verbose()?;
Key Methods
get_block,get_block_hash,get_block_header_infoget_transaction,get_mempool_transaction,get_tx_outget_raw_mempool,get_raw_mempool_verboseget_blockchain_info,get_last_heightis_in_main_chain,get_closest_valid_height
Built On
brk_errorfor error handlingbrk_loggerfor debug loggingbrk_typesforHeight,BlockHash,Txid,MempoolEntryInfo
Dependencies
~33MB
~473K SLoC