-
Notifications
You must be signed in to change notification settings - Fork 393
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
Get raw blocks #171
Comments
Electrum protocol should not support rawblock information. This feature should require to use bitcoind to fetch block data, as made in spruned project. |
@lvaccaro Given some error messages from the Esplora API I assumed it relied on the bitcoind API for some of its calls so a |
It should not, but the esplora electrs fork also provides an HTTP REST API where this could definitely make sense.
It is technically possible, but esplora's electrs is designed in a way that minimizes its use of bitcoind rpc calls. None of the current endpoints result in bitcoind rpc calls, everything is read directly out of electrs's own rocksdb database. However, rocksdb does not currently store the full raw blocks, and storing them would add significant storage requirements. There are two other alternatives that don't involve using bitcoind's rpc:
Because of the relative complexity this has, this feature is not currently prioritized. But it definitely is something that I'd like to eventually implement and will gladly accept a PR for it! |
Well, actually, after giving this some more thought... the alternative outlined at the end of (1) - treating them as byte blobs and manually stitching them together - isn't really that complicated or error prone, its just I went ahead and implemented this in Blockstream/electrs@de1ffb9, will become available with the next deployment. |
Thanks ! |
Thank you for bringing up this suggestion :) Note that it returns the blocks in binary and not in hex as you requested, to reduce bandwidth. But converting this on your side should be easy enough. |
For reference, this is the new endpoint: https://github.com/blockstream/esplora/blob/master/API.md#get-blockhashraw |
Yeah absolutely |
Hi,
Reading through the issues this is not the only request but here it is anyway.
I'm currently putting up a Bitcoin backend plugin for C-lightning [1] which would hit an esplora instance's API. C-lightning needs
sendrawtransaction
,gettxout
,getblock
,estimatesmartfee
and some fields ofgetblockchainfo
.Almost everything was provided by esplora, but not raw blocks (verbosity 0 in
getblock
). It would be great to be able to get them, say, the same way we access the raw transactions ("GET /tx/:txid/hex" ==> "GET /block/:blockhash/hex").Anyway, thanks for open sourcing such a great API for working with Bitcoin !
[1] To potentially replace
bitcoind
The text was updated successfully, but these errors were encountered: