Documentation ¶
Index ¶
- func PeersToTxnProcessors(peers []fab.Peer) []fab.ProposalProcessor
- type Option
- func FromPeerConfig(peerCfg *fab.NetworkPeer) Option
- func WithInsecure() Option
- func WithMSPID(mspID string) Option
- func WithPeerProcessor(processor fab.ProposalProcessor) Option
- func WithServerName(serverName string) Option
- func WithTLSCert(certificate *x509.Certificate) Option
- func WithURL(url string) Option
- type Peer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PeersToTxnProcessors ¶
func PeersToTxnProcessors(peers []fab.Peer) []fab.ProposalProcessor
PeersToTxnProcessors converts a slice of Peers to a slice of TxnProposalProcessors
Types ¶
type Option ¶
Option describes a functional parameter for the New constructor
func FromPeerConfig ¶
func FromPeerConfig(peerCfg *fab.NetworkPeer) Option
FromPeerConfig is a functional option for the peer.New constructor that configures a new peer from a apiconfig.NetworkPeer struct
func WithInsecure ¶
func WithInsecure() Option
WithInsecure is a functional option for the peer.New constructor that configures the peer's grpc insecure option
func WithMSPID ¶
WithMSPID is a functional option for the peer.New constructor that configures the peer's msp ID
func WithPeerProcessor ¶
func WithPeerProcessor(processor fab.ProposalProcessor) Option
WithPeerProcessor is a functional option for the peer.New constructor that configures the peer's proposal processor
func WithServerName ¶
WithServerName is a functional option for the peer.New constructor that configures the peer's server name
func WithTLSCert ¶
func WithTLSCert(certificate *x509.Certificate) Option
WithTLSCert is a functional option for the peer.New constructor that configures the peer's TLS certificate
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 New ¶
func New(config fab.EndpointConfig, opts ...Option) (*Peer, error)
New Returns a new Peer instance
func (*Peer) ProcessTransactionProposal ¶
func (p *Peer) ProcessTransactionProposal(ctx reqContext.Context, proposal fab.ProcessProposalRequest) (*fab.TransactionProposalResponse, error)
ProcessTransactionProposal sends the created proposal to peer for endorsement.
func (*Peer) Properties ¶
func (p *Peer) Properties() fab.Properties
Properties returns the properties of a peer.