Closed thelazyliz closed 4 years ago
Thanks for reporting this. The reason is export_blocks_and_transactions
doesn't enrich inputs. Try using export_all
command with --enrich True
:
bitcoinetl export_all -s 500000 -e 500001 -b 100 -w 4 -p [REMOVED] --chain bitcoin --enrich True
Make sure you used bitcoin-etl>=1.3.0
The result will be in output/.../enriched_transactions_500000_500001.json
.
Note that enriching transactions is a very time-consuming process.
Thanks for the quick response. Would it be possible to return the transaction fee without having to enrich inputs? Or is enriching inputs the only way?
Enriching is the only way that I'm aware of. The reason is the Bitcoin's JSON RPC API only returns references to spent outputs in transaction inputs, but no values, addresses or types. To get the input values, those spent outputs need to be queried separately, this is what we call enrichment.
You are right. I thought about it and realised that to get the fee you would need something along the lines of total input value - total output value, which would require the input values. Thanks for the clarification!
When I export the transactions to json in the following manner,
the transactions that I get all have a negative (or 0) mining fee. Here's a specific example.
If I'm streaming the fees are of the correct value.