我正在学习stable,并尝试使用Geth1.7.3-稳定的专用网络。
帐户有105个eth在私人网络,我试着发送eth如下所示。
但是eth.sendTransaction命令只返回eth.sendTransaction
而accounts1没有收到任何eth。
> eth.getBalance(eth.accounts[0])
105000000000000000000
> personal.unlockAccount(eth.accounts[0])
Unlock account 0x24636f1423f131f5441fbee83323c53c59af247d
Passphrase:
true
> eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(2, 'ether')})
"0xaf571929f95ddeaab8761d719dba3c852f5d4f9895968a905c275561eaf57ae6"
>
> eth.getBalance(eth.accounts[1])
0有人知道怎么解决这个问题吗?
发布于 2018-01-10 08:20:25
首先,检查并确保事务已到达区块链。使用
web3.eth.filter("pending").watch(
function(error,result){
if (!error) {
console.log('Tx Hash: ' + result);
}
}
)一旦设置了侦听器,再次运行您的sendTransaction并确认您正在获得日志语句。如果是这样,则正确地提交事务。
正如注释中提到的,下一步是确保事务被挖掘。有几种方法可以做到这一点:
geth attach附加到它。在geth控制台中,您可以开始使用miner.start()进行挖掘。它将返回null,但是您应该在geth输出中看到活动,表明挖掘已经启动。若要停止挖掘,请键入miner.stop()。geth仍在运行。任何挂起的事务都应被拾取。
https://stackoverflow.com/questions/48181065
复制相似问题