【问题标题】:Unable to list accounts using geth console even though accounts exist即使帐户存在,也无法使用 geth 控制台列出帐户
【发布时间】:2021-04-09 16:14:27
【问题描述】:

当我运行 geth 命令列出所有帐户时,它工作正常:

geth account list
INFO [04-09|15:47:35.967] Maximum peer count                       ETH=50 LES=0 total=50
INFO [04-09|15:47:35.967] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [04-09|15:47:35.968] Set global gas cap                       cap=25000000
Account #0: {<my_public_address>} keystore: <path_to_keystore>

但是当我启动它的控制台时,我在请求余额/账户时得到未定义和一个空数组:

> eth.getAccounts()
undefined
> eth.accounts
[]

但是,如果我指定我的地址以检查余额,它可以正常工作:

> eth.getBalance("<my account address>")
3000000000000000000

我在 rinkeby 网络上运行一个本地自托管的以太坊节点: geth --rinkeby --rpc --rpcapi "eth,net,web3" --cache 2048

【问题讨论】:

    标签: ethereum go-ethereum geth


    【解决方案1】:

    尝试手动使用 --keystore 选项,并将路径添加到包含您的密钥库的文件夹。 (在这种情况下,它可能是 ~/.ethereum/rinkeby/keystore )

    【讨论】:

      猜你喜欢
      • 2019-12-04
      • 2011-03-28
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 2022-08-05
      • 2020-10-15
      • 1970-01-01
      • 2016-10-28
      相关资源
      最近更新 更多