-
Notifications
You must be signed in to change notification settings - Fork 83
Use async with esplora-reqwest #115
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
Use async with esplora-reqwest #115
Conversation
29ffb54 to
6ca43c7
Compare
6ca43c7 to
2d8b1fa
Compare
afilini
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.
ACK 2d8b1fa
|
I am not sure if this is us or some problem with generic https calls with async-reqwest, but I am getting this error while trying out a wallet sync But ureq is working fine on the same esplora endpoint.. |
Cargo.toml
Outdated
| esplora-ureq = ["esplora", "bdk/use-esplora-ureq"] | ||
| esplora-reqwest = ["esplora", "bdk/use-esplora-reqwest"] | ||
| async-interface = ["bdk/async-interface"] | ||
| esplora-reqwest = ["esplora", "bdk/use-esplora-reqwest", "async-interface"] |
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.
Ah found the problem.. We need to also enable default-tls for reqwest..
| esplora-reqwest = ["esplora", "bdk/use-esplora-reqwest", "async-interface"] | |
| esplora-reqwest = ["esplora", "bdk/use-esplora-reqwest", "bdk/reqwest-default-tls", "async-interface"] |
|
if we're not going to revert #114 then this PR also needs to be rebased. :-) |
maybe_async is used regardless of which feature is activated, so it shouldn't be behind the cfg()
2d8b1fa to
3b36277
Compare
|
Rebased :) |
This seems to be the issue if you use the % RUST_LOG=debug cargo run --features esplora-reqwest -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
...
ERROR bdk_cli] Esplora(Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("blockstream.info")), port: None, path: "/testnet/api//scripthash/ca0948ef1c5bf5a023f22ed75275d7491c194476c11fbcfc63c0d25ed8234124/txs", query: None, fragment: None }, source: hyper::Error(Connect, "invalid URL, scheme is not http") }))I confirmed that with @raj's suggestion this problem is fixed. We don't have any CI tests for this sort of thing so only found with the manual testing, not sure it's worth setting up integration tests for this project which is sort of meant to be used for manual testing (and other stuff). |
Its definitely worth setting up one, and now that we have automated backend we can use that to cook up a very simple integration test framework using std library only, where we can test out basic operations. This is included in this commit 2302ff5 of #102 . Its still very basic but it works for Rpc and Electrum. Esplora is disabled for now because I was facing some issues with it.. |
Yes as @notmandatory noted, we don't have functional tests yet for bdk-cli. We only check for clap structures and some few other functions.. |
3b36277 to
81e7226
Compare
|
Thanks for the explanation, I just updated the PR 🙏🏻 |
notmandatory
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.
ACK 81e7226
rajarshimaitra
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.
tACK 81e7226
|
@rajarshimaitra is it ok to merge this before #102? I don't think it will conflict much. |
Yes it is.. I will rebase #102 once this is in.. |
Cargo.toml
Outdated
| regex = { version = "1", optional = true } | ||
| bdk-reserves = { version = "0.19", optional = true} | ||
| electrsd = { version= "0.12", features = ["trigger", "bitcoind_22_0"], optional = true} | ||
| tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread"] } |
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.
This should be optional and only included with async-interface
81e7226 to
3ad5b02
Compare
afilini
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.
ACK 3ad5b02
We previously had the esplora-reqwest feature, but it would use sync reqwest, as the "async-interface" feature in BDK wasn't set. This commit sets this feature so that using `esplora-reqwest` always uses async mode.
3ad5b02 to
8d876ef
Compare
afilini
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.
reACK 8d876ef
Description
We previously had the esplora-reqwest feature, but it would use
sync reqwest, as the "async-interface" feature in BDK wasn't set.
This commit sets this feature so that using
esplora-reqwestalwaysuses async mode.
Notes to the reviewers
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.md