I wrote a little page to do a speed test on a large block,
I only ran it three times, but it is consistent,
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import time
rpc_user = "NotMyRealUsername"
rpc_password = "NotMyRealPassword"
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:8332"%(rpc_user, rpc_password))
h = "000000000000000000036f0cfb2dadd069060c8ba36d63f2e11cb02e85ef7ed2"
alldata = rpc_connection.getblock(h)
start = time.time()
for txid in alldata['tx']:
rawtx = rpc_connection.getrawtransaction(txid,1)
stop = time.time()
print(stop-start)
start = time.time()
for txid in alldata['tx']:
rawtx = rpc_connection.getrawtransaction(txid,1,h)
stop = time.time()
print(stop-start)
first without hash is 9 seconds, with hash is 149 seconds
My bitcoin node is live, but only has 20 peers, and little traffic. It is version 0.17 (newest I can install on pfSense), the database is on a dedicated SSD, core 2 quad,
Memory: 221M Active, 290M Free 4G real memory. bitcoind is the only thing that uses any real CPU.
to test my code, open your bitcoin config file to set rpcuser, rpcpassword, rpcallowip, and set txindex=1 (this will require re-indexing... sit back for a week on HDD with my CPU!!!)
If you have an indexed full node, and python, pip install python-bitcoinrpc, and set the proper user/password/ip in the above code.