func (h *ProposalProcessorHandler) Handle(requestContext *chclient.RequestContext, clientContext *chclient.ClientContext) {
	if len(requestContext.Opts.ProposalProcessors) == 0 {
		peers, err := clientContext.Discovery.GetPeers()
		if err != nil {
			requestContext.Error = errors.WithMessage(err, "GetPeers failed")
			return
		}
		endorsers := peers
		if clientContext.Selection != nil {
			endorsers, err = clientContext.Selection.GetEndorsersForChaincode(peers, requestContext.Request.ChaincodeID)
			if err != nil {
				requestContext.Error = errors.WithMessage(err, "Failed to get endorsing peers")
				return
			}
		}
		requestContext.Opts.ProposalProcessors = peer.PeersToTxnProcessors(endorsers)
	}
	if h.next != nil {
		h.next.Handle(requestContext, clientContext)
	}
}
Handle selects proposal processors
package txnhandler
import (
	"time"
	"bytes"
	"github.com/hyperledger/fabric-sdk-go/api/apifabclient"
	"github.com/hyperledger/fabric-sdk-go/api/apitxn/chclient"
	"github.com/hyperledger/fabric-sdk-go/pkg/errors/status"
	"github.com/hyperledger/fabric-sdk-go/pkg/fabric-client/peer"
	"github.com/hyperledger/fabric-sdk-go/pkg/fabric-client/txn"
	"github.com/hyperledger/fabric-sdk-go/pkg/logging"
	"github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common"
	"github.com/pkg/errors"
)
var logger = logging.NewLogger("fabric_sdk_go")
type EndorsementHandler struct {
	next chclient.Handler
}
func (e *EndorsementHandler) Handle(requestContext *chclient.RequestContext, clientContext *chclient.ClientContext) {
	transactionProposalResponses, txnID, err := createAndSendTransactionProposal(clientContext.Channel, &requestContext.Request, requestContext.Opts.ProposalProcessors)
	requestContext.Response.TransactionID = txnID
	if err != nil {
		requestContext.Error = err
		return
	}
	requestContext.Response.Responses = transactionProposalResponses
	if len(transactionProposalResponses) > 0 {
		requestContext.Response.Payload = transactionProposalResponses[0].ProposalResponse.GetResponse().Payload
	}
	if e.next != nil {
		e.next.Handle(requestContext, clientContext)
	}
}
type ProposalProcessorHandler struct {
	next chclient.Handler
}