如何在超级账本结构中准确创建块 [英] how exactly blocks are created in hyperledger fabric

查看:74
本文介绍了如何在超级账本结构中准确创建块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过超级账本结构V1.0.需要了解超级账本的内部.

I am going through hyperledger fabric V1.0. Need to know the internals of hyper-ledger.

1)如何在内部在超级账本中保存区块和交易的方式和位置.

1) How and where the blocks and transactions are saved in hyperledger internally.

2)是否在NoSQL DB(级别DB,Couch DB)中?如果是,保存的方式是什么结构??.

2) Is it in the NoSQL DB (Level DB, Couch DB) ??. If yes, what is the structure, in the way it is getting saved ??.

3)在哪里可以找到V1.0的端到端设置文档(包括CA,结构,订购者设置.当前,我正在跟踪链接,该链接正在更新.)

3) Where can I find the end to end setup doc for V1.0 (which includes CA, fabric, orderer setup. Currently I am following the link, which is getting updated.

https://hyperledger-fabric.readthedocs.io/

推荐答案

对于以下所有代码参考,请使用 the fabric git repo 作为指南. (S/O阻止我发布两个以上的链接,因此我无法直接链接到代码片段.)

For all the code references below, use the fabric git repo as your guide. (S/O prevents me from posting more than 2 links, so I'm unable to link to the code fragments directly.)

首先将交易收集到订购服务中的块/批次中.满足BatchSize或经过BatchTimeout时,将剪切块(提供非空块).

Transactions are collected into blocks/batches on the ordering service first. Blocks are cut either when the BatchSize is met, or when BatchTimeout elapses (provided a non-empty block).

参考:

    common/configtx/tool/目录中的
  1. configtx.yaml,以获取有关切割标准的更多信息.
  2. protos/common/common.proto中的Block类型定义.
  1. configtx.yaml in the common/configtx/tool/ directory for more info on the block-cutting criteria.
  2. The Block type definition in protos/common/common.proto.

这些块与LevelDB一起在每个订购服务节点上本地存储到磁盘,以按编号对这些块进行索引-参见orderer/ledger/file.

These blocks are stored locally to disk on every ordering service node along with a LevelDB to index these blocks by number -- see orderer/ledger/file.

然后将这些块(通过订购服务的Deliver RPC)交付给提交对等方.他们将它们存储在本地,并维护基于LevelDB的块索引(类似于订购者的索引),基于LevelDB的历史索引以跟踪区块链上每个密钥的历史,以及维护状态数据库的最新值的状态数据库.区块链上的所有密钥.此状态数据库可以基于LevelDB或CouchDB.有关更多信息,请参见分类帐文档.

These blocks are then delivered (via the ordering service's Deliver RPC) to committing peers. They store them locally, and maintain a LevelDB-based block index (similar to the one for the orderers), a LevelDB-based history index to track the history of each key on the blockchain, and a state database that maintains the latest values for all the keys on the blockchain. This state DB can be either LevelDB or CouchDB-based. See the ledger doc for more info.

PS:问题#3无关紧要,应该将其分解为一个单独的线程.

PS: Question #3 is irrelevant and should be broken off to a separate thread.

这篇关于如何在超级账本结构中准确创建块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆