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

0
14


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

With a totally synced node and txindex=1 you’ll be able to start iterating via 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 must verify each enter to see if there’s a transaction id matching an output in your present output database, if there’s that output has been spent. The node-bitcoin JSON-RPC wrapper ought to work fantastic 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