主内
ー。。ー。

how to list all key pairs

Overview

This how-to guide provides instructions on how to list all public keys and public/private key pairs within the keosd default wallet. You can use the public and private keys to authorize transactions in an Antelope blockchain.

The example in this how-to guide displays all public keys and public/private key pairs stored within the existing default wallet.

Before you begin

Make sure you meet the following requirements:

Command Reference

See the following reference guide for cleos command line usage and related options:

Procedure

The following steps show how to list all public keys and public/private key pairs stored within the keosd default wallet:

  1. Open the default wallet:
cleos wallet open
Opened: default
  1. Unlock the default wallet. The command will prompt to enter a password:
cleos wallet unlock
password:
  1. Enter the generated password when you created the default wallet:
***

If the password is correct, the wallet gets unlocked:

Unlocked: default
  1. List all public keys within the default wallet:
cleos wallet keys

Example Output

[
"EOS5VCUBtxS83ZKqVcWtDBF4473P9HyrvnCM9NBc4Upk1C387qmF3"
]
  1. List all public/private key pairs withing the default wallet. The command will prompt to enter a password:
cleos wallet private_keys
password:
  1. Enter the generated password when you created the default wallet:
***

Example Output
If the password is correct, the public/private key pairs are listed:

password: [[
"EOS5VCUBt****************************************F3",
"5JnuuGM1S****************************************4D"
]
]

[[caution | Warning]] | Never reveal your private keys in a production environment.

[[info | Note]] | If the above commands does not list any keys, make sure you have created keypairs and imported private keys to your wallet.

Summary

By following these instructions, you are able to list all the public keys and public/private key pairs stored within the keosd default wallet.

Troubleshooting

When you run the cleos wallet open/unlock commands, you may encounter the following CLI error:

cleos wallet open
No wallet service listening on ***. Cannot automatically start keosd because keosd was not found.
Failed to connect to keosd at unix:///Users/xxx.xxx/eosio-wallet/keosd.sock; is keosd running?

To fix this error, make sure the keosd utility is running on your machine:

keosd