简体   繁体   English

Hyperledger v1.0频道

[英]Hyperledger v1.0 channel

In Hyperledger 1.0 could I share ledger between channels? 在Hyperledger 1.0中,我可以在渠道之间共享分类帐吗? For example, if I want to create 2 channels, one for reading and the other for writing (it's like access control), how could I synchronize the ledgers if every channel has its own ledger. 例如,如果我想创建两个通道,一个用于读取,另一个用于写入(就像访问控制一样),那么如果每个通道都有自己的分类帐,我该如何同步分类帐。 is there any other solution? 还有其他解决方案吗? Thank you 谢谢

You say that you want to use channels for flow control. 您说要使用通道进行流量控制。 This is not what channels are for. 这不是渠道的目的。 They are a construct modelling a sub-chain for privacy purposes. 它们是为隐私目的建模子链的构造。 A channel exists on a specified set of peers and runs chaincode or chaincodes that are relevant to the channel's purpose (often a set of transactions between specific participants that require privacy). 通道存在于一组指定的对等方上,并运行与该通道的目的相关的一个或多个链码(通常是需要隐私的特定参与者之间的一组事务)。

Flow control, on the other hand, is required on a single channel and chaincode combination as key clashes in the same database partition are fatal to a transaction. 另一方面,由于单个数据库分区中的键冲突对于事务是致命的,因此在单个通道和链码组合上需要进行流控制。 A key clash happens when a transaction in a block is trying to commit a change to a key that a previous transaction in the same block has already changed. 当块中的事务试图对同一块中先前的事务已更改的密钥进行更改时,就会发生密钥冲突。 The transaction is immediately failed and that is recorded in the block. 事务立即失败,并记录在块中。

EDIT : The late failure is NOT recorded in the block in any way that I can find, however you do get notified through the event hub of the MVCC failure. 编辑 :已故的失败不是记录在任何方式,我可以找块,但是你得到通过MVCC故障事件枢纽通知。 Hyperledger Composer conveniently sends you this notification in the catch block of the "transaction" SDK call. Hyperledger Composer可以在“ transaction” SDK调用的catch块中方便地向您发送此通知。

To get around that, a chaincode should avoid using convenience keys to record status etc because every transaction then comes into conflict. 为了解决这个问题,链码应该避免使用快捷键来记录状态等,因为每笔交易都会发生冲突。 In addition, adding flow control for asset keys is a great idea in that you really want to send changes to a specific asset only when there are no outstanding transactions against that asset. 此外,为资产密钥添加流控制是一个好主意,因为您确实希望仅在没有针对该资产的未完成交易时才将更改发送到特定资产。 A queue can be used to smooth out the flow in case of a burst of activity. 在突发活动的情况下,可以使用队列来平滑流量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM