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

[docs] Update Import keys cleos How-to - 2.0 #10073

Merged
merged 4 commits into from
May 25, 2021
Merged
Changes from all 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
43 changes: 34 additions & 9 deletions docs/02_cleos/02_how-to-guides/how-to-import-a-key.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
## Goal
## Overview

Import an key pair
This how-to guide provides instructions on how to import a private key into the `keosd` default wallet. You can use the private key to authorize transactions in an EOSIO blockchain.

## Before you begin
## Before you Begin

* Install the currently supported version of `cleos`
Make sure you meet the following requirements:

* Understand the following:
* What is a public and private key pair
* Create a default wallet using the `cleos wallet create` command. See the [How to Create a Wallet](../02_how-to-guides/how-to-create-a-wallet.md) section for instructions.
* Open and unlock the created wallet.
* Familiarize with the [`cleos wallet import`](../03_command-reference/wallet/import.md) command.
* 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 `cleos`.
* Understand what a [public key](https://developers.eos.io/welcome/latest/glossary/index/#public-key) and [private key](https://developers.eos.io/welcome/latest/glossary/index/#private-key) is.

## Steps
## Command Reference

See the following reference guide for `cleos` command line usage and related options:
* [cleos wallet import](../03_command-reference/wallet/import.md) command and its parameters

## Procedure

The following steps show how to import a private key to an existing `keosd` default wallet:

1. Run the following command to import a private key into the default wallet. The command prompts to enter a private key:
```sh
cleos wallet import
```
```console
private key:
```

Type your private key. You should see something like this:
2. Enter the private key and hit Enter.
```sh
***
```

**Example Output**
The command confirms that the private key is imported correctly by displaying the corresponding public key:
```console
private key: imported private key for: EOS8FBXJUfbANf3xeDWPoJxnip3Ych9HjzLBr1VaXRQFdkVAxwLE7
imported private key for: EOS8FBXJUfbANf3xeDWPoJxnip3Ych9HjzLBr1VaXRQFdkVAxwLE7
```

## Summary

By following these instructions, you are able to import a private key to the default wallet.