rustyrussell / bitcoin-iterate Goto Github PK
View Code? Open in Web Editor NEWSimple fast iterator to extract data from bitcoind's blockchain files.
License: Other
Simple fast iterator to extract data from bitcoind's blockchain files.
License: Other
Line 45 in 5e82b67
It might make sense to also add a distinction for MacOS as in Mac OS the blocks are stored at ~/Library/Application Support/Bitcoin/blocks/
cc -O3 -flto -ggdb -I ccan/ -Wall -c -o iterate.o iterate.c
In file included from iterate.c:22:
In file included from ./parse.h:3:
./types.h:4:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
^~~~~~~~~~~~~~~
1 error generated.
make: *** [iterate.o] Error 1
When I execute "bitcoin-iterate" i get an error message "segmentation fault (core dumped)".
Bitcoin blockchain is up-to-date. I am using Ubuntu Desktop 18.
What's the reason for this error and how to fix it?
./bitcoin-iterate/bitcoin-iterate -q --tx=%th --blockdir /mnt/e/Litecoin/blocks >> ltctxs.txt
bitcoin-iterate: Skipped 134006689 at end of /mnt/e/Litecoin/blocks/blk00000.dat
bitcoin-iterate: Skipped 134170322 at end of /mnt/e/Litecoin/blocks/blk00001.dat
......
bitcoin-iterate: Skipped 134205049 at end of /mnt/e/Litecoin/blocks/blk00106.dat
bitcoin-iterate: Skipped 67108861 at end of /mnt/e/Litecoin/blocks/blk00107.dat
bitcoin-iterate: Could not find a genesis block.
when running make I get:
....
./types.h:4:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
^~~~~~~~~~~~~~~
1 error generated.
make: *** [iterate.o] Error 1
according to: https://www.anintegratedworld.com/mac-osx-fatal-error-opensslsha-h-file-not-found you can install openssl with brew install openssl
(which I already had) but then you need to create the symlink like:
> cd /usr/local/include
> ln -s ../opt/openssl/include/openssl .
not sure if the readme should updated for mac users
Would it be possible to add an option that allows for printing only the outputs that are unspend (and therefore in the UTXO cache the script keeps already)?
I would like to use that to iterate over the blocks and dump the UTXO set at a given time, say each month.
I'm looking to dump wallets from inputs to outputs (senders to receivers).
I believe these keys exist within the script portion, but it doesn't look like the tool parses scripts.
Does it make sense to add that functionality?
I encountered an error when running the following command on macOS.
$ bitcoin-iterate -q --tx='%bN %bh %th %tX' --start=761249 --end=761250 > ./dump761249tx.txt
Assertion failed: (space->off + bytes <= sizeof(space->buf)), function space_alloc, file space.h, line 22.
Abort trap: 6
Dumping the transactions of other blocks has no issues.
Hi,
I found out this program needs a full node from genesis block to work, it presents an error - "Could not find a genesis block.", even though I added '--start' to start from certain block height.
I cannot run a full node, what should I do , any suggestions?
Hello there,
First of all, thank you for the excellent tool.
Is it possible to get the first output from the coinbase transaction only from each block?
I can get the input for each coinbase transaction with this command:
# %iB: input UTXO block number (0 for coinbase)
bitcoin-iterate -q --input=%iB,%is | grep "^0,"
However, I'm not sure how to get the first output from the coinbase transaction only, as this command returns every first output for each transaction in the block:
# %oN: output number
bitcoin-iterate -q --output=%oN,%os | grep "^0,"
I'm trying to identify the miner behind each block. I can mostly do this looking at the scriptSig
of the input in the coinbase transaction, but it seems that some miners identify themselves by the address they use to claim the block reward, which can be found in the scriptPubKey
on the first output in the coinbase transaction.
I'm not sure if getting only the coinbase transaction's first output is possible, but I thought it would be best to ask.
EDIT: I'm guessing one solution would be to the hex of every coinbase transaction, then decode each one with bitcoin-cli
and filter out the first output's address with jq
:
bitcoin-iterate -q --transaction=%tN,%tX | grep "^0," | cut -d "," -f 2
# next: bitcoin-cli decoderawtransaction
# next: jq
The question regard only the point of view of the bitcoind node, I don't care if bitcoin-iterate in some case crash or creates not perfect statistics because can't read a block file modified by the node.
can it be used to dump all bitcoin addresses ever used/existed on the blockchain ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.