存储在/var/hyperledger/production中的分类账规模日益增大。例如,在3-4年后,大小可以以兆字节为单位.有没有-
在做r/w transactions?
发布于 2021-04-12 03:12:03
对于您的问题,我尝试在源代码中找到答案,并给出一点答案。
1、回答第一个问题:
在fabric v1.4.2源代码commom/ledger/blockfile_mgr.go中,使用方法getTransactionByID作为tx查询,根据该方法,该方法将调用方法getTxLoc,我们可以知道当我们查询tx时,首先需要获得tx定位的块,我们可以快速找到这个索引块(我对索引机制没有深入了解,但我认为这对性能有帮助)
2关于你的第二个和第三个问题的、:
在fabric v1.4.2源代码commom/ledger/blockfile_mgr.go中,将方法addBlock作为块添加到块文件中(位于addBlock上,我们可以在该方法中找到一些有用的信息:
//Determine if we need to start a new file since the size of this block
//exceeds the amount of space left in the current file
//default value of maxBlockfileSize is 64 * 1024 * 1024
if currentOffset+totalBytesToAppend > mgr.conf.maxBlockfileSize {
mgr.moveToNextFile()
currentOffset = 0
}它意味着当块文件大于64 * 1024 * 1024时,它将创建一个新的块文件。
3、回答最后一个问题
我没有找到相关的信息
希望这些对你有帮助。
https://stackoverflow.com/questions/67030624
复制相似问题