2017-10-09 111 views
1

我在私人網絡中嘗試過geth,當我嘗試sendTransaction時,它失敗地說「錯誤:資金不足*價格+價值」。geth sendTransaction錯誤:資金不足*價格+價值

但帳戶餘額[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

有誰知道什麼是錯?

回答

2

我自己解決了這個問題。原因是chainId爲0.當我設置chainId 8888時,它工作正常。