Hyperledger Fabric Introduction and Latest MCQ

Hyperledger Fabric Introduction

Hyperledger Fabric is an open source enterprise-grade permissioned distributed ledger technology (DLT) platform, designed for use in enterprise contexts, that delivers some key differentiating capabilities over other popular distributed ledger or blockchain platforms.

One key point of differentiation is that Hyperledger was established under the Linux Foundation, which itself has a long and very successful history of nurturing open source projects under open governance that grow strong sustaining communities and thriving ecosystems. Hyperledger is governed by a diverse technical steering committee, and the Hyperledger Fabric project by a diverse set of maintainers from multiple organizations. It has a development community that has grown to over 35 organizations and nearly 200 developers since its earliest commits.

Fabric has a highly modular and configurable architecture, enabling innovation, versatility and optimization for a broad range of industry use cases including banking, finance, insurance, healthcare, human resources, supply chain and even digital music delivery.

Fabric is the first distributed ledger platform to support smart contracts authored in general-purpose programming languages such as Java, Go and Node.js, rather than constrained domain-specific languages (DSL). This means that most enterprises already have the skill set needed to develop smart contracts, and no additional training to learn a new language or DSL is needed.

The Fabric platform is also permissioned, meaning that, unlike with a public permissionless network, the participants are known to each other, rather than anonymous and therefore fully untrusted. This means that while the participants may not fully trust one another (they may, for example, be competitors in the same industry), a network can be operated under a governance model that is built off of what trust does exist between participants, such as a legal agreement or framework for handling disputes.

One of the most important of the platform’s differentiators is its support for pluggable consensus protocols that enable the platform to be more effectively customized to fit particular use cases and trust models. For instance, when deployed within a single enterprise, or operated by a trusted authority, fully byzantine fault tolerant consensus might be considered unnecessary and an excessive drag on performance and throughput. In situations such as that, a crash fault-tolerant (CFT) consensus protocol might be more than adequate whereas, in a multi-party, decentralized use case, a more traditional byzantine fault tolerant (BFT) consensus protocol might be required.

Fabric can leverage consensus protocols that do not require a native cryptocurrency to incent costly mining or to fuel smart contract execution. Avoidance of a cryptocurrency reduces some significant risk/attack vectors, and absence of cryptographic mining operations means that the platform can be deployed with roughly the same operational cost as any other distributed system.

The combination of these differentiating design features makes Fabric one of the better performing platforms available today both in terms of transaction processing and transaction confirmation latency, and it enables privacy and confidentiality of transactions and the smart contracts (what Fabric calls “chaincode”) that implement them.

Modularity

Hyperledger Fabric has been specifically architected to have a modular architecture. Whether it is pluggable consensus, pluggable identity management protocols such as LDAP or OpenID Connect, key management protocols or cryptographic libraries, the platform has been designed at its core to be configured to meet the diversity of enterprise use case requirements.

At a high level, Fabric is comprised of the following modular components:

  • A pluggable ordering service establishes consensus on the order of transactions and then broadcasts blocks to peers.
  • A pluggable membership service provider is responsible for associating entities in the network with cryptographic identities.
  • An optional peer-to-peer gossip service disseminates the blocks output by ordering service to other peers.
  • Smart contracts (“chaincode”) run within a container environment (e.g. Docker) for isolation. They can be written in standard programming languages but do not have direct access to the ledger state.
  • The ledger can be configured to support a variety of DBMSs.
  • A pluggable endorsement and validation policy enforcement that can be independently configured per application.

There is fair agreement in the industry that there is no “one blockchain to rule them all”. Hyperledger Fabric can be configured in multiple ways to satisfy the diverse solution requirements for multiple industry use cases.

Permissioned vs Permissionless Blockchains

In a permissionless blockchain, virtually anyone can participate, and every participant is anonymous. In such a context, there can be no trust other than that the state of the blockchain, prior to a certain depth, is immutable. In order to mitigate this absence of trust, permissionless blockchains typically employ a “mined” native cryptocurrency or transaction fees to provide economic incentive to offset the extraordinary costs of participating in a form of byzantine fault tolerant consensus based on “proof of work” (PoW).

Permissioned blockchains, on the other hand, operate a blockchain amongst a set of known, identified and often vetted participants operating under a governance model that yields a certain degree of trust. A permissioned blockchain provides a way to secure the interactions among a group of entities that have a common goal but which may not fully trust each other. By relying on the identities of the participants, a permissioned blockchain can use more traditional crash fault tolerant (CFT) or byzantine fault tolerant (BFT) consensus protocols that do not require costly mining.

Additionally, in such a permissioned context, the risk of a participant intentionally introducing malicious code through a smart contract is diminished. First, the participants are known to one another and all actions, whether submitting application transactions, modifying the configuration of the network or deploying a smart contract are recorded on the blockchain following an endorsement policy that was established for the network and relevant transaction type. Rather than being completely anonymous, the guilty party can be easily identified and the incident handled in accordance with the terms of the governance model.

Smart Contracts

A smart contract, or what Fabric calls “chaincode”, functions as a trusted distributed application that gains its security/trust from the blockchain and the underlying consensus among the peers. It is the business logic of a blockchain application.

There are three key points that apply to smart contracts, especially when applied to a platform:

  • many smart contracts run concurrently in the network,
  • they may be deployed dynamically (in many cases by anyone), and
  • application code should be treated as untrusted, potentially even malicious.

Most existing smart-contract capable blockchain platforms follow an order-execute architecture in which the consensus protocol:

  • validates and orders transactions then propagates them to all peer nodes,
  • each peer then executes the transactions sequentially.

The order-execute architecture can be found in virtually all existing blockchain systems, ranging from public/permissionless platforms such as Ethereum (with PoW-based consensus) to permissioned platforms such as TendermintChain, and Quorum.

Smart contracts executing in a blockchain that operates with the order-execute architecture must be deterministic; otherwise, consensus might never be reached. To address the non-determinism issue, many platforms require that the smart contracts be written in a non-standard, or domain-specific language (such as Solidity) so that non-deterministic operations can be eliminated. This hinders wide-spread adoption because it requires developers writing smart contracts to learn a new language and may lead to programming errors.

Further, since all transactions are executed sequentially by all nodes, performance and scale is limited. The fact that the smart contract code executes on every node in the system demands that complex measures be taken to protect the overall system from potentially malicious contracts in order to ensure resiliency of the overall system.

A New Approach

Fabric introduces a new architecture for transactions that we call execute-order-validate. It addresses the resiliency, flexibility, scalability, performance and confidentiality challenges faced by the order-execute model by separating the transaction flow into three steps:

  • execute a transaction and check its correctness, thereby endorsing it,
  • order transactions via a (pluggable) consensus protocol, and
  • validate transactions against an application-specific endorsement policy before committing them to the ledger

This design departs radically from the order-execute paradigm in that Fabric executes transactions before reaching final agreement on their order.

In Fabric, an application-specific endorsement policy specifies which peer nodes, or how many of them, need to vouch for the correct execution of a given smart contract. Thus, each transaction need only be executed (endorsed) by the subset of the peer nodes necessary to satisfy the transaction’s endorsement policy. This allows for parallel execution increasing overall performance and scale of the system. This first phase also eliminates any non-determinism, as inconsistent results can be filtered out before ordering.

Because we have eliminated non-determinism, Fabric is the first blockchain technology that enables use of standard programming languages.

Privacy and Confidentiality

As we have discussed, in a public, permissionless blockchain network that leverages PoW for its consensus model, transactions are executed on every node. This means that neither can there be confidentiality of the contracts themselves, nor of the transaction data that they process. Every transaction, and the code that implements it, is visible to every node in the network. In this case, we have traded confidentiality of contract and data for byzantine fault tolerant consensus delivered by PoW.

This lack of confidentiality can be problematic for many business/enterprise use cases. For example, in a network of supply-chain partners, some consumers might be given preferred rates as a means of either solidifying a relationship, or promoting additional sales. If every participant can see every contract and transaction, it becomes impossible to maintain such business relationships in a completely transparent network — everyone will want the preferred rates!

As a second example, consider the securities industry, where a trader building a position (or disposing of one) would not want her competitors to know of this, or else they will seek to get in on the game, weakening the trader’s gambit.

In order to address the lack of privacy and confidentiality for purposes of delivering on enterprise use case requirements, blockchain platforms have adopted a variety of approaches. All have their trade-offs.

Encrypting data is one approach to providing confidentiality; however, in a permissionless network leveraging PoW for its consensus, the encrypted data is sitting on every node. Given enough time and computational resource, the encryption could be broken. For many enterprise use cases, the risk that their information could become compromised is unacceptable.

Zero knowledge proofs (ZKP) are another area of research being explored to address this problem, the trade-off here being that, presently, computing a ZKP requires considerable time and computational resources. Hence, the trade-off in this case is performance for confidentiality.

In a permissioned context that can leverage alternate forms of consensus, one might explore approaches that restrict the distribution of confidential information exclusively to authorized nodes.

Hyperledger Fabric, being a permissioned platform, enables confidentiality through its channel architecture and private data feature. In channels, participants on a Fabric network establish a sub-network where every member has visibility to a particular set of transactions. Thus, only those nodes that participate in a channel have access to the smart contract (chaincode) and data transacted, preserving the privacy and confidentiality of both. Private data allows collections between members on a channel, allowing much of the same protection as channels without the maintenance overhead of creating and maintaining a separate channel.

Pluggable Consensus

The ordering of transactions is delegated to a modular component for consensus that is logically decoupled from the peers that execute transactions and maintain the ledger. Specifically, the ordering service. Since consensus is modular, its implementation can be tailored to the trust assumption of a particular deployment or solution. This modular architecture allows the platform to rely on well-established toolkits for CFT (crash fault-tolerant) or BFT (byzantine fault-tolerant) ordering.

Fabric currently offers a CFT ordering service implementation based on the etcd library of the Raft protocol. For information about currently available ordering services, check out our conceptual documentation about ordering.

Note also that these are not mutually exclusive. A Fabric network can have multiple ordering services supporting different applications or application requirements.

Performance and Scalability

Performance of a blockchain platform can be affected by many variables such as transaction size, block size, network size, as well as limits of the hardware, etc. The Hyperledger Fabric Performance and Scale working group currently works on a benchmarking framework called Hyperledger Caliper.

Hyperledger Fabric MCQs Solution

1. Which of the following is not a Hyperledger framework?

Hyperledger Excel

2. The Hyperledger project is hosted and maintained by _______?

Linux 

3. FoundationWhich Hyperledger framework is used for decentralized identity management?

Hyperledger Indy

4. Which of these is not a part of the Hyperledger umbrella?

Corda

5. Distributed Ledger is a type of data structure.

TRUE

6. _______ is a Hyperledger tool that provides interoperability between ledger systems.

Quilt

7. The ________ tool provides a shared, reusable, interoperable toolkit for solutions focused on creating, transmitting, and storing verifiable digital credentials.

Aries

8. In Hyperledger Fabric, Smart contracts are termed as ______.

Chain codes

9. The _______ Hyperledger tool brings the on-demand “as-a-service” deployment model to the blockchain ecosystem, to reduce the effort required for creating, managing, and terminating blockchains.

Cello

10. Benchmarking tool Hyperledger CaliperHyperledger Fabric supports smart contracts written in Solidity.

TRUE

11. ________ nodes are responsible for creating chain codes.

CreatingX

12. What are the two main components of a blockchain network that developers are most interested in?

13.  To list files and directories at command line under a Linux/Ubuntu operating system

A. dir

B. ls

C. cmd

D. file manager

Answer: B

14. To change file permission to be executable for all under a Linux/Ubuntu operating system

A. chmod user+x

B. chmod rwx

C. chmod a+x

D. chmod 700

Answer: C

15. To find out all the docker images that have been installed on your current Linux/Ubuntu operating system

A. docker list

B. docker images

C. docker ps

D. docker exec

Answer: B

16. For the famous “byfn” (Build Your First Network) sample application, if you encounter an unexpected error you’ll try to trouble shoot like the following:

A. docker network prune; docker volume prune

B. docker rm -f $(docker ps -qa)

C. A and B

D. docker delete

Answer: C

17. What is YAML file within the Hyperledger Fabric and Docker context?

A. an optional descriptive text file about a particular peer

B. a configuration file that determines how the Fabric network and Docker should perform a specific task

C. a text file that specifies endorsement policy for transactions

D. an optional descriptive text file about a particular chaincode

Answer: B

18. When creating a network according to an organization’s structure and also bootstrap a channel what are the following artifacts we would need to generate?

A. Genesis Block, ledger Configuration and Anchor Peer Configs for each organization.

B. Genesis Block, Channel Configuration and Anchor Peer Configs for each organization.

C. Genesis Block, Channel Configuration and Anchor MSP Configs for each organization.

D. Genesis Block, License File and Anchor Peer Configs for each organization.

Answer: B

19. Hyperledger Fabric Ledger has two parts. What are they?

A. State data and Snapshots

B. State Data and Transaction Logs

C. Stateless Data and Snapshots

D. Stateful Data and Membership Logs

E. State Data and Membership Logs

Answer: B

20. Level DB is the default database for Hyperledger Fabric and is particularly appropriate when ledger states comprise what type of data?

A. Complex key-value pairs

B. Simple key-value pairs

C. JSON data pairs

D. Rich Queries

Answer: B

21. Blockchain services consist of three major components. What are they? (Select three.)

A. Consensus Manager

B. Peer to Peer Protocol

C. Reputation Manager

D. Membership Services

E. Distributed Ledger

Answer: A,B,E

22. The ledger system in Hyperledger Fabric uses what database by default?

A. MS SQL

B. CouchDB

C. LevelDB

D. MySQL

E. PostGres SQL

Answer: C

23. User chaincode has four life cycle of

A. “Install”, “Initiate”, “Invoke” and “Query”.

B. “Install”, “Instantiate”, “Invoke” and “Query”.

C. “Install”, “Update”, “Invoke” and “Query”.

D. “Install”, “Verify”, “Invoke” and “Query”.

Answer: B

24. Chaincode may be written in any of which three languages?

A. Node (Node.JS), Golang (Go) and Java

B. C, C++ and Pascal

C. Basic, .NET and C

D. Java, PHP and C++

Answer: A

25. What are the three different types of Nodes?

A. MSP Node, Docker Node and Admin Node

B. Peer Node, Orderer Node and Client Node

C. Anchor Peer Node, Lead Peer Node and Admin Node

D. None of the above

Answer: B

26. What is Channel?

A. A channel in Hyperledger Fabric is the subnet of the main blockchain. You can have any number of Channels in a Blockchain.

B. A channel is a different name for consensus protocol

C. A channel is the mechanism for Membership Service Provider

D. A channel determines how endorsement policy works

Answer: A

27. Can a Peer or Node be a part of many channels?

A. Yes

B. No

Answer: A

28. What is Identity management?

A. An optional service for Hyperledger Fabric participants

B. A user account that can be used for any channel

C. A built-in service that handles Security, Members, Roles, and digital signatures of user accounts

D. Each chaincode has its own unique identity for access control

Answer: C

29. What is Certificate Authority?

A. A mechanism for fulfilling endorsement policy

B. Fabric CA takes care of registration, issuance of e-certificates, role assignment, renewals and revocation to the various nodes before they can start communicating in the network

C. A consensus protocol and nothing more

D. A special mechanism for orderer

Answer: B

30. Which of the following best describes Chaincode in Hyperledger Fabric?

1.    Is a key/value state database

2.    Maintains the state of the network and a copy of the ledger

3.    Accepts endorsed transactions, orders them into a block, and delivers the blocks to the committing peers

4.    Is the smart contract that runs on the peers and creates transactions

Answer: D

31. How will transactions be processed if not all the nodes are online all the time (e.g.the ship is in the sea and does not have connectivity)?

A. Not solvable

B. Make the endorsement policies flexible, for instance, not requiring all the nodes be endorsers

C. Select random nodes as endorsers

Answer: B

-20

32. curl -s -X POST http://{hostname}:{port}/chaincodes

-H ‘authorization: Bearer mytoken’

-H ‘content-type: application/json’

-d ‘{“”peers””: [“”peer0.org1.example.com””,””peer1.org1.example.com””],””chaincodeName””:””house””,””chaincodePath””:””/home/userid/fabric-samples/chaincode/houseproj/node””,””chaincodeType””: “”node””,””chaincodeVersion””:””v0″”}’

A. The above code installs chaincode named “house” onto peers named “peer0.org1.example.com” and “peer1.org1.example.com”

B. The above code instantiates chaincode named “house” onto a peer named “peer0.org1.example.com”

C. The above code queries the ledger with chaincode named “house”

D. The above code verifies if the channel has a chaincode named “house”

Answer: A

33. is used to run multiple containers that will create peers for the network.

Docker

34. Which command is used to bring down the Hyperledger Fabric network?

byfn.sh down

35. Hyperledger Fabric supports which of the following?

Both Consensus and Identity

36. What type of files are used in Hyperledger Fabric to specify the configurations of channels, certificates, and other assets?

YAML

37. Which of the following is not a Hyperledger framework?

Hyperledger Excel

38. The Hyperledger project is hosted and maintained by _______?

Linux Foundation

39. Which Hyperledger framework is used for decentralized identity management?

Hyperledger Indy

40. Which of these is not a part of the Hyperledger umbrella?

Corda

41. Distributed Ledger is a type of data structure. 

TRUE

42. _______ is a Hyperledger tool that provides interoperability between ledger systems.

Quilt

43. The ________ tool provides a shared, reusable, interoperable toolkit for solutions focused on creating, transmitting, and storing verifiable digital credentials.

Aries

43. In Hyperledger Fabric, Smart contracts are termed as ______.

Chain codes

44. The _______ Hyperledger tool brings the on-demand “as-a-service” deployment model to the blockchain ecosystem, to reduce the effort required for creating, managing, and terminating blockchains.

Cello

45. Benchmarking tool Hyperledger CaliperHyperledger Fabric supports smart contracts written in Solidity.

TRUE

46. ________ nodes are responsible for creating chain codes.

CreatingX

47. The only way to access blockchain APIs is to use a software developer kit (SDK).

TRUE

48. Hyperledger Fabric is a ________ type of blockchain framework. 

public, permissioned 

49. Which of these is not a part of the Hyperledger umbrella? 

Corda

50. The ________ tool provides a shared, reusable, interoperable toolkit for solutions focused on creating, transmitting, and storing verifiable digital credentials.  

Aries

51. The native currency of an Ethereum network is? 

Ether

52. _______ is a Hyperledger tool that provides interoperability between ledger systems. Quilt

53. The Hyperledger project is hosted and maintained by _______? 

Linux Foundation 

54. Which of the following is not a Hyperledger framework? 

Hyperledger Excel 

55. Which Hyperledger project is a benchmarking tool? 

Hyperledger Caliper 

56. Distributed Ledger is a type of data structure.  

True

57. New blocks are appended to a blockchain by linking to the previous block’s ___  Hash

58. In Hyperledger Fabric, _______ represents the current state of a ledger. 

World state 

59. _______ peers are responsible for adding a block to the blockchain network. 

Committing 

60. _______ transactions deploy new chain code to the Hyperledger Fabric blockcha – 

Deployed 

61. ________ nodes run the chain codes 

Ordering 

62. Chain codes are classified into two types, _______ and _______. 

Developed, System

63. ________ allows participants of a channel to share private and confidential data without creating a new channel. 

Private data

64. _______ are key-value pairs that represent both tangible and intangible things like storage devices and chain codes. 

Assets

65. What is a subnet of communication between members of a blockchain network? 

Channel

66. _______ transactions deploy new chain code to the Hyperledger Fabric blockchain.

Deployed

67. In Hyperledger Fabric, _______ represents the current state of a ledger. 

World state

68. Hyperledger Fabric supports smart contracts written in Solidity. 

True

69. ________ nodes are responsible for creating chain codes. 

Computing

70. The Hyperledger Fabric framework was initially developed by which company –

IBM

71. Which tool is used to create configuration transactions? 

Configtxgen

72. A participant can belong to more than one Hyperledger Fabric blockchain network.

False

73. Which tool is used to create configuration transactions? 

Configtxgen

74. A participant can belong to more than one Hyperledger Fabric blockchain network. 

False

75. Which script in the first-network directory is used to automatically create a network?

 byfn.sh

76. What is the default programming language used by Hyperledger Fabric?

Go

77. Hyperledger Fabric supports which of the following? 

Identity management

78. External applications can update a ledger only through __

Peers

79. A Peer or Node can be a part of many channels.

True

80. Which command is used to bring down the Hyperledger Fabric network? 

byfn.sh down

81. ________ is used to run multiple containers that will create peers for the network. 

Docker-compose

82. What are the four stages of a chain code life cycle? “Install”, “Instantiate”, “Invoke”, and “Query”.

83. Which tool is used to view, invoke, deploy, or query a block in a ledger? 

Explorer

84. How many Ordering services does the first default network created consist of? 

One

85. Which of the following is a blockchain solution provided by TCS? 

Quartz

86. When running a query from a blockchain application, the ledger’s Smart Contract need not be invoked.

False

87. The ledger system in Hyperledger Fabric uses what database by default? 

Level DB

Click here to read more article of us

About Author


After years of Technical Work, I feel like an expert when it comes to Develop wordpress website. Check out How to Create a Wordpress Website in 5 Mins, and Earn Money Online Follow me on Facebook for all the latest updates.

Leave a Comment