3

I'm trying to build an explorer and I need to pull information about the wallet address such as transactions.

Do I have to loop through everything with importaddress or is there an easier way?

I already have the blockchain indexed so I can look at transactions outside my own.

1 Answer 1

1

If you want to import multiple things at the same time using the Bitcoin Core RPC, then importmulti is the best way to do so. It takes an array of JSON objects which can contain descriptors, scriptPubKeys, addresses, keys, and other metadata. It is a very useful RPC.

7
  • would i have to do this every single address? how would the loop for php look like? would i have to loop through every block then every transaction?
    – Daniel
    Dec 17, 2021 at 2:36
  • Hi Daniel, I'm not sure I understand your question. You can pass all the addresses into a single call to importmulti and it will import all of them at once.
    – meshcollider
    Dec 17, 2021 at 3:48
  • im trying to build an explorer, but i need to add every since wallet on a watch list. do i have to loop through the block hashes then loop through the transactions? i have to essentially add every since address to this function?
    – Daniel
    Dec 17, 2021 at 15:40
  • 1
    @Daniel if you want to add every address ever used on the blockchain, then you might want to reconsider your approach. Bitcoin Core is not designed as a blockchain explorer backend. In that case, you should create your own database and store all the data yourself rather than importing every single address into a wallet.
    – meshcollider
    Dec 17, 2021 at 18:22
  • 1
    Manually parse the blockchain for all transaction data using your own program, Bitcoin Core is not designed for that purpose so using it would be inefficient.
    – meshcollider
    Dec 18, 2021 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.