您正在查看: EOS-新手问答 分类下的文章

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/

cleos system newaccount failed with “to account does not exist” error message

The following accounts need to be created before you can use eosio.system contract via cleos system newaccount to create accounts:

systemAccounts = [
    'eosio.bpay',
    'eosio.msig',
    'eosio.names',
    'eosio.ram',
    'eosio.ramfee',
    'eosio.saving',
    'eosio.stake',
    'eosio.token',
    'eosio.upay',
]

//创建系统预留账户
cleos create account eosio eosio.bpay EOS5iezVa6bsmvZ3HNxdqgyX6GFRMWzE7FsjS3cui8Foavxnj8CfR EOS5iezVa6bsmvZ3HNxdqgyX6GFRMWzE7FsjS3cui8Foavxnj8CfR
cleos create account eosio eosio.msig EOS8K1wkfCzPmxAjjfqvqw6zQ1Dbc82YsQyR8MmwNFLcRHcJtth89 EOS8K1wkfCzPmxAjjfqvqw6zQ1Dbc82YsQyR8MmwNFLcRHcJtth89
cleos create account eosio eosio.names EOS5ps938c5zj6UqhdCfssyAy7WSbHgfZoraqD6HrnbpmpEwPwX7S EOS5ps938c5zj6UqhdCfssyAy7WSbHgfZoraqD6HrnbpmpEwPwX7S
cleos create account eosio eosio.ram EOS7DA8jGA6HfZXYcGSGJNsWJL5Q6t5bWcvm4zNykN3Jw7tASzBCR EOS7DA8jGA6HfZXYcGSGJNsWJL5Q6t5bWcvm4zNykN3Jw7tASzBCR
cleos create account eosio eosio.ramfee EOS7R1Ds4zLMPN6onVXjL8XGgKHHCMWjLT7wn3bHcHnQX3dVLErjE EOS7R1Ds4zLMPN6onVXjL8XGgKHHCMWjLT7wn3bHcHnQX3dVLErjE
cleos create account eosio eosio.saving EOS4uDMpca1dAK7HZZRQ1SqWZHvJNnakzsSuTmM12crvzwRorwQcQ EOS4uDMpca1dAK7HZZRQ1SqWZHvJNnakzsSuTmM12crvzwRorwQcQ
cleos create account eosio eosio.stake EOS6BDfFaFZgvx889BQbdaGTMYSn5tUuxaynGQDhpDGD662eBGwkF EOS6BDfFaFZgvx889BQbdaGTMYSn5tUuxaynGQDhpDGD662eBGwkF
cleos create account eosio eosio.upay EOS7zS7sHctU54oD6is2oPfq11duCMSWfda3HXJAghSfqqr2BZZnV EOS7zS7sHctU54oD6is2oPfq11duCMSWfda3HXJAghSfqqr2BZZnV

先创建系统预留账户,然后再创建其他账户

Not producing block because the irreversible block is too old

修改 config.ini
max-irreversible-block-age = -1 //无限制

Set contract eosio.system error 3080006: transaction took too long (2)

$ nodeos --max-transaction-time=1000 --resync

$ cleos create key  # for eosio.token
$ cleos wallet import ...
$ cleos create account eosio eosio.token ...
$ cleos set contract eosio.token build/contracts/eosio.token
$ cleos push action eosio.token create '[ "eosio", "10000000000.0000 SYS", 0, 0, 0]' -p eosio.token
$ cleos push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "memo" ]' -p eosio

$ cleos set contract eosio build/contracts/eosio.system

先部署eosio.token合约,发SYS代币后,再部署 eosio.system合约

EOS Error 3080006: transaction took too long

cd eos/build
make install
cleos set contract build/contracts/eosio eosio.system -x 1000