mempool
mempool copied to clipboard
feature request: add `/block/:hash/raw` api route for node backend
Description
Currently the /block/:hash/raw
route is only available in production environment (mempool.space), the route is not available in bitcoin.routes.ts and only for the /api/
prefix (esplora backend) as all the /api
calls are redirected to esplora backend.
When using the mempool/backend with Bitcoin Core RPC, as the route is not available there is no endpoint to access the raw format of a block, it would be helpful to have such a feature.
Problem to be solved
This solves the problem of doing different calls to get the header and then get all the transactions of a block when using mempool with Bitcoin Core RPC backend, as it reuses the existing RPC call.
Proposed solution
Add the route to be available when using Bitcoin Core RPC as backend, and ignore it when using esplora or in production environment.
Additional info
As discussed in the matrix chat I've addressed this issue in a PR. #2181