EOS rpc list_keys Error 500

  • EOS版本:v1.0+
  • 问题:执行curl http://192.168.1.168:8888/v1/wallet/list_keys
    返回
    {"code":500,"message":"Internal Service Error","error":{"code":7,"name":"bad_cast_exception","what":"Bad Cast","details":[{"message":"Invalid cast from object_type to Array","file":"variant.cpp","line_number":535,"method":"get_array"}]}}
  • 错误分析:
    list_keys now requires an argument, which is your wallet password.
    修正请求
    curl --request POST --url http://192.168.1.112:8888/v1/wallet/list_keys --data '["default","PW5K2Rg4rSYanxx..."]'

    正确返回对应钱包内所有公钥私钥。

  • 常见问题(Wallet not found: default):
    EOS 1.0 release 之前如果创建钱包是用的默认创建命令
    cleos wallet create

    钱包位置是在/home/surou/eosio-wallet/./default.wallet
    可以用cleos wallet create再次创建 查看当前钱包文件位置。
    但是 wallet_api_plugin 查找的位置是在 /home/surou/.local/share/eosio/nodeos/data/./default.wallet(1.0 release左右之后 config.ini wallet-dir = ".")

  • 简单粗暴有效
    cp /home/surou/eosio-wallet/./default.wallet /home/surou/.local/share/eosio/nodeos/data/

版权属于:Surou

本文链接:https://www.bcskill.com/index.php/archives/91.html

相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!

评论