From fdc6c2b7287463a88029b3ccb990990e9c32a64d Mon Sep 17 00:00:00 2001 From: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Date: Thu, 21 Mar 2019 14:59:17 +1000 Subject: [PATCH] Added txpool_pantheonTransactions (#1145) Signed-off-by: Adrian Sutton --- docs/JSON-RPC-API/Using-JSON-RPC-API.md | 2 +- docs/Reference/JSON-RPC-API-Methods.md | 46 +++++++++++++++++++++++++ docs/Reference/Pantheon-CLI-Syntax.md | 10 +++--- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/docs/JSON-RPC-API/Using-JSON-RPC-API.md b/docs/JSON-RPC-API/Using-JSON-RPC-API.md index 2e8df6fa4d..7cb90103ef 100644 --- a/docs/JSON-RPC-API/Using-JSON-RPC-API.md +++ b/docs/JSON-RPC-API/Using-JSON-RPC-API.md @@ -116,7 +116,7 @@ Send individual requests as a JSON data package at each prompt: The `ETH`, `NET`, and `WEB3` API methods are enabled by default. Use the [`--rpc-http-api`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-api) or [`--rpc-ws-api`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-api) -options to enable the `ADMIN` ,`CLIQUE`,`DEBUG`, `EEA`, `IBFT`, `MINER`, and `PERM` API methods. +options to enable the `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `IBFT`, `MINER`, `PERM`, and `TXPOOL` API methods. !!!note EEA methods are for privacy features. Privacy features are under development and will be available in v1.1. diff --git a/docs/Reference/JSON-RPC-API-Methods.md b/docs/Reference/JSON-RPC-API-Methods.md index b5454fc9ea..74305e1121 100644 --- a/docs/Reference/JSON-RPC-API-Methods.md +++ b/docs/Reference/JSON-RPC-API-Methods.md @@ -2518,6 +2518,52 @@ None "result": "Success" } ``` + +## Txpool Methods + +!!! note + The `TXPOOL` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api) + or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `TXPOOL` API methods. + +### txpool_pantheonTransactions + +Lists transactions in the node transaction pool. + +**Parameters** + +None + +**Returns** + +`result` - List of transactions + +!!! example + ```bash tab="curl HTTP request" + curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_pantheonTransactions","params":[],"id":1}' http://127.0.0.1:8545 + ``` + + ```bash tab="wscat WS request" + {"jsonrpc":"2.0","method":"txpool_pantheonTransactions","params":[],"id":1} + ``` + + ```json tab="JSON result" + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "hash": "0x8a66830098be4006a3f63a03b6e9b67aa721e04bd6b46d420b8f1937689fb4f1", + "isReceivedFromLocalSource": true, + "addedToPoolAt": "2019-03-21T01:35:50.911Z" + }, + { + "hash": "0x41ee803c3987ceb5bcea0fad7a76a8106a2a6dd654409007d9931032ea54579b", + "isReceivedFromLocalSource": true, + "addedToPoolAt": "2019-03-21T01:36:00.374Z" + } + ] + } + ``` ## Miscellaneous Methods diff --git a/docs/Reference/Pantheon-CLI-Syntax.md b/docs/Reference/Pantheon-CLI-Syntax.md index 78fb8f0adc..ac1b7cb4b4 100644 --- a/docs/Reference/Pantheon-CLI-Syntax.md +++ b/docs/Reference/Pantheon-CLI-Syntax.md @@ -1,4 +1,4 @@ -description: Pantheon commande line interface reference +description: Pantheon command line interface reference # Pantheon Command Line @@ -39,7 +39,7 @@ banned-nodeids=["0xc35c3...d615f","0xf42c13...fc456"] List of node IDs with which this node will not peer. The node ID is the public key of the node. You can specify the banned node IDs with or without the `0x` prefix. !!!tip - The singular `--banned-node-id` and plural `--banned-node-ids` are available and are just two + The singular `--banned-node-id` and plural `--banned-node-ids` are available and are two names for the same option. ### bootnodes @@ -684,14 +684,14 @@ rpc-http-api=["ETH","NET","WEB3"] Comma-separated APIs to enable on the HTTP JSON-RPC channel. When you use this option, the `--rpc-http-enabled` option must also be specified. -The available API options are: `ADMIN`, `ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM`, `DEBUG`, `MINER`, and `EEA`. +The available API options are: `ADMIN`, `ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM`, `DEBUG`, `MINER`, `EEA`, and `TXPOOL`. The default is: `ETH`, `NET`, `WEB3`. !!!note EEA methods are for privacy features. Privacy features are under development and will be available in v1.1. !!!tip - The singular `--rpc-http-api` and plural `--rpc-http-apis` are available and are just two + The singular `--rpc-http-api` and plural `--rpc-http-apis` are available and are two names for the same option. ### rpc-http-authentication-credentials-file @@ -846,7 +846,7 @@ rpc-ws-api=["ETH","NET","WEB3"] Comma-separated APIs to enable on WebSockets channel. When you use this option, the `--rpc-ws-enabled` option must also be specified. -The available API options are: `ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM', DEBUG`, `MINER` and `EEA`. +The available API options are: `ADMIN`,`ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM', DEBUG`, `MINER`, `EEA`, and `TXPOOL`. The default is: `ETH`, `NET`, `WEB3`. !!!note