It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
from sys import path
path.append('..') # I'm running this from the cppForSwig directory
from pybtcengine import *
from datetime import datetime
from BlockUtils import *
# Create the BlockDataManager, scan the chain, organize the block headers
bdm = BlockDataManager_FullRAM.GetInstance()
bdm.readBlkFile_FromScratch('../blk0001.dat') # point this to your blkfile!!!
bdm.organizeChain();
# At this point all blockheaders and txs are loaded into memory.
# Can access instantaneously by hash or by height
# Get block 100,014 because it's got 6 diverse Tx
someBlk = bdm.getHeaderByHeight(100014)
# A helper method to convert header times to a pretty format
def unixTimeToFormatStr(unixTime, formatStr='%Y-%b-%d %I:%M%p'):
dtobj = datetime.fromtimestamp(unixTime)
dtstr = dtobj.strftime(formatStr)
return dtstr[:-2] + dtstr[-2:].lower()
# Another helper to convert raw, 20-byte address values to Base58
def hash160ToAddr(hash160):
b = PyBtcAddress().createFromPublicKeyHash160(hash160)
return b.getAddrStr()
# Going to print senders, receivers
print 'TxList for block #', someBlk.getBlockHeight()
topTxPtrList = someBlk.getTxRefPtrList()
print 'NumTx:', len(topTxPtrList)
for txptr in topTxPtrList:
# We print big-endian because we like to to be able to put it in BlockExplorer to verify
print '\nTx:', binary_to_hex(txptr.getThisHash().toString(), BIGENDIAN)[:16],
# Each Tx has a pointer to the header of the block it's included in
blkHead = txptr.getHeaderPtr()
print 'Blk:', blkHead.getBlockHeight(),
print 'Timestamp:', unixTimeToFormatStr(blkHead.getTimestamp())
# Print the TxIns
for i in range(nIn):
txin = txptr.getTxInRef(i)
if txin.isCoinbase():
print '\tSender:', ''.center(34),
print 'Value: 50 [probably]';
else:
print '\tSender:', hash160ToAddr(bdm.getSenderAddr20(txin).toString()),
print 'Value:', coin2str(bdm.getSentValue(txin))
# Print the TxOuts
for i in range(nOut):
txout = txptr.getTxOutRef(i)
print '\tRecip: ', hash160ToAddr(txout.getRecipientAddr().toString()),
print 'Value:', coin2str(txout.getValue())