以太坊小知识(四)—— Q&A

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/KeenCryp/article/details/81322989

1、以太坊tps的理论计算方式

The block gas limit is 7,999,992
Transaction costs 21,000 gas (let’s assume nothing else is attached)
That’s ~380 transactions per block
With a block time of around 15.03 seconds. As ethstats shows.
This gives us aproximately: 25.346 tx/s.

2、Fatal: invalid genesis file: missing required field ‘gasLimit’ for Genesis

去掉genesis那一层

3、… util.go:45: exit status 2 exit status 1 Makefile:15: recipe for target ‘geth’ failed make: * [geth] Error 1

升级go的版本!

4、交易批量生成程序发1000条tx,但是以太坊节点只打包了600条(比如),此时你去查txpool.status你会发现pending为空,queued不为空(有交易)?

发生这种情况的原因是交易的nonce值断了。怎么解决?

  • nonce补全:补eth_getTransactionCount和queued中最小nonce值之间的那些交易

  • 重启geth进程:简单管用,交易池清空

  • 超时检查机制:如果eth.getTransactionReceipt(txhash)在规定的时间内还没有就要重发。

  • 等待:等默认生命周期(默认是3小时)到了,交易池的交易就清空了

5、以太坊分叉后,stateDB是如何回滚的?代码在哪里?

todo

6、golang版本的以太坊rpc客户端库?

go-ethereum中有两个库,一个ethclient(封装比较高)和一个rpc(封装比较基础)

猜你喜欢

转载自blog.csdn.net/KeenCryp/article/details/81322989
Q&A
今日推荐