Giter Site home page Giter Site logo

shikita / bitcoin-iterate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rustyrussell/bitcoin-iterate

0.0 1.0 0.0 566 KB

Simple fast iterator to extract data from bitcoind's blockchain files.

License: Other

Makefile 1.01% C 92.20% Objective-C 0.16% C++ 3.16% Roff 3.47%

bitcoin-iterate's Introduction

This is some fast code to iterate over bitcoind's block files to extract blockchain data from the main blockchain.

To build:

  1. make

Things you can do:

Show block hash and transaction size for each transaction in the main chain:

./bitcoin-iterate -q --tx=%bh,%tl

This will produce output like:

000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f,204
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048,134
000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd,134
0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449,134
000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485,134

Show output script sizes in the main chain (block number, transaction number, output number, output script length):

./bitcoin-iterate -q --output=%bN,%tN,%oN:%ol

This will produce output like:

0,0,0:67
1,0,0:67
2,0,0:67
3,0,0:67
4,0,0:67

Show the five largest blocks, by height and blockhash:

./bitcoin-iterate -q --block='%bl %bN %bh' | sort -nr | head -n5

This will produce output like:

999993 343188 96395be50a116886fb04a1262aa89aaa765c4af524d0ae090000000000000000
999991 355770 5ce1f5e58d5d718374b1bdecb474eae5cdd91e1b8a3256050000000000000000
999990 327145 821196665ed237f53ca2c7eafe05c97d26743c07d2b539110000000000000000
999989 345578 0294fa5b68babd848a1fe097b075a856bfd9eb9a619efd130000000000000000
999989 333434 f9776021575b6e408d7745d115db75e17937fc40ab9f0e190000000000000000

You can see some examples by looking at the manual page source.

Enhancements

Happy to consider them!

You can reach me on IRC (rusty on #bitcoin-wizards on Freenode), and of course, via pull requests and the Github bug tracker.

Good luck!
Rusty Russell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.