Conflux-Chain / conflux-rust

The official Rust implementation of Conflux protocol. https://doc.confluxnetwork.org
https://doc.confluxnetwork.org
GNU General Public License v3.0
645 stars 196 forks source link

How can i get pending transactions from my full node #2649

Open fwhappy opened 1 year ago

fwhappy commented 1 year ago

eth_newPendingTransactionFilter eth_newPendingTransactions

Neither of these two methods is supported

peilun-conflux commented 1 year ago

There is eth_getAccountPendingTransactions to do the job. You could check the core space document cfx_getaccountpendingtransactions for its usage since they are almost the same except the address format.

fwhappy commented 1 year ago

@peilun-conflux

I saw this message in release v2.2.2 change logs

_Add filter RPCs for cfx core space (including cfx_newFilter, cfx_newBlockFilter, cfx_newPendingTransactionFilter, cfx_getFilterChanges, cfx_getFilterLogs, and cfx_uninstallFilter).

How can i use cfx_newPendingTransactionFilter and cfx_getFilterChanges,

peilun-conflux commented 1 year ago

You should be able to call them directly from the core space RPC endpoint of a running v2.2.2 node.

BTW, I just realize that eth_newPendingTransactionFilter has been supported on the node. Are you accessing them from your local node?

wanliqun commented 1 year ago

@fwhappy

Hi, you can try the eSpace filter API through our confura service:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter","params":[],"id":73}' -H "Content-Type: application/json" https://evm.confluxrpc.com

Please be minded core space filter API support with Confura is still under progress, so you might have to try with you local node.

fwhappy commented 1 year ago

Yes, I'm running a full Node.

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter","params":[],"id":73}' -H "Content-Type: application/json" http://127.0.0.1:8545

{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":73}

Is the local full node not supported yet?

fwhappy commented 1 year ago

@peilun-conflux @wanliqun

My conflux version: Current Version: conflux-rust/v2.2.2-c30c359-20230314/x86_64-linux-gnu/rustc1.62.0

Is there an error config in my hydra.toml ?

fwhappy commented 1 year ago

@peilun-conflux @wanliqun

Add filter RPCs in eSpace including eth_newFilter, eth_newBlockFilter, eth_newPendingTransactionFilter, eth_getFilterChanges, eth_getFilterLogs, eth_uninstallFilter. Note that you need to set poll_lifetime_in_seconds in the configuration to enable these RPCs.

I found this in v2.2.0 release logs.

But what does "poll_lifetime_in_seconds" means, and how value should i set?

wanliqun commented 1 year ago

@fwhappy

yes, you should config poll_lifetime_in_seconds to some non-zero time duration to turn on the filter API. You can config this parameter like tcp timeout as how long the established filter shall persist if no polling action in that time.

fwhappy commented 1 year ago

@wanliqun

Thanks a lot, My full node is already working.

I had two other questions

  1. I know eth_pendingTransactions is work in progress, is there a release date?
  2. I found same guys can send a transaction for 1 Gdrip, while i need at least 20?