Get blockchain data from node via cURL?

Apologies for the naive question, but I’m trying to learn and not even sure what I’m searching for:

I am able to access my own node’s Mempool API as follows:

curl --socks5-hostname “127.0.0.1:9050” “http://mempoolTorAddress.onion/api/block/000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce

Which returns:

{“id”:“000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce”,“height”:363366,“version”:2,“timestamp”:1435766771,“bits”:404111758,“nonce”:2892644888,“difficulty”:49402014931.22746,“merkle_root”:“9d3cb87bf05ebae366b4262ed5f768ce8c62fc385c3886c9cb097647b04b686c”,“tx_count”:494,“size”:286494,“weight”:1145976,“previousblockhash”:“000000000000000010c545b6fa3ef1f7cf45a2a8760b1ee9f2e89673218207ce”}

Question: How would I get similar data out of the Umbrel node – ideally using cURL – but without relying on the Mempool API?

Thanks & happy new year to all you shadowy super noders. D

The command line command to do this is:

bitcoin-cli getmempoolentry "mytxid"

I don’t think bitcoin-cli has any web interface which is what the mempool web service does!

OK understood! & thanks.

Update … maybe bitcoind does have a web server?

“Since the communication with bitcoind happens through http, any program capable of sending http POST requests, such as the command line tool curl, can be used to communicate with bitcoind. However, to use other tools than bitcoin-cli, you need to setup a username and password”

1 Like