1

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

但是账户余额[0] 是 4785 以太币,似乎足够了。

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

有谁知道出了什么问题?

4

1 回答 1

2

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

于 2017-10-09T13:49:48.243 回答