Documentation ¶
Index ¶
- func PeersToTxnProcessors(peers []fab.Peer) []apitxn.ProposalProcessor
- type Peer
- func (p *Peer) EnrollmentCertificate() *pem.Block
- func (p *Peer) MSPID() string
- func (p *Peer) Name() string
- func (p *Peer) ProcessTransactionProposal(proposal apitxn.TransactionProposal) (apitxn.TransactionProposalResult, error)
- func (p *Peer) Roles() []string
- func (p *Peer) SetEnrollmentCertificate(pem *pem.Block)
- func (p *Peer) SetMSPID(mspID string)
- func (p *Peer) SetName(name string)
- func (p *Peer) SetRoles(roles []string)
- func (p *Peer) URL() string
- type TransactionProposalError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PeersToTxnProcessors ¶
func PeersToTxnProcessors(peers []fab.Peer) []apitxn.ProposalProcessor
PeersToTxnProcessors converts a slice of Peers to a slice of TxnProposalProcessors
Types ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer represents a node in the target blockchain network to which HFC sends endorsement proposals, transaction ordering or query requests.
func NewPeer ¶
NewPeer constructs a Peer given its endpoint configuration settings. url is the URL with format of "host:port".
func NewPeerFromProcessor ¶
func NewPeerFromProcessor(url string, processor apitxn.ProposalProcessor, config apiconfig.Config) (*Peer, error)
NewPeerFromProcessor constructs a Peer with a ProposalProcessor to simulate transactions.
func NewPeerTLSFromCert ¶
func NewPeerTLSFromCert(url string, certificate string, serverHostOverride string, config apiconfig.Config) (*Peer, error)
NewPeerTLSFromCert constructs a Peer given its endpoint configuration settings. url is the URL with format of "host:port". certificate is ... serverNameOverride is passed to NewClientTLSFromCert in grpc/credentials.
func (*Peer) EnrollmentCertificate ¶
EnrollmentCertificate returns the Peer's enrollment certificate. It returns the certificate in PEM format signed by the trusted CA.
func (*Peer) ProcessTransactionProposal ¶
func (p *Peer) ProcessTransactionProposal(proposal apitxn.TransactionProposal) (apitxn.TransactionProposalResult, error)
ProcessTransactionProposal sends the created proposal to peer for endorsement.
func (*Peer) Roles ¶
Roles gets the user’s roles the Peer participates in. It’s an array of possible values in “client”, and “auditor”. The member service defines two more roles reserved for peer membership: “peer” and “validator”, which are not exposed to the applications. It returns the roles for this user.
func (*Peer) SetEnrollmentCertificate ¶
SetEnrollmentCertificate set the Peer’s enrollment certificate. pem is the enrollment Certificate in PEM format signed by the trusted CA.
type TransactionProposalError ¶
type TransactionProposalError struct { Endorser string Proposal apitxn.TransactionProposal Err error }
TransactionProposalError represents an error condition that prevented proposal processing.
func (TransactionProposalError) Error ¶
func (tpe TransactionProposalError) Error() string