? ? ? ? ?MSPs會配置在區(qū)塊鏈網(wǎng)絡中的兩個地方:通道配置(channel MSPs)和本地配置(local MSP)黔衡。客戶端(users)和nodes節(jié)點(peers和orderers)會使用到本地MSPs曲秉。本地節(jié)點的MSPs定義了該節(jié)點的權限(例如:該節(jié)點的管理員)二蓝。本地MSPs可以使用戶在一個事務中實現(xiàn)自我認證(簽名)翘盖,證明該用戶是一個通道的成員(例如:在鏈碼事務中),或者作為在系統(tǒng)中特殊角色的擁有者(例如:組織管理員瓶摆,在配置事務中)凉逛。
? ? ? ??每個節(jié)點和用戶必須定義一個本地MSP,它定義了誰擁有管理或訪問權限在它所在的層級(peer的管理員不一定是通道管理員群井,反之亦然)状飞。
? ? ? ?通道MSPS在通道層級定義了管理和訪問權限。每個參加通道的組織需要有一個MSP书斜。通道中的peer和orderers共享相同的通道MSPs信息昔瞧,它們能正確的識別通道參與者。如果一個組織希望加入某個通道菩佑,那么該組織信任鏈上游的MSP需要被包含在通道配置中自晰。否者基于該組織的事務將被通道中的節(jié)點拒絕。
? ? ? ?本地MSPs和通道MSPs的最主要區(qū)別不在于它們的功能不同—它們都是實現(xiàn)身份到角色的轉化—而是在于它們的作用范圍
Local and channel MSPs. The trust domain (e.g., the organization) of each peer is defined by the peer’s local MSP, e.g., ORG1 or ORG2. Representation of an organization on a channel is achieved by adding the organization’s MSP to the channel configuration. For example, the channel of this figure is managed by both ORG1 and ORG2. Similar principles apply for the network, orderers, and users, but these are not shown here for simplicity.
You may find it helpful to see how local and channel MSPs are used by seeing what happens when a blockchain administrator installs and instantiates a smart contract, as shown in the?diagram above.
An administrator?B?connects to the peer with an identity issued by?RCA1?and stored in their local MSP. When?B?tries to install a smart contract on the peer, the peer checks its local MSP,?ORG1-MSP, to verify that the identity of?B?is indeed a member of?ORG1. A successful verification will allow the install command to complete successfully. Subsequently,?B?wishes to instantiate the smart contract on the channel. Because this is a channel operation, all organizations on the channel must agree to it. Therefore, the peer must check the MSPs of the channel before it can successfully commit this command. (Other things must happen too, but concentrate on the above for now.)