Hyperledger fabric hyperledger结构如何降低机器的存储成本?
我正在使用hyperledger Fabric和Composer启动我的区块链,我进行了17000多笔交易,但在对等容器中花费了1.8GB(~100KB/笔交易)。我计算了一笔交易的存储量,可能只花费1KB+。所以我的问题是fabric如何将数据保存在分类账中?Hyperledger fabric hyperledger结构如何降低机器的存储成本?,hyperledger-fabric,hyperledger-composer,Hyperledger Fabric,Hyperledger Composer,我正在使用hyperledger Fabric和Composer启动我的区块链,我进行了17000多笔交易,但在对等容器中花费了1.8GB(~100KB/笔交易)。我计算了一笔交易的存储量,可能只花费1KB+。所以我的问题是fabric如何将数据保存在分类账中? 我已使用rest api查找我的记录,如: [ { "$class": "org.chembeango.io.Compound", "compoundId": "870-77-9", "name": "3-a
我已使用rest api查找我的记录,如:
[
{
"$class": "org.chembeango.io.Compound",
"compoundId": "870-77-9",
"name": "3-acetyloxy-4-(trimethylazaniumyl)butanoate",
"smiles": "CC(=O)OC(CC(=O)[O-])C[N+](C)(C)C",
"cas": "870-77-9",
"source": "pubchem",
"location": "http://192.168.11.111:9200/compounds",
"owner": "resource:org.chembeango.io.CompoundParticipant#cp1@email.com"
},
{
"$class": "org.chembeango.io.Compound",
"compoundId": "pubchem-2",
"name": "(2-acetyloxy-3-carboxypropyl)-trimethylazanium",
"smiles": "CC(=O)OC(CC(=O)O)C[N+](C)(C)C",
"cas": "pubchem-2",
"source": "pubchem",
"location": "http://192.168.11.111:9200/compounds",
"owner": "resource:org.chembeango.io.CompoundParticipant#cp1@email.com"
},
...
每个事务可能会创建多个事件,但我认为这不会使每个事务占用如此大的存储空间
我的频道的块配置为:
BatchTimeout: 2s
BatchSize:
MaxMessageCount: 10
AbsoluteMaxBytes: 99 MB
PreferredMaxBytes: 512 KB
我在每个块中创建一个事务,每个块是否都有其最小大小?我发现了我的问题,我在logic.js中添加了查询函数,如
const validateActions = await query('selectAllValidateActions');
我跟踪了区块文件,发现日志如下:
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
3
,Asset:org.chembeango.io.ValidateAction96�
...
可能交易记录会将我的所有查询结果记录到分类账中。因此,分类账保存了大量无用信息。
但为什么composer查询结果可能会保存到分类账中