Skip to content

Commit 2eaa15d

Browse files
Copilotalexandratranfab-10
authored
docs: add txpool_inspect JSON-RPC method (#1948)
* Initial plan * docs: add txpool_inspect method to public networks API reference Agent-Logs-Url: https://github.com/besu-eth/besu-docs/sessions/d6c823e1-2fb0-4ec7-a880-7f934cdb94a7 Co-authored-by: alexandratran <12214231+alexandratran@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> * Apply suggestion from @alexandratran Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> * Apply suggestion from @alexandratran Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net> Co-authored-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> * Apply suggestion from @alexandratran Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> --------- Signed-off-by: Alexandra Carrillo <12214231+alexandratran@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexandratran <12214231+alexandratran@users.noreply.github.com> Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
1 parent 3d2ef3a commit 2eaa15d

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

  • docs/public-networks/reference/api

docs/public-networks/reference/api/index.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8204,6 +8204,70 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_contentFrom","params":["0
82048204
</TabItem>
82058205
</Tabs>
82068206
8207+
### `txpool_inspect`
8208+
8209+
Returns a textual summary of all pending and queued transactions in the pool, grouped by sender
8210+
address and sorted by nonce.
8211+
8212+
The summary is free form, implementation-dependent, and meant to be consumed by humans.
8213+
For programmatic access to the transaction pool, use [`txpool_content`](#txpool_content).
8214+
8215+
#### Parameters
8216+
8217+
None
8218+
8219+
#### Returns
8220+
8221+
`result`: _object_ - transaction pool inspect object with the following fields:
8222+
8223+
- `pending`: _object_ - map of sender addresses to maps of nonces to human-readable transaction
8224+
summary strings, for transactions pending inclusion in the next block
8225+
8226+
- `queued`: _object_ - map of sender addresses to maps of nonces to human-readable transaction
8227+
summary strings, for transactions scheduled for future execution
8228+
8229+
<Tabs>
8230+
8231+
<TabItem value="curl HTTP request" label="curl HTTP request" default>
8232+
8233+
```bash
8234+
curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_inspect","params":[],"id":1}' http://127.0.0.1:8545/ -H "Content-Type: application/json"
8235+
```
8236+
8237+
</TabItem>
8238+
<TabItem value="wscat WS request" label="wscat WS request">
8239+
8240+
```json
8241+
{ "jsonrpc": "2.0", "method": "txpool_inspect", "params": [], "id": 1 }
8242+
```
8243+
8244+
</TabItem>
8245+
<TabItem value="JSON result" label="JSON result">
8246+
8247+
```json
8248+
{
8249+
"jsonrpc": "2.0",
8250+
"id": 1,
8251+
"result": {
8252+
"pending": {
8253+
"0x67ee9a8c19f7873125a875f61add461b4a505d8c": {
8254+
"5": "{sequence: 68178, addedAt: 1775837774160, isLocal=false, hasPriority=false, score=127, 0xfbee0231c6140f9db3bbcef774b3626556f6f5528a6a49dcd38e1f7f86c79368={MessageCall, 5, 0x67ee9a8c19f7873125a875f61add461b4a505d8c, EIP1559, mf: 300.00 kwei, pf: 300.00 kwei, gl: 70926, v: 0 wei, to: 0xe9f8133e47d42bc9962e469721faaf75e385af31}}",
8255+
"6": "{sequence: 68179, addedAt: 1775837774160, isLocal=false, hasPriority=false, score=127, 0x3474c0582722ed751dba809363f58c8d1acea415831b81bc0b0b9f29afb19c19={MessageCall, 6, 0x67ee9a8c19f7873125a875f61add461b4a505d8c, EIP1559, mf: 2.00 mwei, pf: 2.00 mwei, gl: 90617, v: 0 wei, to: 0x1eb4a2620b909a8838e0e24a8e912bd32f4a47a3}}"
8256+
}
8257+
},
8258+
"queued": {
8259+
"0x5fa84846743cc07ab16106ceabad8e4e0ec1c1b6": {
8260+
"29": "{sequence: 2208499, addedAt: 1775952461706, isLocal=false, hasPriority=false, score=127, 0x2bb5f69f2b9737a99a3674018cd2aac5035b907a753a0c797051bc9df0b2a152={MessageCall, 29, 0x5fa84846743cc07ab16106ceabad8e4e0ec1c1b6, EIP1559, mf: 1.40 gwei, pf: 417.90 mwei, gl: 63209, v: 0 wei, to: 0xdac17f958d2ee523a2206206994597c13d831ec7}}",
8261+
"31": "{sequence: 1766002, addedAt: 1775931135467, isLocal=false, hasPriority=false, score=127, 0xdd250f166c086412fae187ef52dfbe1c4ff9405818781ac50f89d67a77a2d432={MessageCall, 31, 0x5fa84846743cc07ab16106ceabad8e4e0ec1c1b6, EIP1559, mf: 47.74 gwei, pf: 9.28 gwei, gl: 21000, v: 0 wei, to: 0x5fa84846743cc07ab16106ceabad8e4e0ec1c1b6}}"
8262+
}
8263+
}
8264+
}
8265+
}
8266+
```
8267+
8268+
</TabItem>
8269+
</Tabs>
8270+
82078271
### `txpool_status`
82088272
82098273
Returns the number of pending and queued transactions in the pool.

0 commit comments

Comments
 (0)