However learn how to parse these recordsdata?
It isn’t too tough to parse bitcoin blockchain if in case you have programming expertise and know what you need to do. Take a look to my piece of code – that is only a working instance that parsing is straightforward. After all, it’s a must to write code in your favourite language on your process
#embrace <QTimer>
#embrace "BlockChain.h"
#embrace "Util.h"
#embrace "MyByteArray.h"
#embrace "Goal.h"
BlockChain::BlockChain ( QObject* father or mother ) : QFile ( father or mother ), blkFile ( START_BLOCK )
{
join ( this, SIGNAL ( block ( const QByteArray& ) ), father or mother, SLOT ( block ( const QByteArray& ) ) );
join ( this, SIGNAL ( doneFile ( ) ), father or mother, SLOT ( doneFile ( ) ) );
QTimer::singleShot ( 0, this, SLOT ( begin ( ) ) );
}
void BlockChain::begin ( )
{
setFileName ( blkFileName ( blkFile++ ) );
if ( !open ( QIODevice::ReadOnly ) )
{
_trace ( QString ( "cant open [%1]" ).arg ( fileName ( ) ) )
emit block ( QByteArray ( ) );
deleteLater ( );
}
else
{
_trace ( QString ( "processing [%1]" ).arg ( fileName ( ) ) )
QTimer::singleShot ( 0, this, SLOT ( subsequent ( ) ) );
}
}
void BlockChain::subsequent ( )
{
if ( pos ( ) < dimension ( ) )
{
quint32 magic;
quint32 sz ( learn ( (char*)&magic, 4 ) );
whereas ( !magic && pos ( ) < dimension ( ) - 4 )
learn ( (char*)&magic, 4 );
xassert ( ( ( magic == MAGIC_ID ) || !magic ) && ( sz == 4 ) )
if ( magic )
{
learn ( (char*)&sz, 4 );
emit block ( learn ( sz ) );
QTimer::singleShot ( 0, this, SLOT ( subsequent ( ) ) );
return;
}
}
shut ( );
emit doneFile ( );
QTimer::singleShot ( 0, this, SLOT ( begin ( ) ) );
}
const QString BlockChain::blkFileName ( const int i ) const
{
return
( i < 10 ) ? QString ( DATA_ROOT "blk0000percent1.dat" ).arg ( i ) :
( i < 100 ) ? QString ( DATA_ROOT "blk000percent1.dat" ).arg ( i ) :
( i < 1000 ) ? QString ( DATA_ROOT "blk00percent1.dat" ).arg ( i ) :
QString ( DATA_ROOT "blk0percent1.dat" ).arg ( i );
}