Bitcoin Forum
November 09, 2024, 10:28:25 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC Getting mempool transactions  (Read 1362 times)
btc_enigma (OP)
Hero Member
*****
Offline Offline

Activity: 692
Merit: 569


View Profile
July 01, 2015, 06:03:10 AM
 #1

What is the correct way to get detail of mempool transactions

Right now I am calling getrawpool and then doing getrawtransaction on each of the mempool transactions. Doing RPC for each transaction is very slow taking an average of 30 seconds

Is there a faster RPC method for doing this, so that I can get consolidated raw mempool transactions in one go ?


jonas.schnelli
Member
**
Offline Offline

Activity: 66
Merit: 16

bitcoin core contributor


View Profile WWW
July 01, 2015, 08:02:59 PM
 #2

You can call
Code:
getrawmempool true
(mind the true = verbose).

If you have to do multiple rpc calls, check out the JSON RPC 2.0 batching options (since bitcoind 0.7 aggregate multiple rpc calls in one). If you need more details check the bitcoin-core source and search after
Code:
static string JSONRPCExecBatch(const UniValue& vReq)

There is a pull request for mempool REST call (https://github.com/bitcoin/bitcoin/pull/6013).
btc_enigma (OP)
Hero Member
*****
Offline Offline

Activity: 692
Merit: 569


View Profile
July 02, 2015, 04:37:30 AM
 #3

You can call
Code:
getrawmempool true
(mind the true = verbose).

If you have to do multiple rpc calls, check out the JSON RPC 2.0 batching options (since bitcoind 0.7 aggregate multiple rpc calls in one). If you need more details check the bitcoin-core source and search after
Code:
static string JSONRPCExecBatch(const UniValue& vReq)

There is a pull request for mempool REST call (https://github.com/bitcoin/bitcoin/pull/6013).

Thanks
Batched json rpc sounds good.  I am using https://github.com/jgarzik/python-bitcoinrpc , not sure if it supports batch mode , will try .

btc_enigma (OP)
Hero Member
*****
Offline Offline

Activity: 692
Merit: 569


View Profile
July 02, 2015, 10:36:17 AM
 #4

Tried batched json rpc, its awesome . Now getting all mempool tx in less than one seconds

Thanks a lot  Grin

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!