我在私人网络中尝试了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
有谁知道出了什么问题?
答案 0 :(得分:2)
我自己解决了这个问题。原因是chainId为0.当我设置chainId 8888时,它工作正常。