I run a testnet Ropsten (revival) ethereum node. I would like to get the content of txpool. With a geth console, I can access the variable txpool.
My question is how can I access this variable within a web3 script ?
Web3 = require("web3");
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
Someting like the following:
pendingTx = web3.txpool ?
pendingTx = web3.eth.txpool ?
they are all undefined...
--XXXapi
only enables the server side api to be available. On the client side you can use npmjs.com/package/web3admin, to extend the normal web3 with extra methods. But some methods are still missing and you have to add them by hand.