EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

i can't find my account by invoke 'getKeyAccounts' with my publicKey while using eosjs #73

Closed justXyS closed 6 years ago

justXyS commented 6 years ago

I have created a new account, and I can't find it using 'getKeyAccounts', but 'getAccounts' worked. Is there any problem with the source code?

songsongMr commented 6 years ago

var pubkey="EOS5r9ZWZmnZ1e4xqdPQ3iAJcepM7rm4vLC2G1PMY4PJoa8cEyqL5"; eos.getKeyAccounts(pubkey).then(val => { console.log(val );
}); console: { "account_names": [ "qq" ] }

but mine is not the latest version.

jcalfee commented 6 years ago

I'm not sure, maybe something in nodeos? What version of eosjs and nodeos are you using?

songsongMr commented 6 years ago

"eosjs": "^8.0.0" nodeos --version 1105878423

jcalfee commented 6 years ago

This version works as follows:

node -p 'Number(1105878423).toString(16)'
41ea5d97

So, that is a commit ID in eosio/eos 22 days ago. DAWN-2018-04-23-ALPHA is 15 days old. Please try the latest release in the README (eosjs 9x). We are due for a release but the other option is to move to a daily build.

songsongMr commented 6 years ago

ok,thank you !