Skip to content

Conversation

@Eeshu-Yadav
Copy link

Description

Add a new example demonstrating how to configure EsploraClient with custom timeout and retry settings. This is useful for developers working with slow or unreliable network connections.

The example shows:

  • Setting socket timeout using Builder::timeout()
  • Configuring max retries using Builder::max_retries()
  • Handling timeout-related errors gracefully

Closes #260

Checklists

All Submissions:

Features:

  • I've added example for the feature

@ValuedMammal ValuedMammal added the documentation Improvements or additions to documentation label Dec 27, 2025
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.33%. Comparing base (bec219a) to head (c00c2af).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage   85.24%   85.33%   +0.08%     
==========================================
  Files          23       24       +1     
  Lines        8230     8335     +105     
==========================================
+ Hits         7016     7113      +97     
- Misses       1214     1222       +8     
Flag Coverage Δ
rust 85.33% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@AdamuAbba AdamuAbba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cACK a63ddd5

  • I've tested the example locally and it seems to work fine.
  • I've left a comment regarding the extra comment on the README

README.md Outdated

* [`examples/esplora_async`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_async)
* [`examples/esplora_blocking`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_blocking)
* [`examples/esplora_with_timeout`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_with_timeout) - Demonstrates custom timeout and retry configuration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comment is unnecessary, and just listing the example should suffice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment

Copilot AI review requested due to automatic review settings January 3, 2026 02:13
@Eeshu-Yadav Eeshu-Yadav force-pushed the docs/esplora-timeout-example branch from a63ddd5 to f60708b Compare January 3, 2026 02:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new example demonstrating how to configure EsploraClient with custom timeout and retry settings for developers working with potentially slow or unreliable network connections.

  • Adds esplora_with_timeout.rs example showing Builder::timeout() and Builder::max_retries() configuration
  • Includes comprehensive error handling with helpful tips for timeout failures
  • Updates documentation to reference the new example

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
examples/esplora_with_timeout.rs New example demonstrating EsploraClient configuration with custom timeout (30s) and retry settings (3 retries), including graceful error handling
README.md Adds reference to the new esplora_with_timeout example in the blockchain data sources section
Cargo.toml Registers the new example in the build configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@AmosOO7 AmosOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor cleanup suggestion: the extra newline printed on line 75 can be removed.
Since line 78 can already print \n, it’s sufficient to rely on that for spacing.
This avoids redundant output and keeps the logging logic simpler and more consistent.

Comment on lines 75 to 79
println!();

let balance = wallet.balance();
println!("Wallet balance after syncing: {}", balance.total());
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing the extra line of code in line 75 and just use \n on line 78 just like you have done in other lines

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated that

@Eeshu-Yadav Eeshu-Yadav force-pushed the docs/esplora-timeout-example branch from f60708b to 1e0c375 Compare January 9, 2026 17:48
Add a new example demonstrating how to configure EsploraClient with
custom timeout and retry settings. This is useful for developers
working with slow or unreliable network connections.

The example shows:
- Setting socket timeout using Builder::timeout()
- Configuring max retries using Builder::max_retries()
- Handling timeout-related errors gracefully

Closes bitcoindevkit#260

Signed-off-by: Eeshu-Yadav <eeshuyadav123@gmail.com>
@Eeshu-Yadav Eeshu-Yadav force-pushed the docs/esplora-timeout-example branch from 1e0c375 to c00c2af Compare January 9, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add example for using EsploraClient with timeout configuration

4 participants