concept peer in category hyperledger

This is an excerpt from Manning's book Programming Hyperledger Fabric: Creating Permissioned Blockchains.
Let’s see how a Fabric blockchain can be used by a group of banks to facilitate monetary transactions. The first step is for the banks to come together to form a consortium. The banks will be known as peers or peer organizations of the consortium. Each bank will spin up one or more peer nodes (i.e., machines or computers) which will store their respective copy of the ledger (or blockchain if you will). Each bank will also have their users which are the bank’s customers. The peer nodes will be running application code to process requests coming in from users and generating transactions in response to those requests. Recall we use the term transaction to mean the record that gets written to the ledger. Fabric refers to the application code as chaincode although with version 1.4 it has given in and started to also refer to it as smart contract which is a term that has caught on and popularized by Ethereum originally. The chaincode will be developed jointly by all the banks and all peer nodes will run exact same copy of the chaincode. 15
func serve(args []string) error { // currently the peer only works with the standard MSP // because in certain scenarios the MSP has to make sure // that from a single credential you only have a single 'identity'. // Idemix does not support this *YET* but it can be easily // fixed to support it. For now, we just make sure that // the peer only comes up with the standard MSP mspType := mgmt.GetLocalMSP(factory.GetDefault()).GetType() if mspType != msp.FABRIC { panic("Unsupported msp type " + msp.ProviderTypeToString(mspType)) }
It is not unusual to run into errors while doing Fabric development. What sets apart the great from the good developer is the ability to debug and troubleshoot problems. In this chapter we will show how to debug the underlying Fabric code itself. Fabric is written in Go and Delve is Go’s debugger. Most of the chapter will be about learning Delve and how to use it to debug Go code. We will show how to do this using the command line as well as the VS Code IDE. Readers already familiar with Go and Delve might just want to know the commands to debug the orderer and peer and those are given in Listing 5.2 and Listing 5.8. Before beginning make sure you have downloaded the Fabric repo and have Go and Delve installed as explained in Section A.6 and Section A.5. All commands in this chapter are to be run from the
$/debugging-fabricdirectory unless noted otherwise. It should have following files in it:
If you compare it to Listing 5.2, you notice
node starttrailing the--. Anything after the last--are construed as program arguments that are passed bydlvto the program it is debugging. In case ofordererwe did not need any program arguments but thepeerbinary needs these arguments to spin up a peer node. You can again verify there is amain.gofile undergithub.com/hyperledger/fabric/cmd/peerthat has themainpackage which is the entry point todlvwhen it runs.