From 2be38d0304d4c269671d6aefeeffbb7af127b234 Mon Sep 17 00:00:00 2001 From: billy rennekamp Date: Tue, 24 Mar 2020 17:30:35 +0100 Subject: [PATCH] Improve keyring docs (#5822) * Update cli.md * Update cli.md * Update docs/interfaces/cli.md Co-Authored-By: Alessio Treglia * Update docs/interfaces/cli.md Co-Authored-By: Alessio Treglia * replace cli modifications with keyring md * update pasword to keypasswd Co-authored-by: Alessio Treglia Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/interfaces/cli.md | 4 +--- docs/interfaces/keyring.md | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/interfaces/cli.md b/docs/interfaces/cli.md index b06acdba3b..d447abe82f 100644 --- a/docs/interfaces/cli.md +++ b/docs/interfaces/cli.md @@ -62,8 +62,7 @@ The root command (called `rootCmd`) is what the user first types into the comman * **Status** command from the SDK rpc client tools, which prints information about the status of the connected [`Node`](../core/node.md). The Status of a node includes `NodeInfo`,`SyncInfo` and `ValidatorInfo`. * **Config** [command](https://github.com/cosmos/cosmos-sdk/blob/master/client/config.go) from the SDK client tools, which allows the user to edit a `config.toml` file that sets values for [flags](#flags) such as `--chain-id` and which `--node` they wish to connect to. The `config` command can be invoked by typing `appcli config` with optional arguments ` [value]` and a `--get` flag to query configurations or `--home` flag to create a new configuration. -* **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/master/client/keys) from the SDK client tools, which includes a collection of subcommands for using the key functions in the SDK crypto tools, including adding a new key and saving it to disk, listing all public keys stored in the key manager, and deleting a key. -For example, users can type `appcli keys add ` to add a new key and save an encrypted copy to disk, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/master/client/keys/add.go). +* **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/master/client/keys) from the SDK client tools, which includes a collection of subcommands for using the key functions in the SDK crypto tools, including adding a new key and saving it to disk, listing all public keys stored in the key manager, and deleting a key. For example, users can type `appcli keys add ` to add a new key and save an encrypted copy to disk, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/master/client/keys/add.go). For more details about usage of `--keyring-backend` for storage of key credentials look at the [keyring docs](/keyring.md). * [**Transaction**](#transaction-commands) commands. * [**Query**](#query-commands) commands. @@ -135,4 +134,3 @@ Here is an example of an `initConfig()` function from the [nameservice tutorial And an example of how to add `initConfig` as a `PersistentPreRunE` to the root command: +++ https://github.com/cosmos/sdk-tutorials/blob/86a27321cf89cc637581762e953d0c07f8c78ece/nameservice/cmd/nscli/main.go#L42-L44 - diff --git a/docs/interfaces/keyring.md b/docs/interfaces/keyring.md index 588a3a0c9d..a4076cd62f 100644 --- a/docs/interfaces/keyring.md +++ b/docs/interfaces/keyring.md @@ -44,9 +44,10 @@ to execute commands using the `file` option you may want to utilize the followin for multiple prompts: ```sh -$ gaiacli config keyring-backend file # use file backend -$ (echo '1234567890'; echo '1234567890') | gaiacli keys add me # add the key 'me' -$ (echo '1234567890'; echo '1234567890'; echo '1234567890') | gaiad collect-gentxs # multiple prompts +# assuming that KEYPASSWD is set in the environment +$ gaiacli config keyring-backend file # use file backend +$ (echo $KEYPASSWD; echo $KEYPASSWD) | gaiacli keys add me # multiple prompts +$ echo $KEYPASSWD | gaiacli keys show me # single prompt ``` ::: tip