【问题标题】:geth sendTransaction error: insufficient funds for gas * price + valuegeth sendTransaction 错误:gas * price + value 资金不足
【发布时间】:2018-03-20 06:24:47
【问题描述】:

我在私有网络中尝试了 geth,当我尝试 sendTransaction 时,提示“错误:gas * price + value 资金不足”失败。

但是accounts[0]的余额是4785 ether,看起来足够了。

web3.fromWei(eth.getBalance(eth.accounts[0]), "ether")
4785

我试过的命令是

eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(1, "ether"), gas: 1})

创世json文件是

{
  "config": {
        "chainId": 0,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
  "alloc"      : {},
  "coinbase"   : "0x0000000000000000000000000000000000000000",
  "difficulty" : "0x20000",
  "extraData"  : "",
  "gasLimit"   : "0x2fefd8",
  "nonce"      : "0x0000000000000042",
  "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp"  : "0x00"
}

geth 版本:1.7.1

有谁知道怎么回事?

【问题讨论】:

    标签: ethereum go-ethereum


    【解决方案1】:

    我自己解决了这个问题。原因是chainId为0。当我设置chainId 8888时,它工作正常。

    【讨论】:

      猜你喜欢
      • 2017-08-15
      • 2018-05-03
      • 2019-01-03
      • 2021-11-19
      • 2019-04-18
      • 1970-01-01
      • 2022-06-11
      • 2021-05-13
      • 2018-04-30
      相关资源
      最近更新 更多