diff --git a/docs/02_cleos/03_command-reference/create/account.md b/docs/02_cleos/03_command-reference/create/account.md index 976c986f561..4ae3557b395 100755 --- a/docs/02_cleos/03_command-reference/create/account.md +++ b/docs/02_cleos/03_command-reference/create/account.md @@ -1,43 +1,57 @@ +## Command +```sh +cleos create account [OPTIONS] creator name OwnerKey [ActiveKey] +``` +**Where:** +* [`OPTIONS`] = See **Options** in [**Command Usage**](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`] = The active public key or permission level for the new account + +**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 account on an EOSIO blockchain. -## Usage +[[info | Note]] +| This command assumes system contract does not restrict RAM usage. -```console -Usage: cleos create account [OPTIONS] creator name OwnerKey [ActiveKey] +## Command Usage +The following information shows the different positionals and options you can use with the `cleos create account` command: -Positionals: - creator TEXT The name of the account creating the new account (required) - name TEXT The name of the new account (required) - OwnerKey TEXT The owner public key or permission level for the new account (required) - ActiveKey TEXT The active public key or permission level for the new account +### Positionals +* `creator` _TEXT_ REQUIRED - The name of the account creating the new account +* `name` _TEXT_ REQUIRED - The name of the new account +* `OwnerKey` _TEXT_ REQUIRED - The owner public key or permission level for the new account +* `ActiveKey` _TEXT_ - The active public key or permission level for the new account -Options: - -h,--help Print this help message and exit - -x,--expiration set the time in seconds before a transaction expires, defaults to 30s - -f,--force-unique force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times - -s,--skip-sign Specify if unlocked wallet keys should be used to sign transaction - -j,--json print result as json - --json-file TEXT save result in json format into a file - -d,--dont-broadcast don't broadcast transaction to the network (just print to stdout) - --return-packed used in conjunction with --dont-broadcast to get the packed transaction - -r,--ref-block TEXT set the reference block num or block id used for TAPOS (Transaction as Proof-of-Stake) - --use-old-rpc use old RPC push_transaction, rather than new RPC send_transaction - -p,--permission TEXT ... An account and permission level to authorize, as in 'account@permission' (defaults to 'creator@active') - --max-cpu-usage-ms UINT set an upper limit on the milliseconds of cpu usage budget, for the execution of the transaction (defaults to 0 which means no limit) - --max-net-usage UINT set an upper limit on the net usage budget, in bytes, for the transaction (defaults to 0 which means no limit) - --delay-sec UINT set the delay_sec seconds, defaults to 0s -``` +### Options +* `-h,--help` - Print this help message and exit +* `-x,--expiration` - set the time in seconds before a transaction expires, defaults to 30s +* `-f,--force-unique` - force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times +* `-s,--skip-sign` - Specify if unlocked wallet keys should be used to sign transaction +* `-j,--json` - print result as JSON +* `--json-file` _TEXT_ - save result in JSON format into a file +* `-d,--dont-broadcast` - don't broadcast transaction to the network (just print to `stdout`) +* `--return-packed` - used in conjunction with `--dont-broadcast` to get the packed transaction +* `-r,--ref-block` _TEXT_ - set the reference block num or block id used for TAPOS (Transaction as Proof-of-Stake) +* `--use-old-rpc` - use old RPC push_transaction, rather than new RPC send_transaction +* `-p,--permission` _TEXT_ ... - An account and permission level to authorize, as in `account@permission` (defaults to `creator@active`) +* `--max-cpu-usage-ms` _UINT_ - set an upper limit on the milliseconds of CPU usage budget, for the execution of the transaction (defaults to 0 which means no limit) +* `--max-net-usage` UINT - set an upper limit on the net usage budget, in bytes, for the transaction (defaults to 0 which means no limit) +* `--delay-sec` _UINT_ - set the `delay_sec` seconds, defaults to 0 + +## Requirements +For prerequisites to 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. -## Command -A set of EOSIO keys is required to create an account. The EOSIO keys can be generated by using `cleos create key`. +## Examples +The following examples demonstrate how to use the `cleos create account` command: +**Example 1.** Create a new account `tester` authorized by the creator account `inita`: ```sh cleos create account inita tester EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq EOS7d9A3uLe6As66jzN8j44TXJUqJSK3bFjjEEqR4oTvNAB3iM9SA ``` - -## Output - ```json { "transaction_id": "6acd2ece68c4b86c1fa209c3989235063384020781f2c67bbb80bc8d540ca120", diff --git a/docs/02_cleos/03_command-reference/create/key.md b/docs/02_cleos/03_command-reference/create/key.md index 7b875dfe0b6..96af859faa8 100755 --- a/docs/02_cleos/03_command-reference/create/key.md +++ b/docs/02_cleos/03_command-reference/create/key.md @@ -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 ``` diff --git a/docs/02_cleos/03_command-reference/get/account.md b/docs/02_cleos/03_command-reference/get/account.md index d185cfc9522..8347d6c94a0 100755 --- a/docs/02_cleos/03_command-reference/get/account.md +++ b/docs/02_cleos/03_command-reference/get/account.md @@ -1,43 +1,38 @@ - ## Command +```sh cleos get account [OPTIONS] name [core-symbol] +``` +**Where**: +* [`OPTIONS`] = See **Options** in [**Command Usage**](command-usage) section below +* `name` = The name of the account to retrieve +* [`core-symbol`] = The expected core symbol of the chain you are querying -**Where** -* [OPTIONS] = See Options in Command Usage section below. - -**Note**: The arguments and options enclosed in square brackets are optional. +**Note:** The arguments and options enclosed in square brackets are optional. ## Description -Retrieve an account from the blockchain +Use this command to retrieve information associated with an EOSIO account. ## Command Usage -The following information shows the different positionals and options you can use with the `cleos create key` command: +The following information shows the different positionals and options you can use with the `cleos get account` 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 +### Positionals +* `name` _TEXT_ REQUIRED - The name of the account to retrieve +* `core-symbol` _TEXT_ - The expected core symbol of the chain you are querying ### Options -- `-h,--help` Print this help message and exit -- `-j,--json` - Output in JSON format +* `-h,--help` - Print this help message and exit +* `-j,--json` - Output in JSON format ## 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. -* You have access to an EOSIO blockchain. +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. ## Examples +The following examples demonstrate the `cleos get account` command: -1. Get formatted data for user **eosio** - -```shell +**Example 1.** Retrieve human-readable information about the `eosio` account: +```sh cleos get account eosio ``` -**Where** -`eosio` = The name of the account. - -**Example Output** ```console privileged: true permissions: @@ -58,13 +53,11 @@ cpu bandwidth: (averaged over 3 days) producers: ``` -2. Get JSON data for user **eosio** +**Example 2.** Retrieve JSON-formatted data about the `eosio` account: ```sh cleos get account eosio --json ``` -**Example Output** - ```json { "account_name": "eosio", @@ -131,4 +124,4 @@ cleos get account eosio --json ``` ## See Also -- [Accounts and Permissions](https://developers.eos.io/welcome/v2.1/protocol/accounts_and_permissions) protocol document. +* [Accounts and Permissions](https://developers.eos.io/welcome/v2.1/protocol/accounts_and_permissions) protocol document. diff --git a/docs/02_cleos/03_command-reference/get/transaction.md b/docs/02_cleos/03_command-reference/get/transaction.md index 58d3da75e43..cb08e9fd47f 100755 --- a/docs/02_cleos/03_command-reference/get/transaction.md +++ b/docs/02_cleos/03_command-reference/get/transaction.md @@ -1,21 +1,33 @@ +## Command +```sh +cleos get transaction [OPTIONS] id +``` +**Where**: +* [`OPTIONS`] = See **Options** in [**Command Usage**](command-usage) section below +* `id` = ID of the transaction to retrieve + +**Note:** The arguments and options enclosed in square brackets are optional. + ## Description -Retrieves a transaction from the blockchain +Use this command to retrieve a transaction from the blockchain. -## Positional Parameters -`id`` _TEXT_ - ID of the transaction to retrieve +## Command Usage +The following information shows the different positionals and options you can use with the `cleos get transaction` command: -## Options -` -b,--block-hint` UINT the block number this transaction may be in +### Positionals +* `id` _TEXT_ REQUIRED - ID of the transaction to retrieve -**Command** +### Options +* `-h,--help` - Print this help message and exit +* `-b,--block-hint` _UINT_ - The block number this transaction may be in -```sh -cleos get transaction -``` -**Output** +## Requirements +For prerequisites to run this command, see the **Before you Begin** section of the [How to Get Transaction Information](../../02_how-to-guides/how-to-get-transaction-information.md) topic. -## Example +## Examples +The following examples demonstrate the `cleos get transaction` command: +**Example 1.** Retrieve transaction information for transaction ID `eb4b94b7...b703`: ```sh cleos get transaction eb4b94b72718a369af09eb2e7885b3f494dd1d8a20278a6634611d5edd76b703 ``` @@ -75,5 +87,5 @@ cleos get transaction eb4b94b72718a369af09eb2e7885b3f494dd1d8a20278a6634611d5edd } ``` -[[info | Important Note]] -| The above transaction id will not exist on your blockchain +[[info | Note]] +| The above transaction ID will not exist on your actual EOSIO blockchain. diff --git a/docs/02_cleos/03_command-reference/net/connect.md b/docs/02_cleos/03_command-reference/net/connect.md index be0b2af0b3b..9274bc87313 100755 --- a/docs/02_cleos/03_command-reference/net/connect.md +++ b/docs/02_cleos/03_command-reference/net/connect.md @@ -2,7 +2,6 @@ ```sh cleos net connect [OPTIONS] host ``` - **Where:** * [OPTIONS] = See **Options** in the [**Command Usage**](command-usage) section below. * host = The hostname:port to connect to @@ -30,22 +29,20 @@ Make sure you meet the following requirements: * You have access to a producing node instance with the [`net_api_plugin`](../../../01_nodeos/03_plugins/net_api_plugin/index.md) loaded. ## Examples -The following examples demonstrate how to use the `cleos net connect` command: +The following examples demonstrate the `cleos net connect` command: -* Instruct default local node (listening at default http address `http://127.0.0.1:8888`) to connect to peer node listening at p2p address `localhost:9002`: +**Example 1.** Instruct default local node (listening at default http address `http://127.0.0.1:8888`) to connect to peer node listening at p2p address `localhost:9002`: ```sh cleos net connect localhost:9002 ``` -**Output:** ```console "added connection" ``` -* Instruct local node listening at http address `http://127.0.0.1:8001` to connect to peer node listening at p2p address `localhost:9002`: +**Example 2.** Instruct local node listening at http address `http://127.0.0.1:8001` to connect to peer node listening at p2p address `localhost:9002`: ```sh cleos -u http://127.0.0.1:8001 net connect localhost:9002 ``` -**Output:** ```console "added connection" ``` diff --git a/docs/02_cleos/03_command-reference/net/disconnect.md b/docs/02_cleos/03_command-reference/net/disconnect.md index 29c30399610..428c56c028c 100755 --- a/docs/02_cleos/03_command-reference/net/disconnect.md +++ b/docs/02_cleos/03_command-reference/net/disconnect.md @@ -2,7 +2,6 @@ ```sh cleos net disconnect [OPTIONS] host ``` - **Where:** * [OPTIONS] = See **Options** in the [**Command Usage**](command-usage) section below. * host = The hostname:port to disconnect from @@ -30,22 +29,20 @@ Make sure you meet the following requirements: * You have access to a producing node instance with the [`net_api_plugin`](../../../01_nodeos/03_plugins/net_api_plugin/index.md) loaded. ## Examples -The following examples demonstrate how to use the `cleos net disconnect` command: +The following examples demonstrate the `cleos net disconnect` command: -* Instruct default local node (listening at default http address `http://127.0.0.1:8888`) to disconnect from peer node listening at p2p address `localhost:9002`: +**Example 1.** Instruct default local node (listening at default http address `http://127.0.0.1:8888`) to disconnect from peer node listening at p2p address `localhost:9002`: ```sh cleos net disconnect localhost:9002 ``` -**Output:** ```console "connection removed" ``` -* Instruct local node listening at http address `http://127.0.0.1:8001` to disconnect from peer node listening at p2p address `localhost:9002`: +**Example 2.** Instruct local node listening at http address `http://127.0.0.1:8001` to disconnect from peer node listening at p2p address `localhost:9002`: ```sh cleos -u http://127.0.0.1:8001 net disconnect localhost:9002 ``` -**Output:** ```console "connection removed" ``` diff --git a/docs/02_cleos/03_command-reference/net/peers.md b/docs/02_cleos/03_command-reference/net/peers.md index 2814731c758..50834e0fe0a 100755 --- a/docs/02_cleos/03_command-reference/net/peers.md +++ b/docs/02_cleos/03_command-reference/net/peers.md @@ -2,7 +2,6 @@ ```sh cleos net peers [OPTIONS] ``` - **Where:** * [OPTIONS] = See **Options** in the [**Command Usage**](command-usage) section below. @@ -29,14 +28,12 @@ Make sure you meet the following requirements: * You have access to a producing node instance with the [`net_api_plugin`](../../../01_nodeos/03_plugins/net_api_plugin/index.md) loaded. ## Examples -The following examples demonstrate how to use the `cleos net peers` command: - -* List the status of all peer connections for a local node listening at http address `http://127.0.0.1:8001`: +The following examples demonstrate the `cleos net peers` command: +**Example 1.** List the status of all peer connections for a local node listening at http address `http://127.0.0.1:8001`: ```sh cleos -u http://127.0.0.1:8001 net peers ``` -**Output:** ```json [{ "peer": "", diff --git a/docs/02_cleos/03_command-reference/net/status.md b/docs/02_cleos/03_command-reference/net/status.md index f8f45265ecb..20c32c9106b 100755 --- a/docs/02_cleos/03_command-reference/net/status.md +++ b/docs/02_cleos/03_command-reference/net/status.md @@ -2,7 +2,6 @@ ```sh cleos net status [OPTIONS] host ``` - **Where:** * [OPTIONS] = See **Options** in the [**Command Usage**](command-usage) section below. * host = The hostname:port to query status of connection @@ -30,14 +29,12 @@ Make sure you meet the following requirements: * You have access to a producing node instance with the [`net_api_plugin`](../../../01_nodeos/03_plugins/net_api_plugin/index.md) loaded. ## Examples -The following examples demonstrate how to use the `cleos net status` command: - -* List the status of a connected peer listening at p2p address `localhost:9001` for a local node listening at http address `http://127.0.0.1:8002`: +The following examples demonstrate the `cleos net status` command: +**Example 1.** List the status of a connected peer listening at p2p address `localhost:9001` for a local node listening at http address `http://127.0.0.1:8002`: ```sh cleos -u http://127.0.0.1:8002 net status localhost:9001 ``` -**Output:** ```json { "peer": "localhost:9001", diff --git a/docs/02_cleos/03_command-reference/wallet/import.md b/docs/02_cleos/03_command-reference/wallet/import.md index a3352b7ac17..14b395a5e14 100755 --- a/docs/02_cleos/03_command-reference/wallet/import.md +++ b/docs/02_cleos/03_command-reference/wallet/import.md @@ -1,31 +1,36 @@ ## Command +```sh cleos wallet import [OPTIONS] +``` +**Where**: +* [`OPTIONS`] = See **Options** in [**Command Usage**](command-usage) section below -**Where** -* [OPTIONS] = See Options in Command Usage section below. - -**Note**: The arguments and options enclosed in square brackets are optional. +**Note:** The arguments and options enclosed in square brackets are optional. ## Description -Imports private key into wallet. This command will launch `keosd` if it is not already running. +Imports a private key into a local wallet. This command will launch `keosd` if it is not already running. ## Command Usage The following information shows the different positionals and options you can use with the `cleos wallet import` command: -### Positionals: -- none +### Positionals +* none + ### Options -- `-h,--help` - Print this help message and exit -- `-n, --name` _TEXT_ - The name of the wallet to import key into. -- `--private-key` _TEXT_ - Private key in WIF format to import. +* `-h,--help` - Print this help message and exit +* `-n,--name` _TEXT_ - The name of the wallet to import key into +* `--private-key` _TEXT_ - Private key in WIF format to import ## Requirements -* Install the currently supported version of `cleos` and `keosd`. -[[info | Note]] -| `Cleos` and `keosd` are bundled with the EOSIO software. [Installing EOSIO](../../00_install/index.md) will also install the `cleos` and `keosd` command line tools. +* Install the currently supported version of `cleos`. +[[info | Note]] +| `Cleos` is bundled with the EOSIO software. [Installing EOSIO](../../../00_install/index.md) will also install the `cleos` and `keosd` comand line tools. +* For additional prerequisites to run this command, see the **Before you Begin** section of the [How to Import a Key](../../02_how-to-guides/how-to-import-a-key.md) topic. ## Examples -1. Import a private key to the default wallet. The wallet must be **open** and **unlocked**. +The following examples demonstrate the `cleos wallet import` command: + +**Example 1.** Import a private key to the default wallet: ```shell cleos wallet import ``` @@ -37,19 +42,20 @@ The command asks for the private key. Enter it. ``` **Example Output** -```shell -private key: imported private key for: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC +```console +imported private key for: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC ``` -2. Import a private key to a named wallet. The wallet must be `open` and `unlocked.` +**Example 2.** Import a private key to a named wallet and pass the private key on the command line: ```shell cleos wallet import --name my_wallet --private-key 5KDNWQvY2seBPVUz7MiiaEDGTwACfuXu78bwZu7w2UDM9A3u3Fs ``` -**Where** + +**Where:** `--name` my_wallet = Tells the `cleos wallet import` command to import the key to `my_wallet` `--private-key` 5KDNWQvY2seBPVUz7MiiaEDGTwACfuXu78bwZu7w2UDM9A3u3Fs = Tells the `cleos wallet import` command the private key to import **Example Output** -```shell +```console imported private key for: EOS5zG7PsdtzQ9achTdRtXwHieL7yyigBFiJDRAQonqBsfKyL3XhC ``` diff --git a/docs/02_cleos/03_command-reference/wallet/keys.md b/docs/02_cleos/03_command-reference/wallet/keys.md index 5292da87303..647b552119d 100755 --- a/docs/02_cleos/03_command-reference/wallet/keys.md +++ b/docs/02_cleos/03_command-reference/wallet/keys.md @@ -1,21 +1,35 @@ +## Command +```sh +cleos wallet keys [OPTIONS] +``` +**Where**: +* [`OPTIONS`] = See **Options** in [**Command Usage**](command-usage) section below + +**Note:** The arguments and options enclosed in square brackets are optional. + ## Description +Use this command to list all public keys stored in a wallet. You can use keys to sign and verify transactions. -List of public keys from all unlocked wallets. These are the keys that could be used to sign transactions. +## Command Usage +The following information shows the different positionals and options you can use with the `cleos wallet keys` command: -## Positionals -None. -## Options -None. -## Usage +### Positionals +* none +### Options +* `-h,--help` - Print this help message and exit -```sh -cleos wallet keys -``` +## Requirements +For prerequisites to run this command, see the **Before you Begin** section of the [How to List All Keys](../../02_cleos/02_how-to-guides/how-to-list-all-key-pairs.md) topic. -## Outputs +## Examples +The following examples demonstrate the `cleos wallet keys` command: +**Example 1.** List all public keys within the default wallet: +```sh +cleos wallet keys +``` ```console [[ "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",