Skip to content

feat: ohttp client#1

Open
alexlwn123 wants to merge 1 commit intomasterfrom
alex/ohttp
Open

feat: ohttp client#1
alexlwn123 wants to merge 1 commit intomasterfrom
alex/ohttp

Conversation

@alexlwn123
Copy link
Owner

Coauthored with @DanGould

cc @ChristopherA @dpc

/// Sends a GET request to the given `url`, retrying failed attempts
/// for retryable error codes until max retries hit.
async fn get_with_retry(&self, url: &str) -> Result<Response, Error> {
async fn get_with_retry(&self, url: &str) -> Result<http::Response<Vec<u8>>, Error> {
Copy link

Choose a reason for hiding this comment

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

Maybe it's possible to convert http::Response to reqwest::Response, hopefully avoiding this change and all the other one it causes.

.expect("Failed to encapsulate request");
match self
.client
.post("https://relay.com")
Copy link

Choose a reason for hiding this comment

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

This should be provided via constructor of esplora_client::Client, optionally, I think?

@@ -0,0 +1,69 @@
use bitcoin_ohttp as ohttp;
Copy link

Choose a reason for hiding this comment

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

@DanGould shouldn't this be just a public api that we can use, instead of having to copy&paste it?


# default async runtime
tokio = { version = "1", features = ["time"], optional = true }
bitcoin-ohttp = "0.6.0"
Copy link

Choose a reason for hiding this comment

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

This could be an optional compile time feature&dependency.

@dpc
Copy link

dpc commented Oct 16, 2025

If this is available in esplora_client, then we are definitely going to use it in Fedimint's client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants