tendermint源码分析(一):node

  • Post author:
  • Post category:golang

一.tendermint文件结构 abci-client:Tendermint充当有关一个应用的ABCI客户端,并且维护3个连接:mempool,consensu和query。blockchain:提供存储,pool(一组peers)以及在peers之间存储以及交换区块的reactor。consensus:Tendermint core的核心,实现了共识算法。包括两个“子模块”:wal(write…

继续阅读 tendermint源码分析(一):node

以太坊共识引擎源码分析

  • Post author:
  • Post category:其他

这一篇分析以太坊的共识引擎,先看一下各组件之间的关系: Engine接口定义了共识引擎需要实现的所有函数,实际上按功能可以划分为2类: 区块验证类:以Verify开头,当收到新区块时,需要先验证区块的有效性区块盖章类:包括Prepare/Finalize/Seal等,用于最终生成有效区块(比如添加工作量证明) 与区块验证相关联的还有2个外部接口:Processor用于执行交易,而Validator…

继续阅读 以太坊共识引擎源码分析

tendermint源码解析

  • Post author:
  • Post category:其他

一、最基础的默认配置 源码文件:tendermint/tendermint/config/config.go // NOTE: Most of the structs & relevant comments + the // default configuration options were used to manually // generate the config.toml. Pl…

继续阅读 tendermint源码解析

Tendermint源码分析——启动流程分析

  • Post author:
  • Post category:其他

准备参数 cli参数: node --proxy_app=dummy --home "C:\Users\Administrator\datadir\tendermint" Tendermint的cli解析使用cobra库! flags vs args 让我们将程序定格在(c *Command) ExecuteC【/vendor/github.com/spf13/cobra/command.go#】…

继续阅读 Tendermint源码分析——启动流程分析

Tendermint源码解析 —— p2p(对等连接)微服务

  • Post author:
  • Post category:其他

1. peer.go 首先定位到 tendermint/p2p/peer.go 文件,来看 peer 结构体,peer 实现了 Peer。Peer 负责发现节点,广播内容, 接收内容。 // peer 实现了 Peer,Peer是一个接口,表示连接在 reactor 上的 peer // 需要执行一次握手连接,在使用 peer 之前. type peer struct { // 实现了服务的启动、…

继续阅读 Tendermint源码解析 —— p2p(对等连接)微服务

tendermint, switch & reactor

  • Post author:
  • Post category:其他

tendermint, switch & reactor SwitchInitializationacceptRoutine - inboundDialPeerWithAddress - outboundaddPeer ReactorConsensusBlockchainPEXMempoolEvidence These two parts demonstrate how tendermin…

继续阅读 tendermint, switch & reactor