transactions – How would you advocate parsing a non-public bitcoin core node with nodeJS?


This query is fairly broad as parsing a node includes decoding each transaction inside a block(which might require txindex to be enabled), and recording every output and enter till you find yourself with an inventory of all outputs that haven’t been used as an enter aka an unspent output.

With a completely synced node and txindex=1 you’ll be able to start iterating by every block of the final 200 blocks with loops utilizing the rpc calls getblockhash getblock getrawtransaction and decoderawtransaction, storing the outputs in a database. On every new block you need to test each enter to see if there’s a transaction id matching an output in your current output database, if there’s that output has been spent. The node-bitcoin JSON-RPC wrapper ought to work positive for implementing these calls to your node. As you’ll be able to think about this could take a while.

Supply hyperlink

Leave a reply