Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

[docs] Update reference for various cleos commands - 2.1 #10403

Merged
merged 18 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/02_cleos/03_command-reference/create/account.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
## Command

```ssh
cleos create account [OPTIONS] creator name OwnerKey [ActiveKey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing last ]

```

**Where**:

* [`OPTIONS`] = See **Options** in **Command Usage** section below
* `creator` = The name of the existing account creating the new account
* `name` = The name of the new account
* `OwnerKey` = The owner public key or permission level for the new account
* [`ActiveKey`]= See **Positionals** in **Command Usage** section below

[[info | Note]]
| The arguments and options enclosed in square brackets are optional.

## Description
Create a new account on the blockchain (assumes system contract does not restrict RAM usage)
Use this command to create a new blockchain account on EOSIO.

## Usage
[[info | Note]]
| This command assumes system contract does not restrict RAM usage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs an explanation -> or a link to something explaining ram and accounts, and an accounts requirement for ram and the cost etc


## Command Usage
The following information shows the different positionals and options you can use with the cleos create account command:

```console
Usage: cleos create account [OPTIONS] creator name OwnerKey [ActiveKey]
Expand Down Expand Up @@ -29,16 +50,14 @@ Options:
--delay-sec UINT set the delay_sec seconds, defaults to 0s
```

## Command
A set of EOSIO keys is required to create an account. The EOSIO keys can be generated by using `cleos create key`.
## Requirements
For prerequisites to successfully run this command, see the **Before you Begin** section of the [_How to Create a Blockchain Account_](../02_how-to-guides/how-to-create-an-account.md) guide.

```sh
cleos create account inita tester EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA
```
## Example Command

## Output
```console
cleos create account inita tester EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need the where bit to explain the parameters - help explain the 2 public keys


```json
{
"transaction_id": "6acd2ece68c4b86c1fa209c3989235063384020781f2c67bbb80bc8d540ca120",
"processed": {
Expand Down
44 changes: 25 additions & 19 deletions docs/02_cleos/03_command-reference/create/key.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
## Command

```sh
cleos create key [OPTIONS]
```

**Where**
* [OPTIONS] = See Options in Command Usage section below. You must choose one option of `--file` or `--to-console`
**Where**:

**Note**: The arguments and options enclosed in square brackets are optional.
* [`OPTIONS`] = See **Options** in **Command Usage** section below.

## Description

Use this command to create a new keypair and print the public and private keys

## Command Usage

## Description
Creates a new keypair and either prints the public and private keys to the screen or to a file.
Expand Down Expand Up @@ -39,24 +47,22 @@ Private key: 5KDNWQvY2seBPVUz7MiiaEDGTwACfuXu78bwZu7w2UDM9A3u3Fs
Public key: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC
```

2. Create a new key pair and output to a file
```shell
cleos create key --file my_keys.txt
```
**Where**
`--file` keys.txt = Tells the `cleos create key` command to output the private/public keys to afile called `my_keys.txt`.
## Requirements

**Example Output**
```shell
saving keys to my_keys.txt
```
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.

```shell
cat my_keys.txt
## Examples

The following example creates a keypair and prints the output to the console:

```console
cleos create key --to-console
Private key: 5KPzrqNMJdr6AX6abKg*******************************cH
Public key: EOS4wSiQ2jbYGrqiiKCm8oWR88NYoqnmK4nNL1RCtSQeSFkGtqsNc
```

**Example Output**
```shell
Private key: 5KWcfnGao5K6WV65Zgjd1xvpugRUeKwb6oxzmwaS1tPE2Ef4qzo
Public key: EOS7oDiBtzSHtShprGFmXm9JLnwxhcPeDyhww3tXDvVATDYtciLGG
The following example creates a keypair and saves it to a file using the ``--file`` flag:
```console
cleos create key --file pw.txt
saving keys to pw.txt
```
45 changes: 31 additions & 14 deletions docs/02_cleos/03_command-reference/get/account.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@

## Command

```sh
cleos get account [OPTIONS] name [core-symbol]
```

**Where**
* [OPTIONS] = See Options in Command Usage section below.
**Where**:

**Note**: The arguments and options enclosed in square brackets are optional.
* [`OPTIONS`] = See **Options** in **Command Usage** section below
* `name` = The name of the account to retrieve
* [`core-symbol`] = The expected core symbol of the chain you are querying

## Description
Retrieve an account from the blockchain
Use this command to retrieve information associated with a blockchain account.


## Command Usage
The following information shows the different positionals and options you can use with the `cleos create key` command:

### Positionals:
- `name` _TEXT_ - The name of the account to retrieve
- `core-symbol` _TEXT_ - The expected core symbol of the chain you are querying - OPTIONAL
The following information shows the different positionals and options you can use with the `cleos get account` command:

```console
Usage: cleos get account [OPTIONS] name [core-symbol]

### Options
- `-h,--help` Print this help message and exit
- `-j,--json` - Output in JSON format
Positionals:
name TEXT The name of the account to retrieve (required)
core-symbol TEXT The expected core symbol of the chain you are querying

Options:
-j,--json Output in JSON format
```

## Requirements

For prerequisites to run this command, see the **Before you Begin** section of the [_How to Get Account Information_](../02_how-to-guides/how-to-get-account-information.md) topic.

## Requirements
* Install the currently supported version of `cleos.`
Expand All @@ -29,7 +41,10 @@ The following information shows the different positionals and options you can us

## Examples

1. Get formatted data for user **eosio**
The following examples retrieves data associated with the `eosio` account:

**Example 1: Retrieve formatted data for `eosio` account**


```shell
cleos get account eosio
Expand Down Expand Up @@ -58,7 +73,9 @@ cpu bandwidth: (averaged over 3 days)

producers: <not voted>
```
2. Get JSON data for user **eosio**


**Example 2: Retrieve formatted JSON data for `eosio` account**
halsaphi marked this conversation as resolved.
Show resolved Hide resolved

```sh
cleos get account eosio --json
Expand Down