问题
Using OpenEthereum, which is the json rpc call allowing to do it?
I found the parity_pubsub module but I ve no idea of the parameter for getting not yet confirmed transactions.
I also found https://web3js.readthedocs.io/en/v1.2.11/web3-eth-subscribe.html#subscribe-pendingtransactions in the web3 module but it doesn t allows to filter transactions and the documentation doesn t explains how to use the full web3 api along OpenEthereum.
The purpose
The aim is to frontrun transactions for arbitrage by always maintinning the highest gas price until the next block is mined.
This involve detecting competiting transactions (those targetting the same Ethereum address as mine and with a higher gas price than me) with the lowest latency as possible in order to replace them as soon as possible (either for abortting the trade or changing the gas price again). So this exclude constantly polling for the answer as the requirement is to have the lowest number of context switches.
来源:https://stackoverflow.com/questions/65095482/how-to-listen-for-incoming-transactions-not-yet-mined-for-a-single-address