I'm a web developer looking to integrate a Bitcoin node into a PHP application and I am unsure how I would go about interacting with the Bitcoin core in a developer environment for my machine.
My goal is to pull transaction history on a particular address without using any 3rd party APIs and as such I need to use some sort of Bitcoin interface to do that.
I believe that I need to use the Bitcoin daemon in some sort of manner however I do not know how to use it on my current PC as It is a Windows 10 machine.
Any advice would be greatly appreciated.
1 Answer
I'm a web developer looking to integrate a Bitcoin node into a PHP application and I am unsure how I would go about interacting with the Bitcoin core in a developer environment for my machine.
The most straightforward way of doing it would be to just use JSONRPC to hit bitcoind
's API.
My goal is to pull transaction history on a particular address without using any 3rd party APIs and as such I need to use some sort of Bitcoin interface to do that.
bitcoind
doesn't allow you to directly access an "address mapping". Some applications (notably Electrum servers) build additional indexes which allow them to expose you "by address" APIs and other handy informations.
This usually is a tradeoff between storage vs efficiency.
I believe that I need to use the Bitcoin daemon in some sort of manner however I do not know how to use it on my current PC as It is a Windows 10 machine.
Bitcoin-core allows you to build on Windows and provides Windows binaries as part of the releases.
More subjectively, I usually recommend the Esplora API (which is more precisely the electrs
fork of Blockstream's API) which uses quite a lot of storage but is very efficient for address-based requests.
You can start it quite easily by using the Docker instructions, and for example set it up behind an nginx
reverse proxy on a server so you can hit it (or just use Docker on your Windows machine).
-
Is there any such programs or apps I can use where I can locally map an address? Ideally, I'd like to enter an address and receive all transactions that have recently been made.– EthanJul 9, 2020 at 15:11
-
-
Thank you mate, does this Esplora make API calls to 3rd parties or can it be used locally?– EthanJul 9, 2020 at 16:52
-
As I described, this is an open source project which is made easy to be self-hosted. It doesn't use a third party (that's kinda the point of using almost a terabyte of storage!) Jul 10, 2020 at 12:05
-
If you launch bitcoin core with
txindex
option you have all transaction indexed and so you can query any transaction you want using RPC Jul 11, 2020 at 22:39