Documentation ¶
Index ¶
- func PeersToTxnProcessors(peers []fab.Peer) []fab.ProposalProcessor
- type Option
- type Peer
- func New(config apiconfig.Config, opts ...Option) (*Peer, error)
- func NewPeer(url string, config apiconfig.Config) (*Peer, error)
- func NewPeerFromConfig(peerCfg *apiconfig.NetworkPeer, config apiconfig.Config) (*Peer, error)
- func NewPeerFromProcessor(url string, processor apifabclient.ProposalProcessor, config apiconfig.Config) (*Peer, error)
- func NewPeerTLSFromCert(url string, certPath string, serverHostOverride string, ...) (*Peer, error)
- func (p *Peer) EnrollmentCertificate() *pem.Block
- func (p *Peer) MSPID() string
- func (p *Peer) Name() string
- func (p *Peer) ProcessTransactionProposal(proposal fab.TransactionProposal) (fab.TransactionProposalResponse, 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
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 *apiconfig.NetworkPeer) Option
FromPeerConfig is a functional option for the peer.New constructor that configures a new peer from a apiconfig.NetworkPeer struct
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 *sm2.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 NewPeer ¶
NewPeer constructs a Peer given its endpoint configuration settings. url is the URL with format of "host:port". Deprecated: use peer.New() instead
func NewPeerFromConfig ¶
NewPeerFromConfig constructs a Peer from given peer configuration and global configuration setting. Deprecated: use peer.New() instead
func NewPeerFromProcessor ¶
func NewPeerFromProcessor(url string, processor apifabclient.ProposalProcessor, config apiconfig.Config) (*Peer, error)
NewPeerFromProcessor constructs a Peer with a ProposalProcessor to simulate transactions. Deprecated: use peer.New() instead
func NewPeerTLSFromCert ¶
func NewPeerTLSFromCert(url string, certPath 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. Deprecated: use peer.New() instead
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 fab.TransactionProposal) (fab.TransactionProposalResponse, 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.