From c841633ee69714e8a24d30d5c05422eb7bf1267e Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Tue, 18 Feb 2020 17:54:22 +1000 Subject: [PATCH 1/2] Added plugins_reloadPluginConfig Signed-off-by: Madeline Murray --- .../HowTo/Interact/APIs/Using-JSON-RPC-API.md | 3 +- docs/Reference/API-Methods.md | 43 +++++++++++++++++++ docs/Reference/CLI/CLI-Syntax.md | 6 ++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/docs/HowTo/Interact/APIs/Using-JSON-RPC-API.md b/docs/HowTo/Interact/APIs/Using-JSON-RPC-API.md index 841475943a0..f8a9f13a633 100644 --- a/docs/HowTo/Interact/APIs/Using-JSON-RPC-API.md +++ b/docs/HowTo/Interact/APIs/Using-JSON-RPC-API.md @@ -104,7 +104,8 @@ curl -v 'http://localhost:8545/liveness' The `ETH`, `NET`, and `WEB3` API methods are enabled by default. Use the [`--rpc-http-api`](../../../Reference/CLI/CLI-Syntax.md#rpc-http-api) or [`--rpc-ws-api`](../../../Reference/CLI/CLI-Syntax.md#rpc-ws-api) -options to enable the `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `IBFT`, `MINER`, `PERM`, and `TXPOOL` API methods. +options to enable the `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `IBFT`, `MINER`, `PERM`, `PLUGINS`, `PRIV`, +and `TXPOOL` API methods. ## Block Parameter diff --git a/docs/Reference/API-Methods.md b/docs/Reference/API-Methods.md index ad8ab1ad55d..5701d1ad812 100644 --- a/docs/Reference/API-Methods.md +++ b/docs/Reference/API-Methods.md @@ -4535,6 +4535,49 @@ Returns information about the private transaction after the transaction was mine } } ``` + +## Plugins Methods + +!!! note + The `PLUGINS` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](CLI/CLI-Syntax.md#rpc-http-api) + or [`--rpc-ws-api`](CLI/CLI-Syntax.md#rpc-ws-api) options to enable the `PLUGINS` API methods. + +### plugins_reloadPluginConfig + +Reloads plugin configuration. If no parameters are specified, Besu attempts to reload all plugin +configurations. + +**Parameters** + +`string` - Plugin + +**Returns** + +? + + +!!! example + ```bash tab="curl HTTP request" + curl -X POST --data '{"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":["tech.pegasys.plus.plugin.kafka.KafkaPlugin"],"id":1}' http://127.0.0.1:8545 + ``` + + ```bash tab="Reload all plugins" + curl -X POST --data '{"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":[],"id":1}' http://127.0.0.1:8545 + ``` + + ```bash tab="wscat WS request" + {"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":["tech.pegasys.plus.plugin.kafka.KafkaPlugin"],"id":1} + ``` + + ```json tab="JSON result" + { + "jsonrpc": "2.0", + "id": 1, + "result": { + ? + } + } + ``` ## Miscellaneous Methods diff --git a/docs/Reference/CLI/CLI-Syntax.md b/docs/Reference/CLI/CLI-Syntax.md index 1aaafed346c..0f82a4b7da2 100644 --- a/docs/Reference/CLI/CLI-Syntax.md +++ b/docs/Reference/CLI/CLI-Syntax.md @@ -1361,7 +1361,8 @@ 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`, `EEA`, `PRIV`, and `TXPOOL`. +The available API options are: `ADMIN`, `ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM`, `DEBUG`, +`MINER`, `EEA`, `PRIV`, `PLUGINS`, and `TXPOOL`. The default is: `ETH`, `NET`, `WEB3`. !!!tip @@ -1560,7 +1561,8 @@ 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: `ADMIN`,`ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM`, `DEBUG`, `MINER`, `EEA`, `PRIV`, and `TXPOOL`. +The available API options are: `ADMIN`,`ETH`, `NET`, `WEB3`, `CLIQUE`, `IBFT`, `PERM`, `DEBUG`, +`MINER`, `EEA`, `PRIV`, `PLUGINS`, and `TXPOOL`. The default is: `ETH`, `NET`, `WEB3`. !!!tip From 6da350889899132414f12ec5f0fecb04e0bf080c Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Thu, 20 Feb 2020 18:59:57 +1000 Subject: [PATCH 2/2] Added reload plugin config method Signed-off-by: Madeline Murray --- docs/Reference/API-Methods.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/docs/Reference/API-Methods.md b/docs/Reference/API-Methods.md index 5701d1ad812..18825ef5a38 100644 --- a/docs/Reference/API-Methods.md +++ b/docs/Reference/API-Methods.md @@ -4544,8 +4544,7 @@ Returns information about the private transaction after the transaction was mine ### plugins_reloadPluginConfig -Reloads plugin configuration. If no parameters are specified, Besu attempts to reload all plugin -configurations. +Reloads specified plugin configuration. **Parameters** @@ -4553,17 +4552,12 @@ configurations. **Returns** -? - +`string` - `Success` !!! example ```bash tab="curl HTTP request" curl -X POST --data '{"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":["tech.pegasys.plus.plugin.kafka.KafkaPlugin"],"id":1}' http://127.0.0.1:8545 ``` - - ```bash tab="Reload all plugins" - curl -X POST --data '{"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":[],"id":1}' http://127.0.0.1:8545 - ``` ```bash tab="wscat WS request" {"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":["tech.pegasys.plus.plugin.kafka.KafkaPlugin"],"id":1} @@ -4571,11 +4565,9 @@ configurations. ```json tab="JSON result" { - "jsonrpc": "2.0", - "id": 1, - "result": { - ? - } + "jsonrpc": "2.0", + "id": 1, + "result": "Success" } ```