2

I know I can get the public key from cleos for a given account but is the reverse possible? Basically, I am trying to find all the account names associated with a public key.

2

Yes, it's possible, you can just retrieve all the accounts for a given public key running the command cleos get accounts EOS_PUB_KEY

Another way to check the accounts for a public key, from an external application, is using the EOS RPC Api, check this out: https://developers.eos.io/eosio-nodeos/reference#get_key_accounts-1

| improve this answer | |
  • I was using get account instead of get accounts :) – Kabir Jun 27 '18 at 2:24
  • Is there a public domain I can use instead of 127.0.0.1 for xhr.open("POST", "127.0.0.1:8888/v1/history/get_key_accounts"); ? – Patoshi パトシ Dec 13 '18 at 18:45
  • I don't see a function to get all accounts but one could do: keys=`cleos wallet keys | grep -v "[]\[]" | cut -f 2 -d "\""`; for i in $keys; do cleos get accounts $i; done – colin Jan 14 '19 at 4:49
  • this was working only with a now deprecated plugin for the node (history plugin) – colin May 13 '19 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.