6

There are several useful txpool queries in geth: txpool_content, txpool_inspect and txpool_status. Since these are not part of the general standard, Parity likely has some other name for the same mechanism.

Ideally, I would get a list of transaction details or hashes that are pending for a supplied account. Although, geth doesn't have an option to filter the results by account, as far as I can tell.

6

The closest I was able to find is parity_pendingTransactions and parity_pendingTransactionsStats.

parity_pendingTransactions is very similar to geth's txpool_content, and gets the job done.


Update: Since I was specifically looking for transactions sent from a specific account, this new method works even better: parity_localTransactions

It only returns the locally-generated transactions. Not that it also lists mined transactions sent locally, so if you only want pending transactions, you'll have to filter them out afterward, using the status field. An example query/response:

curl --data '{"method":"parity_localTransactions","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "0x09e64eb1ae32bb9ac415ce4ddb3dbad860af72d9377bb5f073c9628ab413c532": {
      "status": "mined",
      "transaction": {
        "from": "0x00a329c0648769a73afac7f9381e08fb43dbea72",
        "to": "0x00a289b43e1e4825dbedf2a78ba60a640634dc40",
        "value": "0xfffff",
        "blockHash": null,
        "blockNumber": null,
        "creates": null,
        "gas": "0xe57e0",
        "gasPrice": "0x2d20cff33",
        "hash": "0x09e64eb1ae32bb9ac415ce4ddb3dbad860af72d9377bb5f073c9628ab413c532",
        "input": "0x",
        "condition": {
          "block": 1
        },
        "networkId": null,
        "nonce": "0x0",
        "publicKey": "0x3fa8c08c65a83f6b4ea3e04e1cc70cbe3cd391499e3e05ab7dedf28aff9afc538200ff93e3f2b2cb5029f03c7ebee820d63a4c5a9541c83acebe293f54cacf0e",
        "raw": "0xf868808502d20cff33830e57e09400a289b43e1e4825dbedf2a78ba60a640634dc40830fffff801ca034c333b0b91cd832a3414d628e3fea29a00055cebf5ba59f7038c188404c0cf3a0524fd9b35be170439b5ffe89694ae0cfc553cb49d1d8b643239e353351531532",
        "standardV": "0x1",
        "v": "0x1c",
        "r": "0x34c333b0b91cd832a3414d628e3fea29a00055cebf5ba59f7038c188404c0cf3",
        "s": "0x524fd9b35be170439b5ffe89694ae0cfc553cb49d1d8b643239e353351531532",
        "transactionIndex": null
      }
    },
    "0x...": { ... }
  }
}
  • An approach to filtering out already-mined local transactions is finding an intersection of the local and pending transactions. This does require two queries instead of one. – Noel Maersk Jun 18 '18 at 17:01
0
curl --data '{"method":"parity_pendingTransactions","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://sokol.poa.network

This is how I see all pending tx in particular node https://github.com/paritytech/parity/wiki/JSONRPC-parity-module#parity_pendingtransactions

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.