diff --git a/docs/Permissions/Permissioning.md b/docs/Permissions/Permissioning.md index e223de10e7..ddb2cef5de 100644 --- a/docs/Permissions/Permissioning.md +++ b/docs/Permissions/Permissioning.md @@ -18,11 +18,16 @@ A node with node whitelisting enabled communicates only with nodes in the nodes Node whitelisting is at the node level. That is, each node in the network has a [`permissions_config.toml`](#permissions-configuration-file) file in the [data directory](../Reference/Pantheon-CLI-Syntax.md#data-path) for the node. -To view or update the nodes whitelist when the node is running, use the JSON-RPC API methods: +To update the nodes whitelist when the node is running, use the JSON-RPC API methods: * [perm_addNodesToWhitelist](../Reference/JSON-RPC-API-Methods.md#perm__addnodestowhitelist) * [perm_removeNodesFromWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_removeNodesFromWhiteList) -* [perm_getNodesWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_getNodesWhiteList) + +Alternatively, update the [`permissions_config.toml`](#permissions-configuration-file) file directly and use the +[`perm_reloadPermissionsFromFile`](../Reference/JSON-RPC-API-Methods.md#perm_reloadpermissionsfromfile) method +to update the whitelists. + +To view the nodes whitelist, use the [perm_getNodesWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_getNodesWhiteList) method. !!! note Each node has a `permissions_config.toml` file which means nodes can have different nodes whitelists. @@ -103,11 +108,16 @@ can synchronise and add blocks containing transactions from accounts that are no On-chain permissioning is under development. On-chain permissioning will use one on-chain nodes whitelist. -To view or update the accounts whitelist when the node is running, use the JSON-RPC API methods: +To update the accounts whitelist when the node is running, use the JSON-RPC API methods: + +* [`perm_addAccountsToWhitelist`](../Reference/JSON-RPC-API-Methods.md#perm_addAccountsToWhitelist) +* [`perm_removeAccountsFromWhitelist`](../Reference/JSON-RPC-API-Methods.md#perm_removeAccountsFromWhitelist) + +Alternatively, update the [`permissions_config.toml`](#permissions-configuration-file) file directly and use the +[`perm_reloadPermissionsFromFile`](../Reference/JSON-RPC-API-Methods.md#perm_reloadpermissionsfromfile) method +to update the whitelists. -* [perm_addAccountsToWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_addAccountsToWhitelist) -* [perm_removeAccountsFromWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_removeAccountsFromWhitelist) -* [perm_getAccountsWhitelist](../Reference/JSON-RPC-API-Methods.md#perm_getAccountsWhitelist) +To view the accounts whitelist, use the [`perm_getAccountsWhitelist`](../Reference/JSON-RPC-API-Methods.md#perm_getAccountsWhitelist) method. ### Enabling Account Whitelisting diff --git a/docs/Reference/JSON-RPC-API-Methods.md b/docs/Reference/JSON-RPC-API-Methods.md index b21844d761..f5b414f00f 100644 --- a/docs/Reference/JSON-RPC-API-Methods.md +++ b/docs/Reference/JSON-RPC-API-Methods.md @@ -2386,6 +2386,35 @@ including invalid enode URLs. {"jsonrpc":"2.0","method":"perm_removeNodesFromWhitelist","params":[["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304"]], "id":1} ``` + ```json tab="JSON result" + { + "jsonrpc": "2.0", + "id": 1, + "result": "Success" + } + ``` + +### perm_reloadPermissionsFromFile + +Reloads the accounts and nodes whitelists from the [permissions configuration file](../Permissions/Permissioning.md#permissions-configuration-file). + +**Parameters** + +None + +**Returns** + +`result` - `Success` or `error` if the permissions configuration file is not valid. + +!!! example + ```bash tab="curl HTTP request" + $ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_reloadPermissionsFromFile","params":[], "id":1}' + ``` + + ```bash tab="wscat WS request" + {"jsonrpc":"2.0","method":"perm_reloadPermissionsFromFile","params":[], "id":1} + ``` + ```json tab="JSON result" { "jsonrpc": "2.0",