-
Notifications
You must be signed in to change notification settings - Fork 50
docs: add example for EsploraClient with timeout configuration #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
docs: add example for EsploraClient with timeout configuration #359
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AdamuAbba
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the comment
a63ddd5 to
f60708b
Compare
There was a problem hiding this 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.rsexample 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.
AmosOO7
left a comment
There was a problem hiding this 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.
examples/esplora_with_timeout.rs
Outdated
| println!(); | ||
|
|
||
| let balance = wallet.balance(); | ||
| println!("Wallet balance after syncing: {}", balance.total()); | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated that
f60708b to
1e0c375
Compare
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>
1e0c375 to
c00c2af
Compare
AmosOO7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cACK c00c2af
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:
Closes #260
Checklists
All Submissions:
just pbefore pushingFeatures: