EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

Got 500 when trying to get currency stats and balance by HTTP request #3602

Closed LanfordCai closed 6 years ago

LanfordCai commented 6 years ago

TESTNET: JUNGLE testnet OS: Ubuntu 16.04 EOS Version: DAWN 4.2

PROBLEM:

If I executed ./cleos.sh get currency stats eosio.token EOS in my node, the response is:

{
  "EOS": {
    "supply": "3001047375.5766 EOS",
    "max_supply": "10000000000.0000 EOS",
    "issuer": "eosio"
  }
}

But by http request curl 'http://my_node:8888/v1/chain/get_currency_stats' -d '{"contract":"eosio.token","symbol":"EOS"}'

the response is:

{"code":500,"message":"Internal Service Error","error":{"code":3060002,"name":"account_query_exception","what":"Account Query Exception","details":[{"message":"Fail to retrieve account for ","file":"chain_plugin.cpp","line_number":558,"method":"get_abi"}]}}

Same issue for get currency balance,

thinkSharp commented 6 years ago

/v1/chain/get_currency_balance {"code":"eosio.token", "account": "exchange", "symbol":"EOS"}

leefernandes commented 6 years ago

are there plans to refactor chain to use "contract" instead of "code" for parity with cleos or vice versa?

LanfordCai commented 6 years ago

For now, we should use "code" rather than "contract" to do the request, but it might be refactored at some time... Thanks for the reference of @ItsLeeOwen