eos icon indicating copy to clipboard operation
eos copied to clipboard

Can not operate wallet through RPC interface.

Open readygo586 opened this issue 8 years ago • 3 comments

Hi, guys. I want to operate wallet through rpc interface with the following steps

  1. start kesod manually with http_address = 127.0.0.1:8900

  2. use cleos unlock then list the default wallet /eos/build/programs/cleos# ./cleos wallet list Wallets: [ "default *" ]

  3. use curl --url http://127.0.0.1:8900/v1/wallet/list_wallets list the wallet, the result is OK /eos/build/programs/cleos# curl --url http://127.0.0.1:8900/v1/wallet/list_wallets
    ["default *"]

  4. use curl --url http://127.0.0.1:8900/v1/wallet/open to open it, the following errors show out. /eos/build/programs/cleos# curl --url http://127.0.0.1:8900/v1/wallet/open {"code":500,"message":"Internal Service Error","error":{"code":7,"name":"bad_cast_exception","what":"Bad Cast","details":[{"message":"Invalid cast from object_type to string","file":"variant.cpp","line_number":476,"method":"as_string"}]}}

at the kesod's console, the following errors show out 018-08-04T10:20:51.072 thread-0 http_plugin.cpp:475 handle_exception ] FC Exception encountered while processing wallet.open 2018-08-04T10:20:51.072 thread-0 http_plugin.cpp:476 handle_exception ] Exception Details: 7 bad_cast_exception: Bad Cast Invalid cast from object_type to string {"type":"object_type"} thread-0 variant.cpp:476 as_string image image

readygo586 avatar Aug 04 '18 10:08 readygo586

Does some body meet the similar problem?Any suggestion about it?

readygo586 avatar Aug 04 '18 10:08 readygo586

@readygo586 Have you tried this

curl -X POST http://127.0.0.1:8900/v1/wallet/open -d '"default"'

man15h avatar Aug 04 '18 19:08 man15h

@man15h very thanks, your solution works.

readygo586 avatar Aug 05 '18 03:08 readygo586