Search code examples
blockchainhyperledger-fabricpeer

What is a peer in blockchain ? is the enrolled user enrolls into a specific peer?


I am new to Blockchain. I am using hyperledger-fabric and sdk-node.

I have 2 orgs and 4 peers. I created a channel (mychannel) and peer0, peer1 of org1 has joined to this channel, and another channel (mychannel1) where peer2,peer3 of org2 has joined.

Let's say I enrolled a user.

Is this user enrolled into a specific peer? Or does he enroll into network? If he enrolls into network then what are peers for? Say I have a user for particular organisation, if he enrolls into the network then he will have access to all the channels. In that case, how can we restrict him from outside channels where his org is not a part? And what is actually a peer?

Sorry for asking many questions in 1. Thanks in advance


Solution

  • Say i enrolled a user. is the user enrolls into specific peer ?. or he enrolls into network ?. if he enrolls into networks then what are peers for?

    First of all, we have an admin. He manages the entities (users, peers...) that will be part of the system. Then, the admin will enroll an admin user for each organization, or he will enroll the peers and users for each organization. After enrolling each entity, they will registry. When you registry against the CA, the CA generate you a pair of keys. They are issued by your CA root.

    So, the user and the peer are enrolled to the CA. Then, they registry themselves. On the one hand, you need a peer to communicate with the other peers and the orderer. On the other hand, you need a user (client) to call the peer, i.e. to generate the transactions.

    how can we restrict him from outside channels where his org is not a part ?

    When you create a channel, you define who is going to take part on it, i.e. you define wich peers are going to interact among them. So, if your peer is not defined in the channel configuration, the acces for it will be restricted.