1

My question is: How can I see pending transactions in geth and how can I see my transactions at the blocks? I tried it but I can't see them?

I found the Managment API but I also can't see the pending tx. I also tried to check my old transactions from my wallet address and they are also not shown! Do I need to configure geth in any way? I have not changed anything in the config file!

enter image description here

Roy Scheffers
  • 3,832
  • 11
  • 31
  • 36

2 Answers2

1

I believe this is what you need:

  • eth.pendingTransactions
  • eth.pendingTransactions.length

enter image description here

Example from my Geth

enter image description here

To filter the transactions sent from your address, you can use this snippet:

m = 796100 // starting block, it's better not start from 0, it's time consuming
n = eth.blockNumber // the 'latest' block

for (var i = m; i < n; i++) {
    var block = eth.getBlock(i, true);
    for (var j = 0; j < block.transactions.length; j++) {
        if (block.transactions[j].from == "0x...") {
            txs.push(block.transactions[j]);
        }
    }
}

In below example, I want to catch all transactions sent from 0xebe78a89cecaf67bb79881d7440ba14486d21b7e between block number 796100 to latest block (796297):

enter image description here

Notes:

  • Geth works best with one-liner JavaScript code. That's why my JS code above is in one line.
  • Bigger and clearer image is available here.
Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98
  • Thank you, that was very helpful, but in my geth I cant see anything like in your first picture. Do i have to configure my geth in any way? –  Sep 06 '18 at 17:11
  • 1
    AA I think I get it, i can just see my transactions, but i would like to see all pending tx in the Ethereum network –  Sep 07 '18 at 11:08
1

You can go to geth console and execute command "txpool". you'll be able to see the pending queue.

Queen
  • 81
  • 5