# A Hyperledger Fabric-Based System Framework for Healthcare Data Management
## 2 Literature Review
### Blockchain
#### 2.2.3 Hyperledger Fabric  
Another significant development of commercial blockchain technology is Hyperledger Fabric. The Hyperledger project is an open-source and collaborative project which is sponsored by the Linux Foundation that is aimed at improving cross-industry blockchain technology and creating an enterprise-level distributed ledger architecture and codebase. Fabric is one of the projects in the Hyperledger project. Based on a modular architecture, Hyperledger Fabric supports a series of pluggable components such as consensus and membership services [7]. As an underlying platform for blockchain application development, Hyperledger Fabric supports the implementation of permissioned blockchains with nodes that are committed to reaching consensus or verifying transactions being selected by the central authority. Additionally, Hyperledger Fabric is designed to meet enterprise-level requirements, such as performance, verified identities, and private and confidential transactions. There are many new concepts and functions in Hyperledger Fabric: (1) Peers that represent the node in the organization, responsible for sorting, maintaining consensus mechanism, endorsing, committing, etc. (2) Chaincode that is equivalent to smart contract. (3) Endorsement policy that allows chaincode to select which peer nodes for participating in the voting part of consensus mechanism. (4) Channel that is the private sub-network in the Fabric to isolate different applications and allow a group of organizations to create a separate transaction ledger. (5) Organization that represents entities such as enterprises and institutions in the Fabric network. (6) The ledger that includes the blockchain and the world state- a series of ordered transactions will be packaged into blockchain, while the world state is continuously updated to record changes of data. (7) Membership Service Provider (MSP) that is responsible for managing certificates and membership, every organization that manages a collaborative enterprise can have its own MSP, there is a global MSP on the channel and each role including peer, orderer, and client maintains a local MSP. With the endorsement policy, the operation of the consensus mechanism is not required to issue tokens and mining. Instead, the consensus is achieved through voting with a specific consensus algorithm that depends on the project. Another new feature of Hyperledger Fabric is that it is private and permissioned. Compared with the open permission system that allows all participants to join the network, the members of the Hyperledger Fabric network ensure privacy by registering with a trusted MSP provider. Fabric has supported three consensus mechanisms since its release: Solo, Kafka, and Raft. Since Fabric 1.4.1, Hyperledger Fabric officially recommends the Raft consensus mechanism [24]. For the Raft algorithm, each node can only be in one of three states:  
* Follower--initially all nodes are in this state. The log of the follower can be rewritten by the leader. * Candidate--the node in the candidate state will initiate an election. If it receives the approval of the majority members, it will transfer to the leader state. Otherwise, if the candidate finds that the leader has been selected, it will return to the follower state. * Leader--the node has the right to process client requests and ensure that all followers have the same log copy. In the Raft algorithm, the concept of term is used to identify the management period of the leader. At the beginning of each term there is an election process, in which one or more candidates are competing to become a leader. The node who wins the election will be the leader for the remaining time in the term and begin to process client requests. The request contains the commands to be executed by the replication state machine. The leader appends the command to its log (this command is still \"uncommitted\") and broadcast to all of the followers to copy the new log.