7

I tried geth in a private network, and when I tried sendTransaction, it was failed saying "Error: insufficient funds for gas * price + value".

But the balance of accounts[0] is 4785 ether and it seems sufficient.

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

The command I tried is

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

The genesis json file is

{
  "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 version: 1.7.1

Does anyone know what is wrong?

6
  • check this ethereum.stackexchange.com/questions/9043/…
    – Badr Bellaj
    Oct 9, 2017 at 8:34
  • Hi Badr, thank you for your comment. I clicked the link and read the comments, do you mean this is the bug of geth?
    – moriteru
    Oct 9, 2017 at 9:11
  • Did you try with geth 1.6? Oct 9, 2017 at 10:42
  • first change gas value to a higher value instead 1 otherwise downgrade your version
    – Badr Bellaj
    Oct 9, 2017 at 12:08
  • 1
    The reason is that the chainId is 0. When I set chainId 8888, it worked fine.
    – moriteru
    Oct 9, 2017 at 13:41

1 Answer 1

5

The reason is that the chainId is 0. When I set chainId 8888, it worked fine.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.