From ec5508a523a81834b2e0749f335549c7d79543db Mon Sep 17 00:00:00 2001 From: Rim Rakhimov Date: Thu, 17 Feb 2022 00:13:27 +0300 Subject: [PATCH] Add 'parity_newTransactionsStats' RPC call description and corresponding '--new-transactions-stats-period' CLI parameter --- Configuring-OpenEthereum.md | 3 +++ JSONRPC-parity-module.md | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Configuring-OpenEthereum.md b/Configuring-OpenEthereum.md index a45c608..3f67bb9 100644 --- a/Configuring-OpenEthereum.md +++ b/Configuring-OpenEthereum.md @@ -467,6 +467,9 @@ Sealing/Mining Options: --max-round-blocks-to-import=[S] Maximal number of blocks to import for each import round. (default: 12) + --new-transactions-stats-period=[N] + Specify number of blocks for which new transactions will be returned in a result of `parity_newTransactionsStats` RPC call. Setting this parameter to 0 will return only transactions imported during the current block. (default: 0) + Internal Options: --can-restart Executable will auto-restart if exiting with 69 diff --git a/JSONRPC-parity-module.md b/JSONRPC-parity-module.md index 9b42e4d..849e393 100644 --- a/JSONRPC-parity-module.md +++ b/JSONRPC-parity-module.md @@ -69,6 +69,7 @@ title: The `parity` Module - [parity_nextNonce](#parity_nextnonce) - [parity_pendingTransactions](#parity_pendingtransactions) - [parity_pendingTransactionsStats](#parity_pendingtransactionsstats) +- [parity_newTransactionsStats](#parity_newtransactionsstats) - [parity_registryAddress](#parity_registryaddress) - [parity_removeTransaction](#parity_removetransaction) - [parity_rpcSettings](#parity_rpcsettings) @@ -2225,6 +2226,44 @@ Response *** +### parity_newTransactionsStats + +Returns propagation stats for transactions recently added into the queue. + +#### Parameters + +None + +#### Returns + +- `Object` - mapping of transaction hashes to stats. + +#### Example + +Request +```bash +curl --data '{"method":"parity_newTransactionsStats","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545 +``` + +Response +```js +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "0xdff37270050bcfba242116c745885ce2656094b2d3a0f855649b4a0ee9b5d15a": { + "firstSeen": 3032066, + "propagatedTo": { + "0x605e04a43b1156966b3a3b66b980c87b7f18522f7f712035f84576016be909a2798a438b2b17b1a8c58db314d88539a77419ca4be36148c086900fba487c9d39": 1, + "0xbab827781c852ecf52e7c8bf89b806756329f8cbf8d3d011e744a0bc5e3a0b0e1095257af854f3a8415ebe71af11b0c537f8ba797b25972f519e75339d6d1864": 1 + } + } + } +} +``` + +*** + ### parity_registryAddress The address for the global registry.