3

I don't think this is possible with the standard JSON-RPC API, but I'd like to get a list of all the internal transactions in a block. By internal transactions I mean transactions initiated by a contract, sending to another address. Like what is listed on EtherScan in the "Internal" tab, but instead of searching by address, search by block.

Are there any tools for this? If not with a standard node out of the box, or maybe there is a third party services for this?

Steve Ellis
  • 1,357
  • 13
  • 21

2 Answers2

3

You can do it with both Parity and Geth using a normal node (with some additional configuration params).

Parity has the trace JSON RPC module, and Geth has its debug module.

Parity offers trace_transaction whilst Geth offers traceTransaction.

comodoro
  • 1,202
  • 1
  • 12
  • 16
Thomas Clowes
  • 4,385
  • 2
  • 19
  • 43
0

You can try

function checkTransactionCount(startBlockNumber, endBlockNumber) {
    console.log("Searching for non-zero transaction counts between blocks "  + startBlockNumber + " and " + endBlockNumber);
    for (var i = startBlockNumber; i <= endBlockNumber; i++) {
        var block = eth.getBlock(i);
        if (block != null) {
            if (block.transactions != null && block.transactions.length != 0) {
                console.log("Block #" + i + " has " + block.transactions.length + " transactions")
            }
        }
    }
}

More here

niksmac
  • 9,673
  • 2
  • 40
  • 72
  • That looks like regular transactions, not internal transactions... or am I missing something? – Steve Ellis Sep 14 '17 at 09:20
  • 1
    @SteveEllis yes you are right, looks like I missed it. I will keep it here anyway, if anybody want to downvote :D – niksmac Nov 20 '17 at 14:36