account Plugins¶
account
plugins can be used with Quorum or clef
to provide additional account management.
It is recommended to first read the Pluggable Architecture overview to learn how to use plugins.
Usage¶
Using with Quorum & clef¶
geth --plugins file:///path/to/plugins.json ...
clef --plugins file:///path/to/plugins.json ...
where the plugins settings file, plugins.json
, defines an account
provider:
{ "providers": { "account": { "name": "quorum-account-plugin-<NAME>", "version": "<VERSION>", "config": "file:///path/to/plugin.json" } } }
See Available plugins for a list of available plugins and their corresponding <NAME>
and <VERSION>
.
RPC API¶
A limited API allows users to interact directly with account
plugins:
Info
Quorum must explicitly expose the API with --rpcapi plugin@account
or --wsapi plugin@account
plugin@account_newAccount
Create a new plugin-managed account:
Parameter | Description |
---|---|
config |
Plugin-specific json configuration for creating a new account. See the plugin’s documentation for more info on the json config required |
Example
curl -X POST \ -H "Content-Type:application/json" \ -d ' { "jsonrpc":"2.0", "method":"plugin@account_newAccount", "params":[{<config>}], "id":1 }' \ http://localhost:22000
plugin_account.newAccount({<config>})
echo ' { "jsonrpc":"2.0", "method":"plugin@account_newAccount", "params":[{<config>}], "id":1 } ' | nc -U /path/to/clef.ipc
plugin@account_importRawKey
Create a new plugin-managed account from an existing private key:
Note
Although this API can be used to move plugin-managed accounts between nodes, the plugin may provide a more preferable alternative. See the plugin’s documentation for more info.
Parameter | Description |
---|---|
rawkey |
Hex-encoded account private key (without 0x prefix) |
config |
Plugin-specific json configuration for creating a new account. See the plugin’s documentation for more info on the json config required |
Example
curl -X POST \ -H "Content-Type:application/json" \ -d ' { "jsonrpc":"2.0", "method":"plugin@account_importRawKey", "params":["<rawkey>", {<config>}], "id":1 }' \ http://localhost:22000
plugin_account.importRawKey(<rawkey>, {<config>})
not supported - use CLI instead
CLI¶
A limited CLI allows users to interact directly with account
plugins:
Info
Use the --verbosity
flag to hide log output, e.g. geth --verbosity 1 account plugin new ...
geth account plugin new
Create a new plugin-managed account:
Parameter | Description |
---|---|
plugins.account.config |
Plugin-specific configuration for creating a new account. Can be file:// or inline-json. See the plugin’s documentation for more info on the json config required |
geth account plugin new \ --plugins file:///path/to/plugin-config.json \ --plugins.account.config file:///path/to/new-acct-config.json
geth account plugin new \ --plugins file:///path/to/plugin-config.json \ --plugins.account.config '{<json>}'
geth account plugin import
Create a new plugin-managed account from an existing private key:
Parameter | Description |
---|---|
plugins.account.config |
Plugin-specific configuration for creating a new account. Can be file:// or inline-json. See the plugin’s documentation for more info on the json config required |
rawkey |
Path to file containing hex-encoded account private key (without 0x prefix) (e.g. /path/to/raw.key ) |
geth account plugin import \ --plugins file:///path/to/plugin-config.json \ --plugins.account.config file:///path/to/new-acct-config.json \ /path/to/raw.key
geth account plugin import \ --plugins file:///path/to/plugin-config.json \ --plugins.account.config '{<json>}' /path/to/raw.key
geth account plugin list
List all plugin-managed accounts for a given config:
geth account plugin list \
--plugins file:///path/to/plugin-config.json
Available plugins¶
(available soon)
Developers¶
See For Developers.