This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10403 from EOSIO/docs/devrel-1499-2.1
[docs] Update reference for various cleos commands - 2.1
- Loading branch information
Showing
10 changed files
with
174 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,46 @@ | ||
## Command | ||
```sh | ||
cleos create key [OPTIONS] | ||
``` | ||
**Where**: | ||
* [`OPTIONS`] = See **Options** in [**Command Usage**](command-usage) section below. | ||
|
||
**Where** | ||
* [OPTIONS] = See Options in Command Usage section below. You must choose one option of `--file` or `--to-console` | ||
|
||
**Note**: The arguments and options enclosed in square brackets are optional. | ||
**Note:** The arguments and options enclosed in square brackets are optional. | ||
|
||
## Description | ||
Creates a new keypair and either prints the public and private keys to the screen or to a file. | ||
Use this command to create a new keypair and print the public and private keys | ||
|
||
## Command Usage | ||
The following information shows the different positionals and options you can use with the `cleos create key` command: | ||
|
||
### Positionals: | ||
- none | ||
### Positionals | ||
* none | ||
|
||
### Options | ||
- `-h,--help` - Print this help message and exit | ||
- `--r1` - Generate a key using the R1 curve (iPhone), instead of the K1 curve (Bitcoin) | ||
`-f`,`--file` _TEXT_ - Name of file to write private/public key output to. (Must be set, unless "--to-console" is passed | ||
`--to-console` - Print private/public keys to console. | ||
* `-h,--help` - Print this help message and exit | ||
* `--r1` - Generate a key using the R1 curve (iPhone), instead of the K1 curve (Bitcoin) | ||
* `-f`,`--file` _TEXT_ - Name of file to write private/public key output to. (Must be set, unless "--to-console" is passed | ||
* `--to-console` - Print private/public keys to console | ||
|
||
## Requirements | ||
* Install the currently supported version of `cleos`. | ||
[[info | Note]] | ||
| The `cleos` tool is bundled with the EOSIO software. [Installing EOSIO](../../00_install/index.md) will install the `cleos` and `keosd` command line tools. | ||
For prerequisites to run this command, see the **Before you Begin** section of the [How to Create Keypairs](../../02_how-to-guides/how-to-create-key-pairs.md) topic. | ||
|
||
## Examples | ||
1. Create a new key pair and output to the screen | ||
```shell | ||
cleos create key --to-console | ||
``` | ||
**Where** | ||
`--to-console` = Tells the `cleos create key` command to print the private/public keys to the console. | ||
The following examples demonstrate the `cleos create key` command: | ||
|
||
**Example Output** | ||
```shell | ||
Private key: 5KDNWQvY2seBPVUz7MiiaEDGTwACfuXu78bwZu7w2UDM9A3u3Fs | ||
Public key: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC | ||
**Example 1.** Create a new public/private keypair and print the output to the console: | ||
```sh | ||
cleos create key --to-console | ||
``` | ||
|
||
2. Create a new key pair and output to a file | ||
```shell | ||
cleos create key --file my_keys.txt | ||
```console | ||
Private key: 5KPzrqNMJdr6AX6abKg*******************************cH | ||
Public key: EOS4wSiQ2jbYGrqiiKCm8oWR88NYoqnmK4nNL1RCtSQeSFkGtqsNc | ||
``` | ||
**Where** | ||
`--file` keys.txt = Tells the `cleos create key` command to output the private/public keys to afile called `my_keys.txt`. | ||
|
||
**Example Output** | ||
```shell | ||
saving keys to my_keys.txt | ||
**Example 2.** Create a new public/private keypair and save it to a file named `pw.txt`: | ||
```sh | ||
cleos create key --file pw.txt | ||
``` | ||
|
||
```shell | ||
cat my_keys.txt | ||
``` | ||
|
||
**Example Output** | ||
```shell | ||
Private key: 5KWcfnGao5K6WV65Zgjd1xvpugRUeKwb6oxzmwaS1tPE2Ef4qzo | ||
Public key: EOS7oDiBtzSHtShprGFmXm9JLnwxhcPeDyhww3tXDvVATDYtciLGG | ||
```console | ||
saving keys to pw.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.