Hyperledger Fabric of the Channel, to create a channel link several attention points

Long time no update blog, there are many online fabric deployment data, but also very good, but also more comprehensive. I think repetitive work temporarily would not have done, back in time to make detailed and classified;
it will study and work and solve problems encountered in the experience, do some sharing.

And this part of the experience is hard to find on the Internet. If you have any problems in the process, I hope you can leave a message. Thank you! !

 

1, Channel long connection

     In a new channel connection time, will link channel name stored, so this acquisition channel time in the client, need to use get

     

    

  2, add an event mechanism, the difference between 1.2 and 1.3

               Here we need to know when, in the above fabric1.3 version, the 7053 event will have a tombstone, time will inform ported to channel above, that does not require the use of addEventHub 1.3 in future versions for each

       Nodes increase incident.

       Therefore, in order to dynamically switch the code layer, it is necessary to determine target node version fabric

        (A) to link the new channel, to version 1.3, you do not need to increase event

        (B) In the event of a node link channel, already exists, you will need to remove it.

      

       Note: How to get the version information fabric, you can view the version node through docker images. I used here is the script reads the version information.

 

3, multi-organizational events increased attention to points

     Maybe you actually use fabric in the process, often encounter wishes to receive Org1MSP, but received a Org2MSP, such a mistake.

    The main reason is in the business of trading, transfer of ownership of the user's organization MSP pass incorrect. This phenomenon is a problem, but the root cause is when a registered event, when users belong MSP must correspond to the target tissue.

    Sdk first look at the source code:

     

 

   上述,是在增加事件的时候,会使用当前channel链接中用户信息,链接服务器。也就是说一旦建立了链接,那么在整个channel的生命周期中,对目标节点的事件MSP都是当初用户的MSP。

   如何解决这个问题,那么我们就要在注册这个链接的时候想办法

   

    

    换句话说,在注册时间的时候,要检查当前用户归属的MSP,是否可以你增加的节点同属一个MSP,如果不是,则不注册事件,如果是则注册时间。当再次获取channel连接的时候,在检查一下当前所有事件连接是否正确,或未增加的,为增加的,再更加情况增加组织事件:

   

 

   

 

 

   

Guess you like

Origin www.cnblogs.com/zjlong/p/11225542.html