Roles (read+write) in hyperledger

人盡茶涼 提交于 2019-12-24 08:01:05

问题


Is it possible to allow for someone in hyperledger rights only to read, and to others read+write? So, can you specify different roles for users?


回答1:


I'm going to answer the question based on Hyperledger Fabric v1.0.0. The short answer is yes.

There are a couple of areas to discuss:

1) Ability to send (broadcast) and receive (deliver) transactions to/from the ordering service.

As you know, in order for transactions to make it to the ledger, they must go through an ordering service. An ordering service can be divided up into channels (in simplest terms think of channels as being unique ledgers). Each channel has policies which define who is able to read and write from/to the channel. The documentation on this topic is being updated, but basically there are channel reader and writer policies. If you cannot "write" to the channel, you cannot submit transactions to the ordering service. Additionally, if you don't have access to write to a channel, you cannot send endorsement proposals to peers for chaincode which is deployed on channel you don't have write permission for.

These policies are all part of channel configuration transactions (for which the documentation is currently being updated / created).

2) Chaincode

Beyond the channel-based policies mentioned above, it is also possible to restrict access to chaincode functions as well. This is actually typically handled from within chaincode itself and it is up to the deployer / developer of the chaincode to handle this (especially in the current 1.0.0-alpha release). There is some additional work underway to add some access control libraries which will make doing this a lot simpler



来源:https://stackoverflow.com/questions/43017514/roles-readwrite-in-hyperledger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!