1

I have two geth nodes in my own private netwrok: nodeA and nodeB. When iam sending transaction from nodeA, i am able to see this transaction in pending pool after call method txpool.content if i have access to nodeA. But is it possible to get txpool from nodeA if i have access only to nodeB? And how i can watch all pending txpool from all nodes?

  • afaik you need both nodes to be synced as 'full nodes'. If you used light to sync them then they won't have access – Daithí Jun 11 at 0:56
1

The transaction pool is something internal to the node. In geth, there is a web3 extension to query it remotely via JSON RPC. See https://github.com/ethereum/go-ethereum/blob/master/internal/web3ext/web3ext.go (TxPool_JS).

You'll have to directly use JSON RPC (enable with -rpcapi txpool):

E.g.:

curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id":1}' http://localhost:8545

{"jsonrpc":"2.0","id":1,"result":{"pending":{},"queued":{}}}

Complete method list is:

  • txpool_content
  • txpool_inspect
  • txpool_status
  • Actually there is methods which iam using now and they just give me pool of my nodeA. But i want to retreview pending txs from other nodes too – ItsMyLife Oct 11 '18 at 12:46
  • Afaik, from outside you can only query it via jsonrpc port. – ivicaa Oct 11 '18 at 15:54
1

The nodes can't tell you about transactions they don't know about.

Each node has a transaction pool but there is no guarantee that it's the same list as you might find on another. In fact, network latency guarantees that there will be differences.

Beware of using the transaction pool for app logic. For example, the transaction pool isn't a very good way to work out the nonce for the next transaction: getting error nonce too low , but nonce is proper stuck since one day

Hope it helps.

0

AFAIK each node only knows about it's own txpool.

If you want to know where those transactions are stored in geth, you can look for transactions.rlp inside your node directory. In case you want to change that file name you can do so by using the following flag:

  --txpool.journal value       Disk journal for local transaction to survive node restarts (default: "transactions.rlp")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.