Linux Foundation HFCP Practice Questions with Explanations
Free Linux Foundation HFCP practice questions. 23 of them, each with the correct answer, a full explanation, and the reason every other option is wrong.
HFCP practice questions
Question 1
An enterprise blockchain is a permission blockchain node distributed to whom?
- A. Administration data center
- B. Nodes distributed with a validator
- C. Member organizations
- D. Nodes distributed on a public Blockchain
Show answer and explanation ▾
Correct answer: C
In a permissioned enterprise blockchain such as Fabric, the nodes are run by the known member organizations of the network, not by anonymous public participants.
Why the other options are wrong:
- A. Nodes are not centralised in one administration data center, which would defeat the shared ledger.
- B. A validator is a role, not the group the nodes are distributed to.
- D. Public blockchain nodes are open to anyone, which is the opposite of permissioned.
Question 2
An endorsement policy lists what?
- A. The number of organizations involved in a transaction.
- B. The number of peers needed to endorse a transaction.
- C. The order in which transactions are executed.
- D. The identities required for endorsing a transaction.
Show answer and explanation ▾
Correct answer: D
An endorsement policy specifies which identities, usually peers of named organizations, must sign a transaction proposal response before the transaction is considered valid, for example a peer from Org1 and a peer from Org2.
Why the other options are wrong:
- A. The policy names which organizations must endorse, not a count of the organizations involved in a transaction.
- B. The policy is expressed in terms of required identities and organizations, not only a number of peers.
- C. Transaction order is decided by the ordering service, not by an endorsement policy.
Question 3
A smart contract can call other smart contracts both within the same channel and across different channels.
Which of the following transactions is inter-contract communication whose functionality is limited?
- A. Chaincode X calls Getstate in Chaincode Y on the same channel.
- B. Chaincode X calls Putstate in Chaincode Y on the same channel.
- C. Chaincode X calls Getstate in Chaincode Y on a different channel.
- D. Chaincode X calls Putstate in Chaincode Y on a different channel.
Show answer and explanation ▾
Correct answer: D
A chaincode can read from another channel, but a call to a chaincode on a different channel cannot write to that channel's ledger, so a cross-channel Putstate is the limited case.
Why the other options are wrong:
- A. Calls within the same channel are fully supported, including reads.
- B. Calls within the same channel are fully supported, including writes.
- C. Reading state from a chaincode on another channel is allowed. Only writes are limited.
Question 4
When building a test network, how many nodes are adequate for an Ordering Service?
- A. There is no set number of nodes required for an Ordering Service.
- B. Three ordering nodes are needed for a test Ordering Service.
- C. One ordering nodes is sufficient for an Ordering Service.
- D. Ordering Service nodes are optional in a test network.
Show answer and explanation ▾
Correct answer: C
A test network needs an ordering service to sequence transactions, and a single ordering node is enough there. Larger sets are used in production for fault tolerance.
Why the other options are wrong:
- A. An ordering service always needs at least one node, so the number is not unset.
- B. Three or more nodes matter for fault tolerance in production, but a test network does not need them.
- D. The ordering service is required, because transactions cannot be ordered and committed without it.
Question 5
Regarding peer lifecycle chaincode, which of the following is the incorrect (unsupported) subcommand for query?
- A. peer lifecycle chaincode querypackaged
- B. peer lifecycle chaincode querycommitted
- C. peer lifecycle chaincode queryapproved
- D. peer lifecycle chaincode queryinstalled
Show answer and explanation ▾
Correct answer: A
The peer lifecycle chaincode command supports queryinstalled, queryapproved and querycommitted. There is no querypackaged subcommand.
Why the other options are wrong:
- B. querycommitted is a supported subcommand that shows committed definitions on a channel.
- C. queryapproved is a supported subcommand that shows what an organization has approved.
- D. queryinstalled is a supported subcommand that lists chaincode installed on a peer.
Question 6
When deploying an Orderer environment, variables must be customized or overridden in which artifact?
- A. crypto-config.yaml
- B. docker-compose.yaml
- C. configtx.yaml
- D. orderer.yaml
Show answer and explanation ▾
Correct answer: D
An ordering node takes its local configuration from orderer.yaml, including its listen address, TLS settings and local MSP. These values are edited in the file or overridden with environment variables when the orderer is deployed.
Why the other options are wrong:
- A. crypto-config.yaml is the input to cryptogen for generating certificates and does not configure a running orderer.
- B. docker-compose.yaml defines containers and is not the orderer's own configuration artifact.
- C. configtx.yaml defines channel configuration and policies, not the node-level settings of an orderer.
Question 7
Which subcommand adds a peer to a channel in Hyperledger Fabric?
- A. peer channel fetch
- B. peer channel create
- C. peer channel update
- D. peer channel join
Show answer and explanation ▾
Correct answer: D
The peer channel join command takes a channel's genesis block and joins the peer to that channel, after which the peer starts receiving and committing the channel's blocks.
Why the other options are wrong:
- A. peer channel fetch retrieves a block from the channel and does not join the peer.
- B. peer channel create creates a channel and does not add a peer to it.
- C. peer channel update submits a channel configuration update and does not join a peer.
Question 8
After the transaction that contains the delState("A") function is committed, what happens to the ledger and state database?
- A. getstate("A") function returns the current state of the key "A".
- B. The deleting transaction sets an empty value to the key "A" in the write set.
- C. The state of the key "A" is removed from the state database, but its history remains in the ledger.
- D. All transaction histories which updated the state "A" are deleted from the ledger.
Show answer and explanation ▾
Correct answer: C
Deleting a state removes the entry for the affected item from the world state once the transaction commits. The blockchain is immutable, so every earlier transaction that wrote to that item, and the delete itself, stays recorded in the ledger.
Why the other options are wrong:
- A. After the delete is committed, reading "A" returns no value because the state no longer exists.
- B. The write set marks "A" as deleted, which is different from writing an empty value to it.
- D. Transactions already in the blockchain cannot be deleted.
Question 9
How would a developer iteratively test and develop a smart contract without the overhead of the smart contract lifecycle process for every update?
- A. Running chaincode for Smart Contracts in development mode.
- B. Manually update the Smart Contract code on the network.
- C. Deploy the Smart Contract on the network for every update.
- D. Use a Production Network to test and develop Smart Contracts.
Show answer and explanation ▾
Correct answer: A
In development mode the peer is started so that the developer runs the chaincode process directly and connects it to the peer. Code can then be changed, rebuilt and restarted without repeating the package, install, approve and commit steps each time.
Why the other options are wrong:
- B. Manually changing code on the network is not a supported way to update chaincode.
- C. Deploying for every update is exactly the lifecycle overhead the developer wants to avoid.
- D. A production network is never the place to test and develop smart contracts.
Question 10
Which of the following information do signature policies provide when creating a network in Hyperledger Fabric?
- A. Identify specific users who must sign in order to satisfy a policy.
- B. Number of nodes in the network.
- C. Private keys of all network participants.
- D. Type of consensus algorithm used
Show answer and explanation ▾
Correct answer: A
A Signature policy names the specific identities, by MSP and role, whose signatures are needed to satisfy it, combined with AND, OR and NOutOf rules. This is more explicit than an ImplicitMeta policy, which aggregates the results of other policies.
Why the other options are wrong:
- B. The number of nodes in the network is not something a signature policy describes.
- C. Private keys are kept secret by their owners and are never shared or listed in a policy.
- D. The consensus type is set in the orderer section of the channel configuration, not in a signature policy.
Question 11
What is true about the historic states in Hyperledger Fabric model?
- A. They can be modified by anyone with write access.
- B. Administrator role is required for access.
- C. They are immutable.
- D. They cannot be accessed by anyone.
Show answer and explanation ▾
Correct answer: C
Historic states are derived from the transactions recorded in the blockchain. Blocks are linked by hashes and cannot be altered once committed, so the history of a state is immutable.
Why the other options are wrong:
- A. No one can modify committed history, whatever write access they hold.
- B. Reading history does not require an administrator role.
- D. History can be read, for example through chaincode history queries, by those with access to the channel.
Question 12
In Hyperledger Fabric, Intercommunication is how a smart contract in a channel updates the World State database. It is achieved by what process?
- A. Setting the endorsement policy to communicate with all peers.
- B. Configuring the Peer-to-peer endorsement options.
- C. Calling smart contracts within the channel and in different channels.
- D. Making use of the cross channel Consensus mechanism.
Show answer and explanation ▾
Correct answer: C
Smart contracts communicate by calling other smart contracts, both in the same channel and in other channels. A call within the same channel can read and update world state, while a call into a different channel can only read.
Why the other options are wrong:
- A. An endorsement policy decides who must sign a transaction and is not a way for contracts to communicate.
- B. Endorsement options on peers are not the mechanism by which contracts call each other.
- D. Fabric has no cross channel consensus mechanism, since each channel has its own ledger and ordering.
Question 13
What types of events committed to the ledger can client applications receive using the peer's event service?
- A. Only block events
- B. Both chaincode and block events
- C. Neither chaincode nor block events
- D. Only chaincode events
Show answer and explanation ▾
Correct answer: B
Client applications can listen through the peer's event service for block events, which are raised as blocks are committed, and for chaincode events, which are emitted by smart contracts within committed transactions.
Why the other options are wrong:
- A. Chaincode events are also available, not only block events.
- C. The event service delivers both kinds of event to client applications.
- D. Block events are also available, not only chaincode events.
Question 14
Which of the following is the correct role of orderer nodes?
- A. Order and package endorsed transactions into a block.
- B. Order new tokens from the token issuer.
- C. Order peers to endorse a transaction.
- D. Reorder stored blocks to compress data volume.
Show answer and explanation ▾
Correct answer: A
Orderer nodes receive endorsed transactions from client applications, agree on their order, package them into blocks and deliver the blocks to peers for validation and commitment.
Why the other options are wrong:
- B. Ordering nodes have nothing to do with ordering tokens from an issuer.
- C. Orderers do not instruct peers to endorse; endorsement happens before ordering.
- D. Committed blocks are never reordered or compressed by orderers.
Question 15
What gRPC status code might you expect to be associated with an error invoking a transaction as a result of a transient failure, such as a network disconnection between the client application and Gateway peer?
- A. UNAVAILABLE
- B. ABORTED
- C. DEADLINE_EXCEEDED
- D. FAILED PRECONDITION
Show answer and explanation ▾
Correct answer: A
UNAVAILABLE is the gRPC status code for a service that cannot currently be reached, such as when the connection between the client application and the Gateway peer drops. It indicates a transient condition, so the call can be retried.
Why the other options are wrong:
- B. ABORTED indicates that an operation was aborted, typically because of a concurrency conflict, not a lost connection.
- C. DEADLINE_EXCEEDED indicates that the call timed out before completing, not that the service could not be reached.
- D. FAILED_PRECONDITION indicates the system is not in a state required for the operation, not a transient connection failure.
Question 16
In a production environment, what peer items require on-going monitoring?
- A. Only the orderer service since it manages the ordering of transactions.
- B. Only the chaincode containers since they handle the business logic.
- C. All peer containers, including their CPU, network, and memory.
- D. Only the peer nodes that are running chaincode, since they consume most resources.
Show answer and explanation ▾
Correct answer: C
A peer deployment includes the peer itself plus its supporting containers, such as chaincode and the state database. All of them need ongoing monitoring of CPU, memory and network use so that problems are caught before they affect the network.
Why the other options are wrong:
- A. The ordering service is not a peer item, and monitoring it alone leaves the peers unobserved.
- B. Chaincode containers are only one part of what a peer runs.
- D. Peers that do not run chaincode still validate and commit blocks and need monitoring as well.
Question 17
What do we call the ordering nodes actively participating in the consensus mechanism for a given channel and receiving replicated logs for the channel?
- A. Committer set
- B. Consenter set
- C. Peers
- D. Endorsers
Show answer and explanation ▾
Correct answer: B
The consenter set is the group of ordering nodes that actively take part in consensus for a given channel and receive the replicated logs for that channel.
Why the other options are wrong:
- A. Committer set is not the term for ordering nodes that take part in consensus.
- C. Peers host ledgers and chaincode and do not take part in ordering consensus.
- D. Endorsers are peers that simulate and sign transaction proposals, not ordering nodes.
Question 18
Which of the following is the identity solution in Hyperledger Fabric?
- A. Hyperledger Fabric Orderer
- B. Hyperledger Fabric CA
- C. Hyperledger Fabric SDK
- D. Membership Service Providers
Show answer and explanation ▾
Correct answer: D
Fabric handles identity through Membership Service Providers. An MSP defines which certificate authorities an organization trusts and turns verified identities into members and roles on the network.
Why the other options are wrong:
- A. The orderer sequences transactions into blocks and is not an identity solution.
- B. Fabric CA is an optional tool that issues certificates, while it is the MSP that makes identities recognized and trusted on the network.
- C. The SDK is a client library for building applications and is not an identity solution.
Question 19
What is necessary for a chaincode to become ready to commit on a channel?
- A. The chaincode must be previously installed on the channel’s peers.
- B. The policy Channel/Application/Writers must be satisfied.
- C. The policy /Channel/Application/LifecycleEndorsement must be satisfied.
- D. The chaincode must have the endorsement policies correctly defined.
Show answer and explanation ▾
Correct answer: C
A chaincode definition can be committed to a channel only when enough organizations have approved it to satisfy the /Channel/Application/LifecycleEndorsement policy, which by default requires a majority of the channel's organizations.
Why the other options are wrong:
- A. Commit readiness depends on organization approvals, and chaincode is installed on peers, not on a channel.
- B. The Writers policy governs who can submit transactions, not approval of a chaincode definition.
- D. A correctly defined endorsement policy does not make a definition ready to commit without the required approvals.
Question 20
How can the client application access descriptive error text for each of the endorsing peers following a transaction endorsement failure?
- A. Extract relevant entries from the endorsing peer logs.
- B. Examine the message of the associated cause or wrapped error.
- C. Look up the gRPC status code for the error.
- D. Extract the details associated with the returned error.
Show answer and explanation ▾
Correct answer: D
When endorsement fails, the error returned to the client application carries a list of details, one for each endorsing peer that failed, with the peer's address, its MSP ID and the error message. Extracting those details gives the descriptive text.
Why the other options are wrong:
- A. Peer logs are not available to a client application at run time.
- B. The message of the cause or wrapped error gives a summary and does not list each endorsing peer's error.
- C. The gRPC status code classifies the failure and carries no descriptive text for each peer.
Question 21
How should private data collection be configured and deployed?
- A. Private data collection is configured and deployed with the help of a dedicated REST API that is available on the orderers.
- B. Private data collection configuration is setup at the core network structure configuration with the components.
- C. Private data collection is configured at the X5C9 certification generation process of the certificate authorities.
- D. Private data collection configuration is described in a separate json file and deployed at chaincode deployment.
Show answer and explanation ▾
Correct answer: D
Private data collections are defined in a JSON collection configuration file that lists each collection's name, member policy and dissemination settings. The file is supplied when the chaincode definition is approved and committed.
Why the other options are wrong:
- A. Orderers offer no REST API for configuring private data collections.
- B. Collections are defined for each chaincode, not in the core network configuration.
- C. Collections are not configured during certificate generation by certificate authorities.
Question 22
In Hyperledger Fabric, what is used if end users of the application want to keep their private key secret?
- A. Offline signing
- B. Online signing
- C. No signing is required
- D. Shared signing
Show answer and explanation ▾
Correct answer: A
With offline signing, the application prepares the message to be signed and the end user signs it outside the application, so the private key never leaves the user's control. The signed message is then sent on to the network.
Why the other options are wrong:
- B. Online signing means the application itself has access to the private key, so it is not kept secret from the application.
- C. Every transaction in Fabric must be signed by the submitting identity.
- D. Shared signing is not a Fabric mechanism, and sharing a private key would expose it.
Question 23
Which of the following statements describes Chaincode correctly?
- A. Chaincode is software for creating new blocks on the ledger.
- B. Chaincode is software defining assets and transaction instructions for modifying the assets on the ledger.
- C. Chaincode is a legally enforceable business contract between organizations.
- D. Chaincode is a code of conduct to manage a blockchain consortium.
Show answer and explanation ▾
Correct answer: B
Chaincode is software that defines one or more assets and the transaction instructions for modifying them. It holds the business logic that runs when a transaction is invoked against the ledger.
Why the other options are wrong:
- A. New blocks are created by the ordering service, not by chaincode.
- C. Chaincode is program code and is not a legally enforceable contract.
- D. Chaincode has nothing to do with a code of conduct for a consortium.
Get the complete HFCP bank
These 23 questions are roughly 38% of the bank. The full pack has 60 real exam questions, each with the same depth of explanation, plus a questions-only PDF for timed practice and free updates forever.
View the full Linux Foundation HFCP question bank →
About the HFCP exam
These 23 Linux Foundation HFCP questions are free here, and as the free sample PDF.