trezor / blockbook

:blue_book: Trezor address/account balance backend
https://trezor.io
GNU Affero General Public License v3.0
653 stars 647 forks source link

API endpoint with latest block hash #1093

Open cpuchainorg opened 4 months ago

cpuchainorg commented 4 months ago

Would be great if we have an additional API endpoint that would return recent block hashes only ( about 100 or 1000 would be good ).

This should be useful for http endpoints to detect reorgs without using websockets

cryptosystems6300 commented 1 month ago

You dont need blockbook for this. Just ask the node directly: https://developer.bitcoin.org/reference/rpc/getbestblockhash.html

e.g.

curl --location '<nod url>'  --header 'Content-Type: application/json' --data '{
    "jsonrpc": "2.0",
    "id": "somedummyid",
    "method": "getbestblockhash",
    "params": []
}'
cpuchainorg commented 2 weeks ago

@cryptosystems6300 You can search on their github why you shouldn't expose your bitcoin rpc to public... they aren't redundant to serve data in public...