How can I import key to Cleos?

Install Cleos and other EOS tools

We strongly recommend you to use Docker image to setup your development environment.

Please refer to official guide.

developers.eos.io

Create and unlock wallet

To create wallet, run

$ cleos wallet create --to-console

and password of wallet will be shown on terminal

This key is very important. You should keep this password into safe place like password manager.

In some case, you must open your wallet explicitly. Do this command if Cleos says 'Wallet not found'.

$ cleos wallet open

When you use wallet, you must unlock wallet ahead.

$ cleos wallet unlock --password <Password>

Please replace with your wallet's password generated before.

Import your public key

In most case, you only need key of active permission, so you should import only that.

Owner permission is mainly used to recover other permission, therefore it is not necessary to develop EOS application.

To import private key, run

$ cleos wallet import --private-key <Private key>

Of course, you must replace with actual key.

If you just created EOS account on irex, you can copy above command from registered page.

f:id:atcoin:20181029221854j:plain

Else, you can get private key from downloaded json file. (Filename is like 20181212_irex_<account_name>.json)

f:id:atcoin:20181029221917j:plain

Once your key is imported successfully, corresponding public key will appear on terminal.

Please make sure that the key matches with public key of active permission.