Here’s what I’m hoping to do: I have Bitcoin Core, Mempool and Electrs running on my Start9 server and it’s great. I’d like to be able to run scripts on my Mac to fetch data on Bitcoin addresses. I’ve been querying blockchain.info for that for a while, and it works perfectly, but part of the point of having my own server is having my own data, so nobody else can notice I check up on the same addresses (“Oh, those must be his” y’know?)
How do I fetch data from Electrs from my Mac? Can you give me an example to get me started?
I fully admit, I’m in over my head here, but I’m just looking for a place to get started. Please be gentle
EDIT and UPDATE: Well, that was super-easy. Mempool has an API. Done!
DOUBLE EDIT: Oops. Maybe not. Let me explain my project a bit more in depth. I’m sort of creating a watch only wallet, minus the wallet, for automation. Let’s say I have 20 addresses. On my Mac, I’d like to run a script that gets the price of Bitcoin from mempool.space, gets the total amount of BTC in my 20 addresses, and does the math to give me the total value in USD… and just for the heck of it, check to make sure the total spent is zero.
I can easily do this using the mempool API, but it’s very slow since the mempool API can only check one address at a time, so it cycles through them. It works, but it’s too slow for my needs (I have a hotkey on my Mac assigned to run the script & show me the balance, using Ubersicht). Previously, I’d been using the blockchain.info API which allows multiple addresses, separated by a “I”. That’s fast and works, but part of the point of setting up my own server was to stop checking my balances on somebody else’s server.
Hopefully this makes more sense now.
Should I be using the Bitcoin CLI? The Electrs API? And if so, can I get some guidance?