txpool

APIs to inspect transaction pools in the node.

The namespace txpool API gives you access to several non-standard RPC methods to inspect the contents of the transaction pool containing all the currently pending transactions as well as the ones queued for future processing.

txpool_content

The content inspection property can be queried to list the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.

The result is an object with two fields pending and queued. Each of these fields is associative arrays, in which each entry maps an origin-address to a batch of scheduled transactions. These batches themselves are maps associating nonces with actual transactions.

Client
Method invocation

Console

txpool.content

RPC

{"method": "txpool_content"}

Parameters

None

Return Value

Type
Description

JSON string

The content of the transaction pool.

Example

Console

> txpool.content
{
  pending: {
    0x18352126c43E4EC314E41b632A0c1af6b233260b: {
      733: {
        blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        blockNumber: "0x0",
        from: "0x18352126c43e4ec314e41b632a0c1af6b233260b",
        gas: "0x5208",
        gasPrice: "0x0",
        input: "0x",
        nonce: "0x2dd",
        signatures: [...],
        to: "0x18352126c43e4ec314e41b632a0c1af6b233260b",
        transactionIndex: "0x0",
        txHash: "0xeeac2d4f1255e50659cd57a58e74e46d2af7122d91e347ca341d4e2cd7da689b",
        type: "TxTypeLegacyTransaction",
        value: "0x2"
      },
    },
    0x952c9a710Ce70D58FD5C55d45c4479b82dEA6DAC: {
      756: {
        blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        blockNumber: "0x0",
        from: "0x952c9a710ce70d58fd5c55d45c4479b82dea6dac",
        gas: "0x5208",
        gasPrice: "0x0",
        input: "0x",
        nonce: "0x2f4",
        signatures: [...],
        to: "0x6afe934786fe008c79577d85d8e1af1f6f14c73a",
        transactionIndex: "0x0",
        txHash: "0x0fad399b31b520e4af5bc9f2ea40de71854a7f3c41d5918d5ed120d1b4fc5154",
        type: "TxTypeLegacyTransaction",
        value: "0x1"
      },
      757: {
        blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        blockNumber: "0x0",
        from: "0x952c9a710ce70d58fd5c55d45c4479b82dea6dac",
        gas: "0x5208",
        gasPrice: "0x0",
        input: "0x",
        nonce: "0x2f5",
        signatures: [...],
        to: "0x18352126c43e4ec314e41b632a0c1af6b233260b",
        transactionIndex: "0x0",
        txHash: "0xdfc3053ce6c27fd4610bb2e103837c4435f27bb6bb9dfd56110cbd2bbe5ea7fa",
        type: "TxTypeLegacyTransaction",
        value: "0x1"
      },
    },
  },
  queued: {
    0x7dCef85A0356c36a0B43772e1F7C2e80cE029b96: {
      786: {
        blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        blockNumber: "0x0",
        from: "0x7dcef85a0356c36a0b43772e1f7c2e80ce029b96",
        gas: "0x5208",
        gasPrice: "0x0",
        input: "0x",
        nonce: "0x312",
        signatures: [...],
        to: "0x7dcef85a0356c36a0b43772e1f7c2e80ce029b96",
        transactionIndex: "0x0",
        txHash: "0xf90dab02c355b4f09d1b1f224380a278a03fc76d1fc7d866fb2ad2f503525717",
        type: "TxTypeLegacyTransaction",
        value: "0x0"
      },
    },
    0xd5B94dd456040612d721A8Eae1e4E97a70b92812: {
      742: {
        blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
        blockNumber: "0x0",
        from: "0xd5b94dd456040612d721a8eae1e4e97a70b92812",
        gas: "0x5208",
        gasPrice: "0x0",
        input: "0x",
        nonce: "0x2e6",
        signatures: [...],
        to: "0xd5b94dd456040612d721a8eae1e4e97a70b92812",
        transactionIndex: "0x0",
        txHash: "0x6266969f1221b258bb2ce6fd2bcce88ad76be1e2b3eb5c770311a2bc0c2cc74a",
        type: "TxTypeLegacyTransaction",
        value: "0x2"
      },
    }
  }
}

HTTP RPC

txpool_inspect

The inspect inspection property can be queried to list a textual summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. This is a method specifically tailored to developers to quickly see the transactions in the pool and find any potential issues.

The result is an object with two fields pending and queued. Each of these fields is associative arrays, in which each entry maps an origin-address to a batch of scheduled transactions. These batches themselves are maps associating nonces with transactions summary strings.

Client
Method invocation

Console

txpool.inspect

RPC

{"method": "txpool_inspect"}

Parameters

None

Return Value

Type
Description

JSON string

A list of pending and queued transactions.

Example

Console

HTTP RPC

txpool_status

The status inspection property can be queried for the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.

The result is an object with two fields pending and queued, each of which is a counter representing the number of transactions in that particular state.

Client
Method invocation

Console

txpool.status

RPC

{"method": "txpool_status"}

Parameters

None

Return Value

Name
Type
Description

pending

int

The number of pending transactions.

queued

int

The number of queued transactions.

Example

Console

HTTP RPC

Last updated