自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 以太坊miner/worker源码中文分析

//worker 内部包含了很多agent,可以包含之前提到的agent和remote_agent。// worker同时负责构建区块和对象。同时把任务提供给agent。const ( resultQueueSize = 10 miningLogAtDepth = 5 // txChanSize is the size of channel listening to TxPreEve...

2018-05-04 10:16:50 1173

原创 以太坊miner/unconfirmed源码中文分析

//是一个数据结构,用来跟踪用户本地的挖矿信息的,比如挖出了一个块,那么等待足够的后续区块确认之后(5个),再查看本地挖矿的区块是否包含在规范的区块链内部。// headerRetriever is used by the unconfirmed block set to verify whether a previously// mined block is part of the cano...

2018-05-04 10:08:03 329

原创 以太坊miner/remote_agent源码中文分析

//remote_agent 提供了一套RPC接口,可以实现远程矿工进行采矿的功能。// 比如我有一个矿机,矿机内部没有运行以太坊节点,矿机首先从remote_agent获取当前的任务,然后进行挖矿计算,当挖矿完成后,提交计算结果,完成挖矿。type hashrate struct { ping time.Time rate uint64}type RemoteAgent stru...

2018-05-04 10:02:24 548

原创 以太坊miner/miner源码中文分析

//miner用来对worker进行管理, 订阅外部事件,控制worker的启动和停止。// Backend wraps all methods required for mining.type Backend interface { AccountManager() *accounts.Manager//账户管理 BlockChain() *core.BlockChain TxPool...

2018-05-04 09:58:15 2143 1

原创 以太坊miner/agent源码中文分析

import ( "sync" "sync/atomic" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/log")//agent 是具体执行挖矿的对象。 它执行的流程就是,接受计算好了的区块头, 计算mixhash和nonce, 把挖矿好的区块头返回。//构造CpuAge...

2018-05-04 09:52:36 1497

原创 以太坊block源码中文分析

先上源码var ( EmptyRootHash = DeriveSha(Transactions{}) EmptyUncleHash = CalcUncleHash(nil))// A BlockNonce is a 64-bit hash which proves (combined with the// mix-hash) that a sufficient amount...

2018-05-03 14:12:16 650

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除